]> www.infradead.org Git - users/hch/misc.git/commitdiff
drm/vkms: Add P01* formats
authorLouis Chauvet <louis.chauvet@bootlin.com>
Thu, 3 Jul 2025 07:57:04 +0000 (09:57 +0200)
committerLouis Chauvet <louis.chauvet@bootlin.com>
Fri, 5 Sep 2025 17:57:26 +0000 (19:57 +0200)
The formats NV 12/16/24/21/61/42 were already supported.
Add support for:
- P010
- P012
- P016

Reviewed-by: MaĆ­ra Canal <mcanal@igalia.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Link: https://lore.kernel.org/r/20250703-b4-new-color-formats-v7-8-15fd8fd2e15c@bootlin.com
Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
drivers/gpu/drm/vkms/vkms_formats.c
drivers/gpu/drm/vkms/vkms_plane.c

index 639b1c7ca43e61e5ea3099fe4d7b0a5e7e9d85e6..dfb8e13cba87a961accb98d7f5255e9e6bf150c1 100644 (file)
@@ -528,7 +528,8 @@ static void function_name(const struct vkms_plane_state *plane, int x_start,                        \
 
 READ_LINE_YUV_SEMIPLANAR(YUV888_semiplanar_read_line, y, uv, u8, u8, argb_u16_from_yuv161616,
                         y[0] * 257, uv[0] * 257, uv[1] * 257)
-
+READ_LINE_YUV_SEMIPLANAR(YUV161616_semiplanar_read_line, y, uv, u16, u16, argb_u16_from_yuv161616,
+                        y[0], uv[0], uv[1])
 /*
  * This callback can be used for YUV format where each color component is
  * stored in a different plane (often called planar formats). It will
@@ -725,6 +726,10 @@ pixel_read_line_t get_pixel_read_line_function(u32 format)
        case DRM_FORMAT_NV61:
        case DRM_FORMAT_NV42:
                return &YUV888_semiplanar_read_line;
+       case DRM_FORMAT_P010:
+       case DRM_FORMAT_P012:
+       case DRM_FORMAT_P016:
+               return &YUV161616_semiplanar_read_line;
        case DRM_FORMAT_YUV420:
        case DRM_FORMAT_YUV422:
        case DRM_FORMAT_YUV444:
index 9f34f3a18d8cd67021d7187754bd6a65375ca17a..e592e47a5736f097b1517a23489ca9585dbf8430 100644 (file)
@@ -39,6 +39,9 @@ static const u32 vkms_formats[] = {
        DRM_FORMAT_YVU420,
        DRM_FORMAT_YVU422,
        DRM_FORMAT_YVU444,
+       DRM_FORMAT_P010,
+       DRM_FORMAT_P012,
+       DRM_FORMAT_P016,
        DRM_FORMAT_R1,
        DRM_FORMAT_R2,
        DRM_FORMAT_R4,