[libcamera-devel,v5,03/11] libcamera: formats: Add R10_CSI2P format
diff mbox series

Message ID 20211101091510.23204-4-naush@raspberrypi.com
State Accepted
Commit 9e3470ad3e4f03364c8160917117d62fde5a7d88
Headers show
Series
  • Raspberry Pi: Conversion to media controller
Related show

Commit Message

Naushir Patuck Nov. 1, 2021, 9:15 a.m. UTC
This new formats corresponds to the V4L2 V4L2_PIX_FMT_Y10P format, and is a
CSI2-packed version of the DRM_FORMAT_R10 format.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
---
 src/libcamera/formats.cpp  | 13 +++++++++++++
 src/libcamera/formats.yaml |  4 ++++
 2 files changed, 17 insertions(+)

Comments

Kieran Bingham Nov. 1, 2021, 11:27 a.m. UTC | #1
Hi Naush,

Quoting Naushir Patuck (2021-11-01 09:15:02)
> This new formats corresponds to the V4L2 V4L2_PIX_FMT_Y10P format, and is a
> CSI2-packed version of the DRM_FORMAT_R10 format.

Thanks for the update. Indeed this matches what I had expected.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
> ---
>  src/libcamera/formats.cpp  | 13 +++++++++++++
>  src/libcamera/formats.yaml |  4 ++++
>  2 files changed, 17 insertions(+)
> 
> diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp
> index d4781dfb3874..afcaabc519f7 100644
> --- a/src/libcamera/formats.cpp
> +++ b/src/libcamera/formats.cpp
> @@ -510,6 +510,19 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
>                 .pixelsPerGroup = 1,
>                 .planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},
>         } },
> +       { formats::R10_CSI2P, {
> +               .name = "R10_CSI2P",
> +               .format = formats::R10,
> +               .v4l2Formats = {
> +                       .single = V4L2PixelFormat(V4L2_PIX_FMT_Y10P),
> +                       .multi = V4L2PixelFormat(),
> +               },
> +               .bitsPerPixel = 10,
> +               .colourEncoding = PixelFormatInfo::ColourEncodingYUV,
> +               .packed = true,
> +               .pixelsPerGroup = 4,
> +               .planes = {{ { 5, 1 }, { 0, 0 }, { 0, 0 } }},
> +       } },
>  
>         /* Bayer formats. */
>         { formats::SBGGR8, {
> diff --git a/src/libcamera/formats.yaml b/src/libcamera/formats.yaml
> index 22a8e473a183..1f3f043302c3 100644
> --- a/src/libcamera/formats.yaml
> +++ b/src/libcamera/formats.yaml
> @@ -109,6 +109,10 @@ formats:
>    - SBGGR16:
>        fourcc: DRM_FORMAT_SBGGR16
>  
> +  - R10_CSI2P:
> +      fourcc: DRM_FORMAT_R10
> +      mod: MIPI_FORMAT_MOD_CSI2_PACKED
> +
>    - SRGGB10_CSI2P:
>        fourcc: DRM_FORMAT_SRGGB10
>        mod: MIPI_FORMAT_MOD_CSI2_PACKED
> -- 
> 2.25.1
>

Patch
diff mbox series

diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp
index d4781dfb3874..afcaabc519f7 100644
--- a/src/libcamera/formats.cpp
+++ b/src/libcamera/formats.cpp
@@ -510,6 +510,19 @@  const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
 		.pixelsPerGroup = 1,
 		.planes = {{ { 2, 1 }, { 0, 0 }, { 0, 0 } }},
 	} },
+	{ formats::R10_CSI2P, {
+		.name = "R10_CSI2P",
+		.format = formats::R10,
+		.v4l2Formats = {
+			.single = V4L2PixelFormat(V4L2_PIX_FMT_Y10P),
+			.multi = V4L2PixelFormat(),
+		},
+		.bitsPerPixel = 10,
+		.colourEncoding = PixelFormatInfo::ColourEncodingYUV,
+		.packed = true,
+		.pixelsPerGroup = 4,
+		.planes = {{ { 5, 1 }, { 0, 0 }, { 0, 0 } }},
+	} },
 
 	/* Bayer formats. */
 	{ formats::SBGGR8, {
diff --git a/src/libcamera/formats.yaml b/src/libcamera/formats.yaml
index 22a8e473a183..1f3f043302c3 100644
--- a/src/libcamera/formats.yaml
+++ b/src/libcamera/formats.yaml
@@ -109,6 +109,10 @@  formats:
   - SBGGR16:
       fourcc: DRM_FORMAT_SBGGR16
 
+  - R10_CSI2P:
+      fourcc: DRM_FORMAT_R10
+      mod: MIPI_FORMAT_MOD_CSI2_PACKED
+
   - SRGGB10_CSI2P:
       fourcc: DRM_FORMAT_SRGGB10
       mod: MIPI_FORMAT_MOD_CSI2_PACKED