From 1b84258e665fa85da14fd474c65adec026933443 Mon Sep 17 00:00:00 2001 From: Justin Green Date: Tue, 5 Mar 2024 11:07:12 -0500 Subject: [PATCH] mediatek: Add AR30 overlay support Add support for AR30 overlays to select MTK devices. BUG=b:325625530 TEST=Tested by running MT2T->AR30 image processing tests on MT8188G. Change-Id: I570ee740e49b5d9c61a1e1d0da777fdcc937321d Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/5345669 Reviewed-by: Miguel Casas-Sanchez Commit-Queue: Justin Green Reviewed-by: Jeffrey Kardatzke Tested-by: Justin Green --- mediatek.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/mediatek.c b/mediatek.c index c3ac869..6ebde6e 100644 --- a/mediatek.c +++ b/mediatek.c @@ -32,13 +32,6 @@ #define SUPPORT_YUV422 #endif -// clang-format off -#if defined(MTK_MT8195) || \ - defined(MTK_MT8188G) -// clang-format on -#define SUPPORT_P010 -#endif - // All platforms except MT8173 should USE_NV12_FOR_HW_VIDEO_DECODING // and SUPPORT_FP16_AND_10BIT_ABGR // clang-format off @@ -54,6 +47,17 @@ #define DONT_USE_64_ALIGNMENT_FOR_VIDEO_BUFFERS #endif +// Devices newer than MT8186 support AR30 overlays and 10-bit video. +// clang-format off +#if !defined(MTK_MT8173) && \ + !defined(MTK_MT8183) && \ + !defined(MTK_MT8186) && \ + !defined(MTK_MT8192) +// clang-format on +#define SUPPORT_P010 +#define SUPPORT_AR30_OVERLAYS +#endif + // For Mali Sigurd based GPUs, the texture unit reads outside the specified texture dimensions. // Therefore, certain formats require extra memory padding to its allocated surface to prevent the // hardware from reading outside an allocation. For YVU420, we need additional padding for the last @@ -126,6 +130,11 @@ static int mediatek_init(struct driver *drv) drv_add_combination(drv, DRM_FORMAT_R8, &LINEAR_METADATA, BO_USE_SW_MASK | BO_USE_LINEAR | BO_USE_PROTECTED); +#ifdef SUPPORT_AR30_OVERLAYS + drv_add_combination(drv, DRM_FORMAT_ARGB2101010, &LINEAR_METADATA, + BO_USE_TEXTURE | BO_USE_SCANOUT | BO_USE_PROTECTED | BO_USE_LINEAR); +#endif + /* YUYV format for video overlay and camera subsystem. */ drv_add_combination(drv, DRM_FORMAT_YUYV, &LINEAR_METADATA, BO_USE_HW_VIDEO_DECODER | BO_USE_SCANOUT | BO_USE_LINEAR |