From dc9b1204517ef9f2a8cdab4e03056bd51ed6fa70 Mon Sep 17 00:00:00 2001 From: Gurchetan Singh Date: Tue, 4 Jun 2019 16:53:54 -0700 Subject: [PATCH] minigbm: rockchip/mediatek: remove R8 as texture source on Mali/Bifrost MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit EGL can't import this format on Mali/Bifrost. BUG=chromium:969044 TEST=Ozone unit test Change-Id: I356ec2bd35030af600b268bf39565e30e16465f5 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/1643677 Reviewed-by: Stéphane Marchesin Tested-by: Gurchetan Singh Legacy-Commit-Queue: Commit Bot Commit-Queue: ChromeOS CL Exonerator Bot --- helpers.c | 2 +- mediatek.c | 11 ++++++----- rockchip.c | 9 +++++---- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/helpers.c b/helpers.c index 1f5dfbb..229d6be 100644 --- a/helpers.c +++ b/helpers.c @@ -542,7 +542,7 @@ struct drv_array *drv_query_kms(struct driver *drv) { struct drv_array *kms_items; uint64_t plane_type = UINT64_MAX; - uint64_t use_flag; + uint64_t use_flag; uint32_t i, j, k; drmModePlanePtr plane; diff --git a/mediatek.c b/mediatek.c index d3a2727..7282437 100644 --- a/mediatek.c +++ b/mediatek.c @@ -36,12 +36,12 @@ static const uint32_t render_target_formats[] = { DRM_FORMAT_ABGR8888, DRM_FORMA DRM_FORMAT_XRGB8888 }; #ifdef MTK_MT8183 -static const uint32_t texture_source_formats[] = { DRM_FORMAT_R8, DRM_FORMAT_NV21, - DRM_FORMAT_NV12, DRM_FORMAT_YUYV, - DRM_FORMAT_YVU420, DRM_FORMAT_YVU420_ANDROID }; +static const uint32_t texture_source_formats[] = { DRM_FORMAT_NV21, DRM_FORMAT_NV12, + DRM_FORMAT_YUYV, DRM_FORMAT_YVU420, + DRM_FORMAT_YVU420_ANDROID }; #else -static const uint32_t texture_source_formats[] = { DRM_FORMAT_R8, DRM_FORMAT_YVU420, - DRM_FORMAT_YVU420_ANDROID, DRM_FORMAT_NV12 }; +static const uint32_t texture_source_formats[] = { DRM_FORMAT_YVU420, DRM_FORMAT_YVU420_ANDROID, + DRM_FORMAT_NV12 }; #endif static int mediatek_init(struct driver *drv) @@ -54,6 +54,7 @@ static int mediatek_init(struct driver *drv) drv_add_combinations(drv, texture_source_formats, ARRAY_SIZE(texture_source_formats), &LINEAR_METADATA, BO_USE_TEXTURE_MASK); + drv_add_combination(drv, DRM_FORMAT_R8, &metadata, BO_USE_SW_MASK | BO_USE_LINEAR); /* * Chrome uses DMA-buf mmap to write to YV12 buffers, which are then accessed by the * Video Encoder Accelerator (VEA). It could also support NV12 potentially in the future. diff --git a/rockchip.c b/rockchip.c index e620a1b..9d1cf44 100644 --- a/rockchip.c +++ b/rockchip.c @@ -27,8 +27,8 @@ static const uint32_t render_target_formats[] = { DRM_FORMAT_ABGR8888, DRM_FORMA DRM_FORMAT_BGR888, DRM_FORMAT_RGB565, DRM_FORMAT_XBGR8888, DRM_FORMAT_XRGB8888 }; -static const uint32_t texture_source_formats[] = { DRM_FORMAT_R8, DRM_FORMAT_NV12, - DRM_FORMAT_YVU420, DRM_FORMAT_YVU420_ANDROID }; +static const uint32_t texture_source_formats[] = { DRM_FORMAT_NV12, DRM_FORMAT_YVU420, + DRM_FORMAT_YVU420_ANDROID }; static int afbc_bo_from_format(struct bo *bo, uint32_t width, uint32_t height, uint32_t format) { @@ -139,8 +139,9 @@ static int rockchip_init(struct driver *drv) * R8 format is used for Android's HAL_PIXEL_FORMAT_BLOB and is used for JPEG snapshots * from camera. */ - drv_modify_combination(drv, DRM_FORMAT_R8, &metadata, - BO_USE_CAMERA_READ | BO_USE_CAMERA_WRITE); + drv_add_combination(drv, DRM_FORMAT_R8, &metadata, + BO_USE_CAMERA_READ | BO_USE_CAMERA_WRITE | BO_USE_SW_MASK | + BO_USE_LINEAR); kms_items = drv_query_kms(drv); if (!kms_items) -- 2.11.0