Implement cl_khr_gl_sharing by using upstream technology.
authorZhigang Gong <zhigang.gong@linux.intel.com>
Tue, 26 Feb 2013 09:36:53 +0000 (17:36 +0800)
committerZhigang Gong <zhigang.gong@linux.intel.com>
Wed, 10 Apr 2013 06:52:30 +0000 (14:52 +0800)
commitc0d17ecc4df00b98b0d9a23c99864e8181c16f17
tree7c6967a399891be7fa924b9c96f8120539b6fe12
parente67bbed43662ee6c749819e830a17053b4d0e365
Implement cl_khr_gl_sharing by using upstream technology.

The previous implementation use a modified mesa library
and can't work with upstream mesa.

Now I managed to use existing egl extension and gbm to
import a gl texture to a cl image. Actually, the gbm
can't fully support our purpose, as it can't lookup
image for egl x11 platform. We have to touch gbm's
internal data structure to manually initialize its image
extension.

Furthermore, gbm only provide the API to get the image's
handle, and doesn't provide the one to get image's name.
As we are using different fd from the existing GL loader.
The handle is useless for us. I use the DRI2 image extension
function directly to get the name rather than the handle.
And it works well.

Now, after this patch applied. The cl_khr_gl_sharing could
work with upstream mesa. I recommend you use the latest git
master version.

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Tested-by: Homer Hsing <homer.xing@intel.com>
13 files changed:
CMakeLists.txt
src/CMakeLists.txt
src/cl_driver.h
src/cl_driver_defs.c
src/cl_gl_api.c
src/cl_mem.h
src/cl_mem_gl.c
src/cl_mem_gl.h [new file with mode: 0644]
src/intel/intel_driver.c
src/intel/intel_driver.h
src/intel/intel_gpgpu.c
src/x11/dricommon.h
src/x11/gbm_dri2_x11_platform.c [new file with mode: 0644]