mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] drm/vkms: Add YUV410, YUV411, YVU410, and YVU411 support
@ 2026-02-01 14:02 Renjun Wang
  2026-02-02 12:14 ` Louis Chauvet
  0 siblings, 1 reply; 5+ messages in thread
From: Renjun Wang @ 2026-02-01 14:02 UTC (permalink / raw)
  To: louis.chauvet, hamohammed.sa, simona, melissa.srw,
	maarten.lankhorst, mripard, tzimmermann, airlied
  Cc: dri-devel, linux-kernel, Renjun Wang

Add support for the following planar YUV formats:
- DRM_FORMAT_YUV410
- DRM_FORMAT_YUV411
- DRM_FORMAT_YVU410
- DRM_FORMAT_YVU411

These formats are handled by the existing planar_yuv_read_line()
function, which correctly handles the subsampling defined in each
format's drm_format_info.

The YVU variants (YVU410, YVU411) are also added to
get_conversion_matrix_to_argb_u16() to ensure the U and V columns
are swapped correctly in the conversion matrix.

Signed-off-by: Renjun Wang <renjunw0@foxmail.com>
---
 drivers/gpu/drm/vkms/vkms_formats.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/vkms/vkms_formats.c b/drivers/gpu/drm/vkms/vkms_formats.c
index dfb8e13cba87..5ef5d49a44ef 100644
--- a/drivers/gpu/drm/vkms/vkms_formats.c
+++ b/drivers/gpu/drm/vkms/vkms_formats.c
@@ -730,9 +730,13 @@ pixel_read_line_t get_pixel_read_line_function(u32 format)
 	case DRM_FORMAT_P012:
 	case DRM_FORMAT_P016:
 		return &YUV161616_semiplanar_read_line;
+	case DRM_FORMAT_YUV410:
+	case DRM_FORMAT_YUV411:
 	case DRM_FORMAT_YUV420:
 	case DRM_FORMAT_YUV422:
 	case DRM_FORMAT_YUV444:
+	case DRM_FORMAT_YVU410:
+	case DRM_FORMAT_YVU411:
 	case DRM_FORMAT_YVU420:
 	case DRM_FORMAT_YVU422:
 	case DRM_FORMAT_YVU444:
@@ -921,6 +925,8 @@ void get_conversion_matrix_to_argb_u16(u32 format,
 	memcpy(matrix, matrix_to_copy, sizeof(*matrix_to_copy));
 
 	switch (format) {
+	case DRM_FORMAT_YVU410:
+	case DRM_FORMAT_YVU411:
 	case DRM_FORMAT_YVU420:
 	case DRM_FORMAT_YVU422:
 	case DRM_FORMAT_YVU444:
-- 
2.47.3


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-02-03 14:16 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-02-01 14:02 [PATCH] drm/vkms: Add YUV410, YUV411, YVU410, and YVU411 support Renjun Wang
2026-02-02 12:14 ` Louis Chauvet
2026-02-02 12:46   ` Louis Chauvet
2026-02-02 14:50     ` Renjun Wang
2026-02-03 14:16       ` Renjun Wang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®