OSDN Git Service

minigbm: cros_gralloc: map protected flag to linear
authorGurchetan Singh <gurchetansingh@chromium.org>
Fri, 16 Oct 2020 17:28:04 +0000 (10:28 -0700)
committerCommit Bot <commit-bot@chromium.org>
Tue, 20 Oct 2020 03:16:06 +0000 (03:16 +0000)
This should be fine since the dummy fd was never used
with the encoder / decoders, so it doesn't need to be
tiled.

BUG=b/171018855
TEST=GtsExoPlayerTestCases / GtsMediaTestCases

Change-Id: I1309a641e19a9196e0aed05f4820e0d2672fafa0
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/2481223
Reviewed-by: Gurchetan Singh <gurchetansingh@chromium.org>
Reviewed-by: Jeffrey Kardatzke <jkardatzke@google.com>
Reviewed-by: David Stevens <stevensd@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Auto-Submit: Gurchetan Singh <gurchetansingh@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>

cros_gralloc/gralloc0/gralloc0.cc
cros_gralloc/gralloc3/CrosGralloc3Utils.cc
cros_gralloc/gralloc4/CrosGralloc4Utils.cc

index fd1843e..f67ddff 100644 (file)
@@ -80,9 +80,9 @@ static uint64_t gralloc0_convert_usage(int usage)
                 * rockchip) and usb monitors (evdi/udl). It's complicated so ignore it.
                 * */
                use_flags |= BO_USE_NONE;
-       /* Ignore this flag until real HW protection is available on minigbm Android drivers. */
+       /* Map this flag to linear until real HW protection is available on Android. */
        if (usage & GRALLOC_USAGE_PROTECTED)
-               use_flags |= 0;
+               use_flags |= BO_USE_LINEAR;
        if (usage & GRALLOC_USAGE_HW_VIDEO_ENCODER) {
                use_flags |= BO_USE_HW_VIDEO_ENCODER;
                /*HACK: See b/30054495 */
index 64d2314..f48c346 100644 (file)
@@ -278,9 +278,9 @@ int convertToBufferUsage(uint64_t grallocUsage, uint64_t* outBufferUsage) {
         /* HWC wants to use display hardware, but can defer to OpenGL. */
         bufferUsage |= BO_USE_SCANOUT | BO_USE_TEXTURE;
     }
-    /* Ignore this flag until real HW protection is available on minigbm Android drivers. */
+    /* Map this flag to linear until real HW protection is available on Android. */
     if (grallocUsage & BufferUsage::PROTECTED) {
-        bufferUsage |= 0;
+        bufferUsage |= BO_USE_LINEAR;
     }
     if (grallocUsage & BufferUsage::COMPOSER_CURSOR) {
         bufferUsage |= BO_USE_NONE;
index 15f4a58..1a7092c 100644 (file)
@@ -282,9 +282,9 @@ int convertToBufferUsage(uint64_t grallocUsage, uint64_t* outBufferUsage) {
         /* HWC wants to use display hardware, but can defer to OpenGL. */
         bufferUsage |= BO_USE_SCANOUT | BO_USE_TEXTURE;
     }
-    /* Ignore this flag until real HW protection is available on minigbm Android drivers. */
+    /* Map this flag to linear until real HW protection is available on Android. */
     if (grallocUsage & BufferUsage::PROTECTED) {
-        bufferUsage |= 0;
+        bufferUsage |= BO_USE_LINEAR;
     }
     if (grallocUsage & BufferUsage::COMPOSER_CURSOR) {
         bufferUsage |= BO_USE_NONE;