OSDN Git Service

GLConsumer: add build-time disable of gpu protected content
authorJesse Hall <jessehall@google.com>
Wed, 4 May 2016 04:12:39 +0000 (21:12 -0700)
committerJesse Hall <jessehall@google.com>
Wed, 4 May 2016 04:12:39 +0000 (21:12 -0700)
Some drivers incorrectly claim support for EGL_EXT_protected_content.
Until we've been able to verify that devices which claim support
actually implement it properly, require that GPU access to protected
content be manually enabled per-device.

Bug: 28545166
Change-Id: Ic10e47a99c38737ce1c39439fe9347d628aec491

libs/gui/Android.mk
libs/gui/GLConsumer.cpp

index 635020e..6e92a47 100644 (file)
@@ -93,6 +93,12 @@ ifeq ($(TARGET_BOARD_PLATFORM), tegra3)
        LOCAL_CFLAGS += -DDONT_USE_FENCE_SYNC
 endif
 
+ifeq ($(BOARD_ENABLE_GPU_PROTECTED_CONTENT),true)
+       LOCAL_CFLAGS += -DENABLE_GPU_PROTECTED_CONTENT=true
+else
+       LOCAL_CFLAGS += -DENABLE_GPU_PROTECTED_CONTENT=false
+endif
+
 include $(BUILD_SHARED_LIBRARY)
 
 ifeq (,$(ONE_SHOT_MAKEFILE))
index ac8bc6e..7a1ad46 100644 (file)
@@ -135,7 +135,8 @@ static bool hasEglProtectedContentImpl() {
     bool atEnd = (cropExtLen+1) < extsLen &&
             !strcmp(" " PROT_CONTENT_EXT_STR, exts + extsLen - (cropExtLen+1));
     bool inMiddle = strstr(exts, " " PROT_CONTENT_EXT_STR " ");
-    return equal || atStart || atEnd || inMiddle;
+    return ENABLE_GPU_PROTECTED_CONTENT &&
+            (equal || atStart || atEnd || inMiddle);
 }
 
 static bool hasEglProtectedContent() {