platform/minigbm: Add YUY2 support for Mediatek

Add YUY2 (DRM_FORMAT_YUYV) support for Mediatek platforms. Mediatek
devices support YUY2 hardware overlays, which we would like to exploit
to reduce video frame latency.

BUG=b:238137982
TEST=Tested with atomictest on Asurada

Change-Id: I42937956cb1017fea5f8997dd38d591a1b0b80b1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/3846866
Reviewed-by: Rob Clark <robdclark@chromium.org>
Tested-by: Justin Green <greenjustin@google.com>
Commit-Queue: Justin Green <greenjustin@google.com>
This commit is contained in:
Justin Green 2022-08-22 16:46:16 -04:00 committed by Chromeos LUCI
parent 64de5175a0
commit c9f6462456

View file

@ -70,6 +70,7 @@ static const uint32_t texture_source_formats[] = {
static const uint32_t video_yuv_formats[] = {
DRM_FORMAT_NV21,
DRM_FORMAT_NV12,
DRM_FORMAT_YUYV,
DRM_FORMAT_YVU420,
DRM_FORMAT_YVU420_ANDROID
};
@ -97,6 +98,10 @@ static int mediatek_init(struct driver *drv)
drv_add_combination(drv, DRM_FORMAT_R8, &LINEAR_METADATA, BO_USE_SW_MASK | BO_USE_LINEAR);
/* 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);
/* Android CTS tests require this. */
drv_add_combination(drv, DRM_FORMAT_BGR888, &LINEAR_METADATA, BO_USE_SW_MASK);