[05/10] libcamera: formats: Add CRU-packed RAWnn libcamera formats
diff mbox series

Message ID 20250724065256.75175-6-dan.scally@ideasonboard.com
State New
Headers show
Series
  • Support memory input mode in mali-c55
Related show

Commit Message

Dan Scally July 24, 2025, 6:52 a.m. UTC
Add libcamera formats for the CRU-packed, bayer order agnostic CRU
pixel formats that map to the V4L2 Pixel Formats in the kernel
header.

Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
---
 src/libcamera/formats.cpp  | 30 ++++++++++++++++++++++++++++++
 src/libcamera/formats.yaml | 13 +++++++++++++
 2 files changed, 43 insertions(+)

Patch
diff mbox series

diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp
index bfcdfc08..8f10d1ec 100644
--- a/src/libcamera/formats.cpp
+++ b/src/libcamera/formats.cpp
@@ -969,6 +969,36 @@  const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
 		.pixelsPerGroup = 2,
 		.planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},
 	} },
+	{ formats::RAW10_CRU, {
+		.name = "RAW10_CRU",
+		.format = formats::RAW10_CRU,
+		.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_RAW_CRU10), },
+		.bitsPerPixel = 10,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+		.packed = true,
+		.pixelsPerGroup = 6,
+		.planes = {{ { 8, 1 }, { 0, 0 }, { 0, 0 } }},
+	} },
+	{ formats::RAW12_CRU, {
+		.name = "RAW12_CRU",
+		.format = formats::RAW12_CRU,
+		.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_RAW_CRU12), },
+		.bitsPerPixel = 12,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+		.packed = true,
+		.pixelsPerGroup = 5,
+		.planes = {{ { 8, 1 }, { 0, 0 }, { 0, 0 } }},
+	} },
+	{ formats::RAW14_CRU, {
+		.name = "RAW14_CRU",
+		.format = formats::RAW14_CRU,
+		.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_RAW_CRU14), },
+		.bitsPerPixel = 14,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+		.packed = true,
+		.pixelsPerGroup = 4,
+		.planes = {{ { 8, 1 }, { 0, 0 }, { 0, 0 } }},
+	} },
 	/* Compressed formats. */
 	{ formats::MJPEG, {
 		.name = "MJPEG",
diff --git a/src/libcamera/formats.yaml b/src/libcamera/formats.yaml
index 2d54d391..47188fc8 100644
--- a/src/libcamera/formats.yaml
+++ b/src/libcamera/formats.yaml
@@ -209,4 +209,17 @@  formats:
   - MONO_PISP_COMP1:
       fourcc: DRM_FORMAT_R16
       mod: PISP_FORMAT_MOD_COMPRESS_MODE1
+
+  - RAW10_CRU:
+      fourcc: DRM_FORMAT_RAW10
+      mod: RENESAS_CRU_FORMAT_MOD_PACKED
+  - RAW12_CRU:
+      fourcc: DRM_FORMAT_RAW12
+      mod: RENESAS_CRU_FORMAT_MOD_PACKED
+  - RAW14_CRU:
+      fourcc: DRM_FORMAT_RAW14
+      mod: RENESAS_CRU_FORMAT_MOD_PACKED
+  - RAW20_CRU:
+      fourcc: DRM_FORMAT_RAW20
+      mod: RENESAS_CRU_FORMAT_MOD_PACKED
 ...