From b7edf5dfd84d1af5216a9f337444aab186fa9671 Mon Sep 17 00:00:00 2001 From: Gurchetan Singh Date: Fri, 16 Oct 2020 10:28:04 -0700 Subject: [PATCH] minigbm: cros_gralloc: map protected flag to linear 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 Reviewed-by: Jeffrey Kardatzke Reviewed-by: David Stevens Tested-by: Gurchetan Singh Auto-Submit: Gurchetan Singh Commit-Queue: Gurchetan Singh --- cros_gralloc/gralloc0/gralloc0.cc | 4 ++-- cros_gralloc/gralloc3/CrosGralloc3Utils.cc | 4 ++-- cros_gralloc/gralloc4/CrosGralloc4Utils.cc | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cros_gralloc/gralloc0/gralloc0.cc b/cros_gralloc/gralloc0/gralloc0.cc index fd1843e..f67ddff 100644 --- a/cros_gralloc/gralloc0/gralloc0.cc +++ b/cros_gralloc/gralloc0/gralloc0.cc @@ -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 */ diff --git a/cros_gralloc/gralloc3/CrosGralloc3Utils.cc b/cros_gralloc/gralloc3/CrosGralloc3Utils.cc index 64d2314..f48c346 100644 --- a/cros_gralloc/gralloc3/CrosGralloc3Utils.cc +++ b/cros_gralloc/gralloc3/CrosGralloc3Utils.cc @@ -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; diff --git a/cros_gralloc/gralloc4/CrosGralloc4Utils.cc b/cros_gralloc/gralloc4/CrosGralloc4Utils.cc index 15f4a58..1a7092c 100644 --- a/cros_gralloc/gralloc4/CrosGralloc4Utils.cc +++ b/cros_gralloc/gralloc4/CrosGralloc4Utils.cc @@ -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; -- 2.11.0