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 <daniels@collabora.com>
This commit is contained in:
Daniel Stone 2026-03-24 14:04:45 +00:00
parent 0c99e53fe9
commit 16a40edadc

View file

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