From 16a40edadcdcdd61d4fdb6991e0b0f2150c6be3b Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Tue, 24 Mar 2026 14:04:45 +0000 Subject: [PATCH] pixel-formats: Add support for compressed YUV YUV420_8BIT and YUV420_10BIT are special DRM formats, which exist to allow for NV12/P010-alike formats having combined storage for luma & chroma, rather than split planes. This is notably used to support AFBC compression for YUV buffers, as seen with at least Hantro codec engines and Mali GPUs. Signed-off-by: Daniel Stone --- libweston/pixel-formats.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/libweston/pixel-formats.c b/libweston/pixel-formats.c index 6f691f5e9..ebf0e2747 100644 --- a/libweston/pixel-formats.c +++ b/libweston/pixel-formats.c @@ -810,6 +810,22 @@ static const struct pixel_format_info pixel_format_table[] = { .hsub = 2, .vsub = 2, }, + { + DRM_FORMAT(YUV420_8BIT), + COLOR_MODEL(YUV), + .num_planes = 1, + /* this format is 2x2 subsampled, but we don't declare that as + * it's represented by a single plane; it's there to support + * compression */ + }, + { + DRM_FORMAT(YUV420_10BIT), + COLOR_MODEL(YUV), + .num_planes = 1, + /* this format is 2x2 subsampled, but we don't declare that as + * it's represented by a single plane; it's there to support + * compression */ + }, { DRM_FORMAT(YUV410), COLOR_MODEL(YUV),