[v2,3/4] libcamera: bayer_format: Add Y12 to bayerToFormat
diff mbox series

Message ID 20240123143535.52255-4-kieran.bingham@ideasonboard.com
State Accepted
Headers show
Series
  • Mono format fixes
Related show

Commit Message

Kieran Bingham Jan. 23, 2024, 2:35 p.m. UTC
Support for Mono 12-bit formats were added to the mbusCodeToBayer table
without supplying the corresponding entry for converting the other way.

Add the relevant entry to the bayerToFormat table.

Fixes: ec6309571654 ("libcamera: bayer_format: Add unpacked mono 12-bit format to the conversion table")
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
v2: new patch

 src/libcamera/bayer_format.cpp | 2 ++
 1 file changed, 2 insertions(+)

Comments

Laurent Pinchart Jan. 23, 2024, 2:46 p.m. UTC | #1
On Tue, Jan 23, 2024 at 02:35:34PM +0000, Kieran Bingham wrote:
> Support for Mono 12-bit formats were added to the mbusCodeToBayer table
> without supplying the corresponding entry for converting the other way.
> 
> Add the relevant entry to the bayerToFormat table.
> 
> Fixes: ec6309571654 ("libcamera: bayer_format: Add unpacked mono 12-bit format to the conversion table")
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
> v2: new patch
> 
>  src/libcamera/bayer_format.cpp | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/src/libcamera/bayer_format.cpp b/src/libcamera/bayer_format.cpp
> index 175617a0edf5..20aedfa6d925 100644
> --- a/src/libcamera/bayer_format.cpp
> +++ b/src/libcamera/bayer_format.cpp
> @@ -170,6 +170,8 @@ const std::map<BayerFormat, Formats, BayerFormatComparator> bayerToFormat{
>  		{ formats::R10, V4L2PixelFormat(V4L2_PIX_FMT_Y10) } },
>  	{ { BayerFormat::MONO, 10, BayerFormat::Packing::CSI2 },
>  		{ formats::R10_CSI2P, V4L2PixelFormat(V4L2_PIX_FMT_Y10P) } },
> +	{ { BayerFormat::MONO, 12, BayerFormat::Packing::None },
> +		{ formats::R12, V4L2PixelFormat(V4L2_PIX_FMT_Y12) } },
>  	{ { BayerFormat::MONO, 16, BayerFormat::Packing::None },
>  		{ formats::R16, V4L2PixelFormat(V4L2_PIX_FMT_Y16) } },
>  };

Patch
diff mbox series

diff --git a/src/libcamera/bayer_format.cpp b/src/libcamera/bayer_format.cpp
index 175617a0edf5..20aedfa6d925 100644
--- a/src/libcamera/bayer_format.cpp
+++ b/src/libcamera/bayer_format.cpp
@@ -170,6 +170,8 @@  const std::map<BayerFormat, Formats, BayerFormatComparator> bayerToFormat{
 		{ formats::R10, V4L2PixelFormat(V4L2_PIX_FMT_Y10) } },
 	{ { BayerFormat::MONO, 10, BayerFormat::Packing::CSI2 },
 		{ formats::R10_CSI2P, V4L2PixelFormat(V4L2_PIX_FMT_Y10P) } },
+	{ { BayerFormat::MONO, 12, BayerFormat::Packing::None },
+		{ formats::R12, V4L2PixelFormat(V4L2_PIX_FMT_Y12) } },
 	{ { BayerFormat::MONO, 16, BayerFormat::Packing::None },
 		{ formats::R16, V4L2PixelFormat(V4L2_PIX_FMT_Y16) } },
 };