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 <mcasas@chromium.org>
Commit-Queue: Justin Green <greenjustin@google.com>
Reviewed-by: Jeffrey Kardatzke <jkardatzke@google.com>
Tested-by: Justin Green <greenjustin@google.com>
This commit is contained in:
Justin Green 2024-03-05 11:07:12 -05:00 committed by Chromeos LUCI
parent 8441cb7b81
commit 1b84258e66

View file

@ -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 |