diff options
author | Chuanbo Weng <chuanbo.weng@intel.com> | 2014-03-06 00:08:15 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@intel.com> | 2014-03-10 14:53:30 +0800 |
commit | 15a1b5db83feec9e5e9484bdcd751b2fd0b9a079 (patch) | |
tree | 37a97ff5e4e05286e2afa6a0edcd6884c921227f /include | |
parent | 081f98bc99eb5c37264e9f73f9633b6fd30248d1 (diff) |
Add clGetMemObjectFdIntel() api
Use this api to share buffer between OpenCL and v4l2. After import
the fd of OpenCL memory object to v4l2, v4l2 can directly read frame
into this memory object by the way of DMABUF, without memory-copy.
v2:
Check return value of cl_buffer_get_fd
Signed-off-by: Chuanbo Weng <chuanbo.weng@intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/CL/cl_intel.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/CL/cl_intel.h b/include/CL/cl_intel.h index 3fd73da7..f2fe9d40 100644 --- a/include/CL/cl_intel.h +++ b/include/CL/cl_intel.h @@ -122,6 +122,17 @@ typedef CL_API_ENTRY cl_mem (CL_API_CALL *clCreateImageFromLibvaIntel_fn)( const cl_libva_image * /* info */, cl_int * /* errcode_ret */); +/* Create buffer from libva's buffer object */ +extern CL_API_ENTRY cl_int CL_API_CALL +clGetMemObjectFdIntel(cl_context /* context */, + cl_mem /* Memory Obejct */, + int* /* returned fd */); + +typedef CL_API_ENTRY cl_int (CL_API_CALL *clGetMemObjectFdIntel_fn)( + cl_context /* context */, + cl_mem /* Memory Obejct */, + int* /* returned fd */); + #ifdef __cplusplus } #endif |