]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/fourcc: Add RGB161616 and BGR161616 formats
authorJacopo Mondi <jacopo.mondi@ideasonboard.com>
Mon, 26 Feb 2024 13:25:43 +0000 (14:25 +0100)
committerJavier Martinez Canillas <javierm@redhat.com>
Sat, 28 Jun 2025 07:36:16 +0000 (09:36 +0200)
Add FourCC definitions for the 48-bit RGB/BGR formats to the
DRM/KMS uapi.

The format will be used by the Raspberry Pi PiSP Back End,
supported by a V4L2 driver in kernel space and by libcamera in
userspace, which uses the DRM FourCC identifiers.

Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Rob Clark <robin.clark@oss.qualcomm.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
Link: https://lore.kernel.org/r/20240226132544.82817-1-jacopo.mondi@ideasonboard.com
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
drivers/gpu/drm/drm_fourcc.c
include/uapi/drm/drm_fourcc.h

index 55ddd99fd7f6a8e050e00ca5f97de689d69ebf2d..2890e889dd15119b66ab5980bcf084385f055f5d 100644 (file)
@@ -238,6 +238,14 @@ const struct drm_format_info *__drm_format_info(u32 format)
                { .format = DRM_FORMAT_ABGR2101010,     .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
                { .format = DRM_FORMAT_RGBA1010102,     .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
                { .format = DRM_FORMAT_BGRA1010102,     .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
+               { .format = DRM_FORMAT_RGB161616,       .depth = 0,
+                 .num_planes = 1, .char_per_block = { 6, 0, 0 },
+                 .block_w = { 1, 0, 0 }, .block_h = { 1, 0, 0 },
+                 .hsub = 1, .vsub = 1, .has_alpha = false },
+               { .format = DRM_FORMAT_BGR161616,       .depth = 0,
+                 .num_planes = 1, .char_per_block = { 6, 0, 0 },
+                 .block_w = { 1, 0, 0 }, .block_h = { 1, 0, 0 },
+                 .hsub = 1, .vsub = 1, .has_alpha = false },
                { .format = DRM_FORMAT_ARGB8888,        .depth = 32, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
                { .format = DRM_FORMAT_ABGR8888,        .depth = 32, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
                { .format = DRM_FORMAT_RGBA8888,        .depth = 32, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true },
index 0d375c5bfc9db01e88a2622f919cb99a236d2298..ea91aa8afde93dd29c0198c024c8b0884ddd1212 100644 (file)
@@ -210,6 +210,10 @@ extern "C" {
 #define DRM_FORMAT_RGBA1010102 fourcc_code('R', 'A', '3', '0') /* [31:0] R:G:B:A 10:10:10:2 little endian */
 #define DRM_FORMAT_BGRA1010102 fourcc_code('B', 'A', '3', '0') /* [31:0] B:G:R:A 10:10:10:2 little endian */
 
+/* 48 bpp RGB */
+#define DRM_FORMAT_RGB161616 fourcc_code('R', 'G', '4', '8') /* [47:0] R:G:B 16:16:16 little endian */
+#define DRM_FORMAT_BGR161616 fourcc_code('B', 'G', '4', '8') /* [47:0] B:G:R 16:16:16 little endian */
+
 /* 64 bpp RGB */
 #define DRM_FORMAT_XRGB16161616        fourcc_code('X', 'R', '4', '8') /* [63:0] x:R:G:B 16:16:16:16 little endian */
 #define DRM_FORMAT_XBGR16161616        fourcc_code('X', 'B', '4', '8') /* [63:0] x:B:G:R 16:16:16:16 little endian */