[v3,1/7] include: linux: Add RGB48 formats
diff mbox series

Message ID 20240510100208.12188-2-naush@raspberrypi.com
State Accepted
Commit 223a1d37550dbfe6f24081ae56a675a7e0b14d98
Headers show
Series
  • Pre Raspberry Pi 5 support changes
Related show

Commit Message

Naushir Patuck May 10, 2024, 10:02 a.m. UTC
Add support for 16-bps (48-bpp) RGB output formats in the uapi headers.
These new formats are defined for the RGB and BGR ordering.

The corresponding change submitted to the linux-media and DRM mailing
lists can be found at:

https://lore.kernel.org/linux-media/20240502110503.38412-3-jacopo.mondi@ideasonboard.com/
and
https://lore.kernel.org/dri-devel/20240226132544.82817-1-jacopo.mondi@ideasonboard.com/

respectively.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 include/linux/drm_fourcc.h | 4 ++++
 include/linux/videodev2.h  | 2 ++
 2 files changed, 6 insertions(+)

Patch
diff mbox series

diff --git a/include/linux/drm_fourcc.h b/include/linux/drm_fourcc.h
index d6c83d9c49f4..5133a6551a34 100644
--- a/include/linux/drm_fourcc.h
+++ b/include/linux/drm_fourcc.h
@@ -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 */
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 7e556911c9e1..4fdd91494041 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -555,6 +555,8 @@  struct v4l2_pix_format {
 
 /* RGB formats (6 or 8 bytes per pixel) */
 #define V4L2_PIX_FMT_BGR48_12    v4l2_fourcc('B', '3', '1', '2') /* 48  BGR 12-bit per component */
+#define V4L2_PIX_FMT_BGR48       v4l2_fourcc('B', 'G', 'R', '6') /* 48  BGR 16-bit per component */
+#define V4L2_PIX_FMT_RGB48       v4l2_fourcc('R', 'G', 'B', '6') /* 48  RGB 16-bit per component */
 #define V4L2_PIX_FMT_ABGR64_12   v4l2_fourcc('B', '4', '1', '2') /* 64  BGRA 12-bit per component */
 
 /* Grey formats */