Re: [PATCH v3 02/11] drm/fourcc: Add DRM_FORMAT_XV15/XV20

From: Tomi Valkeinen
Date: Wed Mar 26 2025 - 09:02:24 EST


Hi,

On 17/02/2025 22:00, Dmitry Baryshkov wrote:
On Wed, Feb 12, 2025 at 04:56:06PM +0200, Tomi Valkeinen wrote:
Add two new pixel formats:

DRM_FORMAT_XV15 ("XV15")
DRM_FORMAT_XV20 ("XV20")

The formats are 2 plane 10 bit per component YCbCr, with the XV15 2x2
subsampled whereas XV20 is 2x1 subsampled.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@xxxxxxxxxxxxxxxx>
---
drivers/gpu/drm/drm_fourcc.c | 8 ++++++++
include/uapi/drm/drm_fourcc.h | 8 ++++++++
2 files changed, 16 insertions(+)

diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c
index 1e9afbf6ef99..bb0a2294573b 100644
--- a/drivers/gpu/drm/drm_fourcc.c
+++ b/drivers/gpu/drm/drm_fourcc.c
@@ -346,6 +346,14 @@ const struct drm_format_info *__drm_format_info(u32 format)
{ .format = DRM_FORMAT_P030, .depth = 0, .num_planes = 2,
.char_per_block = { 4, 8, 0 }, .block_w = { 3, 3, 0 }, .block_h = { 1, 1, 0 },
.hsub = 2, .vsub = 2, .is_yuv = true},
+ { .format = DRM_FORMAT_XV15, .depth = 0,
+ .num_planes = 2, .char_per_block = { 4, 8, 0 },
+ .block_w = { 3, 3, 0 }, .block_h = { 1, 1, 0 }, .hsub = 2,
+ .vsub = 2, .is_yuv = true },
+ { .format = DRM_FORMAT_XV20, .depth = 0,
+ .num_planes = 2, .char_per_block = { 4, 8, 0 },
+ .block_w = { 3, 3, 0 }, .block_h = { 1, 1, 0 }, .hsub = 2,
+ .vsub = 1, .is_yuv = true },

It might be beneficial to use the same formatting as previous entries,
it simplifies reviewing. If the patchset is resent, it would be nice to
get that fixed..

But which formatting... The previous entry (singular) is indeed a bit different. But many formats before DRM_FORMAT_P030 are formatted as these new entries (but then it again changes in earlier entries). It's a bit messy list...

But maybe the style in DRM_FORMAT_P030 is better than the style used in the new entries, so I could just go with that style.

Tomi