diff options
author | Guo Yejun <yejun.guo@intel.com> | 2014-11-07 16:18:54 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@intel.com> | 2014-11-07 15:50:41 +0800 |
commit | 075390db926de7bfd2ac853404ab1bcfc8b9c650 (patch) | |
tree | 9f70873dae000f4374025cfd27b3714562242b4d /CMakeLists.txt | |
parent | 54594b626c31a68956af97f69dc29132dc545f7c (diff) | |
download | beignet-075390db926de7bfd2ac853404ab1bcfc8b9c650.tar.gz |
support CL_MEM_USE_HOST_PTR with userptr for cl buffer
userptr is used to wrap a memory pointer (page aligned) supplied
by user space into a buffer object accessed by GPU, and so no extra
copy is needed. It is supported starting from linux kernel 3.16
and libdrm 2.4.58.
This patch is originally finished by Zhenyu Wang <zhenyuw@linux.intel.com>,
I did a little change and some code clean.
No regression issue found on IVB+Ubuntu14.10 with libdrm upgraded with tests:
beignet/utests, piglit, OpenCV/test&perf, conformance/basic&mem_host_flags&buffers
V2: add page align limit for data size, add comments for kernel without MMU_NOTIFIER
V3: add runtime check with host_unified_memory, return CL_MEM_OBJECT_ALLOCATION_FAILURE if failed
Signed-off-by: Guo Yejun <yejun.guo@intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Reviewed-by: Zhenyu Wang <zhenyuw@linux.intel.com>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 40cb74cc..15386f9b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -108,7 +108,7 @@ ENDIF(X11_FOUND) # DRM pkg_check_modules(DRM REQUIRED libdrm) IF(DRM_FOUND) - MESSAGE(STATUS "Looking for DRM - found at ${DRM_PREFIX}") + MESSAGE(STATUS "Looking for DRM - found at ${DRM_PREFIX} ${DRM_VERSION}") INCLUDE_DIRECTORIES(${DRM_INCLUDE_DIRS}) ELSE(DRM_FOUND) MESSAGE(STATUS "Looking for DRM - not found") @@ -118,7 +118,14 @@ ENDIF(DRM_FOUND) pkg_check_modules(DRM_INTEL libdrm_intel>=2.4.52) IF(DRM_INTEL_FOUND) INCLUDE_DIRECTORIES(${DRM_INTEL_INCLUDE_DIRS}) - MESSAGE(STATUS "Looking for DRM Intel - found at ${DRM_INTEL_PREFIX}") + MESSAGE(STATUS "Looking for DRM Intel - found at ${DRM_INTEL_PREFIX} ${DRM_INTEL_VERSION}") + #userptr support starts from 2.4.57, but 2.4.58 is the actual stable release + IF(DRM_INTEL_VERSION VERSION_GREATER 2.4.57) + MESSAGE(STATUS "Enable userptr support") + SET(DRM_INTEL_USERPTR "enable") + ELSE(DRM_INTEL_VERSION VERSION_GREATER 2.4.57) + MESSAGE(STATUS "Disable userptr support") + ENDIF(DRM_INTEL_VERSION VERSION_GREATER 2.4.57) ELSE(DRM_INTEL_FOUND) MESSAGE(FATAL_ERROR "Looking for DRM Intel (>= 2.4.52) - not found") ENDIF(DRM_INTEL_FOUND) |