[Beignet] [PATCH 09/10] Android: workaround libdrm flags.
Yang Rong
rong.r.yang at intel.com
Thu May 19 08:37:15 UTC 2016
Enable HAS_USERPTR and disable HAS_EU_TOTAL and HAS_SUBSLICE_TOTAL
by default, set the cherryview EU config to minimum.
Enable HAS_EU_TOTAL and HAS_SUBSLICE_TOTAL if android linux kernel
support.
Signed-off-by: Yang Rong <rong.r.yang at intel.com>
---
src/Android.mk | 4 ++--
src/intel/intel_driver.c | 14 ++++++++++++--
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/src/Android.mk b/src/Android.mk
index 8f00e3e..1d199f1 100644
--- a/src/Android.mk
+++ b/src/Android.mk
@@ -15,8 +15,8 @@ LOCAL_C_INCLUDES := $(TOP_C_INCLUDE) $(BEIGNET_ROOT_PATH)/backend/src/backend/ $
LOCAL_C_INCLUDES += $(DRM_INCLUDE_PATH)
LOCAL_C_INCLUDES += $(LLVM_INCLUDE_DIRS)
LOCAL_C_INCLUDES += hardware/drm_gralloc
-LOCAL_CPPFLAGS := $(TOP_CPPFLAGS) -std=c++11 -DCONFIG_NO_TLS_THREAD
-LOCAL_CFLAGS := $(TOP_CFLAGS) -DCONFIG_NO_TLS_THREAD
+LOCAL_CPPFLAGS := $(TOP_CPPFLAGS) -std=c++11 -DCONFIG_NO_TLS_THREAD -DHAS_USERPTR
+LOCAL_CFLAGS := $(TOP_CFLAGS) -DCONFIG_NO_TLS_THREAD -DHAS_USERPTR
OPTIONAL_EGL_LIBRARY :=
LOCAL_LDFLAGS := -Wl,-Bsymbolic
diff --git a/src/intel/intel_driver.c b/src/intel/intel_driver.c
index b3712e5..03d9d34 100644
--- a/src/intel/intel_driver.c
+++ b/src/intel/intel_driver.c
@@ -856,9 +856,14 @@ intel_update_device_info(cl_device_id device)
else if (IS_CHERRYVIEW(device->device_id))
printf(CHV_CONFIG_WARNING);
#else
- if (IS_CHERRYVIEW(device->device_id))
+ if (IS_CHERRYVIEW(device->device_id)) {
+#if defined(__ANDROID__)
+ device->max_compute_unit = 12;
+#else
printf(CHV_CONFIG_WARNING);
#endif
+ }
+#endif
#ifdef HAS_SUBSLICE_TOTAL
unsigned int subslice_total;
@@ -869,9 +874,14 @@ intel_update_device_info(cl_device_id device)
else if (IS_CHERRYVIEW(device->device_id))
printf(CHV_CONFIG_WARNING);
#else
- if (IS_CHERRYVIEW(device->device_id))
+ if (IS_CHERRYVIEW(device->device_id)) {
+#if defined(__ANDROID__)
+ device->sub_slice_count = 2;
+#else
printf(CHV_CONFIG_WARNING);
#endif
+ }
+#endif
//We should get the device memory dynamically, but the
//mapablce mem size usage is unknown. Just ignore it.
size_t total_mem,map_mem;
--
2.1.4
More information about the Beignet
mailing list