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

Message ID 20230318234014.29506-4-dan.scally@ideasonboard.com
State New
Headers show
Series
  • Support OV7251 in IPU3 pipeline and qcam
Related show

Commit Message

Daniel Scally March 18, 2023, 11:40 p.m. UTC
Add entries to libcamera's pixelFormatInfo map describing the IPU3_Y10
format which is exposed by the CIO2 device when connected to certain
camera sensors, such as the OmniVision 7251 IR Camera.

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

Comments

Laurent Pinchart March 19, 2023, 2:01 p.m. UTC | #1
Hi Dan,

Thank you for the patch.

On Sat, Mar 18, 2023 at 11:40:06PM +0000, Daniel Scally via libcamera-devel wrote:
> Add entries to libcamera's pixelFormatInfo map describing the IPU3_Y10
> format which is exposed by the CIO2 device when connected to certain
> camera sensors, such as the OmniVision 7251 IR Camera.
> 
> Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com>
> ---
>  src/libcamera/formats.cpp  | 10 ++++++++++
>  src/libcamera/formats.yaml |  3 +++
>  2 files changed, 13 insertions(+)
> 
> diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp
> index f5769c48..eda657c5 100644
> --- a/src/libcamera/formats.cpp
> +++ b/src/libcamera/formats.cpp
> @@ -517,6 +517,16 @@ const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
>  		.pixelsPerGroup = 4,
>  		.planes = {{ { 5, 1 }, { 0, 0 }, { 0, 0 } }},
>  	} },
> +	{ formats::Y10_IPU3, {
> +		.name = "Y10_IPU3",
> +		.format = formats::Y10_IPU3,
> +		.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_IPU3_Y10), },
> +		.bitsPerPixel = 10,
> +		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
> +		.packed = true,
> +		.pixelsPerGroup = 25,
> +		.planes = {{ { 32, 1 }, { 0, 0 }, { 0, 0 } }},
> +	} },
>  
>  	/* Bayer formats. */
>  	{ formats::SBGGR8, {
> diff --git a/src/libcamera/formats.yaml b/src/libcamera/formats.yaml
> index e586cde1..36d3016d 100644
> --- a/src/libcamera/formats.yaml
> +++ b/src/libcamera/formats.yaml
> @@ -161,4 +161,7 @@ formats:
>    - SBGGR10_IPU3:
>        fourcc: DRM_FORMAT_SBGGR10
>        mod: IPU3_FORMAT_MOD_PACKED
> +  - Y10_IPU3:

This should be named R10_IPU3. See the existing R10_CSI2P format.

> +      fourcc: DRM_FORMAT_Y10

And you should use DRM_FORMAT_R10.

> +      mod: IPU3_FORMAT_MOD_PACKED
>  ...

Patch
diff mbox series

diff --git a/src/libcamera/formats.cpp b/src/libcamera/formats.cpp
index f5769c48..eda657c5 100644
--- a/src/libcamera/formats.cpp
+++ b/src/libcamera/formats.cpp
@@ -517,6 +517,16 @@  const std::map<PixelFormat, PixelFormatInfo> pixelFormatInfo{
 		.pixelsPerGroup = 4,
 		.planes = {{ { 5, 1 }, { 0, 0 }, { 0, 0 } }},
 	} },
+	{ formats::Y10_IPU3, {
+		.name = "Y10_IPU3",
+		.format = formats::Y10_IPU3,
+		.v4l2Formats = { V4L2PixelFormat(V4L2_PIX_FMT_IPU3_Y10), },
+		.bitsPerPixel = 10,
+		.colourEncoding = PixelFormatInfo::ColourEncodingRAW,
+		.packed = true,
+		.pixelsPerGroup = 25,
+		.planes = {{ { 32, 1 }, { 0, 0 }, { 0, 0 } }},
+	} },
 
 	/* Bayer formats. */
 	{ formats::SBGGR8, {
diff --git a/src/libcamera/formats.yaml b/src/libcamera/formats.yaml
index e586cde1..36d3016d 100644
--- a/src/libcamera/formats.yaml
+++ b/src/libcamera/formats.yaml
@@ -161,4 +161,7 @@  formats:
   - SBGGR10_IPU3:
       fourcc: DRM_FORMAT_SBGGR10
       mod: IPU3_FORMAT_MOD_PACKED
+  - Y10_IPU3:
+      fourcc: DRM_FORMAT_Y10
+      mod: IPU3_FORMAT_MOD_PACKED
 ...