diff mbox series

[2/6] media: v4l: Add definition for bayered IR formats

Message ID 20210427120701.21809-3-m.felsch@pengutronix.de
State New
Headers show
Series None | expand

Commit Message

Marco Felsch April 27, 2021, 12:06 p.m. UTC
Add special 8/12bit bayer media bus format for the OnSemi AR0237IR
camera sensor [1]. OnSemi calls this format RGB-IR, the pixel array
with the interleaved IR pixels looks like:

        |  G |  R |  G |  B | ...
        +----+----+----+----+---
        | IR |  G | IR |  G | ...
        +----+----+----+----+---
        |  G |  B |  G |  R | ...
        +----+----+----+----+---
        | IR |  G | IR |  G | ...
        +----+----+----+----+---
        | .. | .. | .. | .. | ..

[1] https://www.framos.com/media/pdf/96/ac/8f/AR0237CS-D-PDF-framos.pdf

Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 include/uapi/linux/videodev2.h | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Laurent Pinchart April 29, 2021, 1:45 a.m. UTC | #1
Hi Marco,

Thank you for the patch.

On Tue, Apr 27, 2021 at 02:06:57PM +0200, Marco Felsch wrote:
> Add special 8/12bit bayer media bus format for the OnSemi AR0237IR

> camera sensor [1]. OnSemi calls this format RGB-IR, the pixel array

> with the interleaved IR pixels looks like:

> 

>         |  G |  R |  G |  B | ...

>         +----+----+----+----+---

>         | IR |  G | IR |  G | ...

>         +----+----+----+----+---

>         |  G |  B |  G |  R | ...

>         +----+----+----+----+---

>         | IR |  G | IR |  G | ...

>         +----+----+----+----+---

>         | .. | .. | .. | .. | ..

> 

> [1] https://www.framos.com/media/pdf/96/ac/8f/AR0237CS-D-PDF-framos.pdf

> 

> Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>

> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

> ---

>  include/uapi/linux/videodev2.h | 4 ++++


The documentation is missing.

>  1 file changed, 4 insertions(+)

> 

> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h

> index 311a01cc5775..45ffd3867394 100644

> --- a/include/uapi/linux/videodev2.h

> +++ b/include/uapi/linux/videodev2.h

> @@ -632,6 +632,8 @@ struct v4l2_pix_format {

>  #define V4L2_PIX_FMT_SGBRG8  v4l2_fourcc('G', 'B', 'R', 'G') /*  8  GBGB.. RGRG.. */

>  #define V4L2_PIX_FMT_SGRBG8  v4l2_fourcc('G', 'R', 'B', 'G') /*  8  GRGR.. BGBG.. */

>  #define V4L2_PIX_FMT_SRGGB8  v4l2_fourcc('R', 'G', 'G', 'B') /*  8  RGRG.. GBGB.. */

> +	/* 8bit infrared interleaved bayer format */

> +#define V4L2_PIX_FMT_SGRGB_IGIG_GBGR_IGIG8 v4l2_fourcc('I', 'R', '0', '8') /* 8 GRGB.. IGIG.. GBGR.. IGIG.. */

>  #define V4L2_PIX_FMT_SBGGR10 v4l2_fourcc('B', 'G', '1', '0') /* 10  BGBG.. GRGR.. */

>  #define V4L2_PIX_FMT_SGBRG10 v4l2_fourcc('G', 'B', '1', '0') /* 10  GBGB.. RGRG.. */

>  #define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0') /* 10  GRGR.. BGBG.. */

> @@ -673,6 +675,8 @@ struct v4l2_pix_format {

>  #define V4L2_PIX_FMT_SGBRG16 v4l2_fourcc('G', 'B', '1', '6') /* 16  GBGB.. RGRG.. */

>  #define V4L2_PIX_FMT_SGRBG16 v4l2_fourcc('G', 'R', '1', '6') /* 16  GRGR.. BGBG.. */

>  #define V4L2_PIX_FMT_SRGGB16 v4l2_fourcc('R', 'G', '1', '6') /* 16  RGRG.. GBGB.. */

> +	/* 16bit infrared interleaved bayer format */

> +#define V4L2_PIX_FMT_SGRGB_IGIG_GBGR_IGIG16 v4l2_fourcc('I', 'R', '1', '6') /* 16 GRGB.. IGIG.. GBGR.. IGIG.. */

>  

>  /* HSV formats */

>  #define V4L2_PIX_FMT_HSV24 v4l2_fourcc('H', 'S', 'V', '3')


-- 
Regards,

Laurent Pinchart
Marco Felsch April 29, 2021, 7:07 a.m. UTC | #2
Hi Laurent,

On 21-04-29 04:45, Laurent Pinchart wrote:
> Hi Marco,

> 

> Thank you for the patch.

> 

> On Tue, Apr 27, 2021 at 02:06:57PM +0200, Marco Felsch wrote:

> > Add special 8/12bit bayer media bus format for the OnSemi AR0237IR

> > camera sensor [1]. OnSemi calls this format RGB-IR, the pixel array

> > with the interleaved IR pixels looks like:

> > 

> >         |  G |  R |  G |  B | ...

> >         +----+----+----+----+---

> >         | IR |  G | IR |  G | ...

> >         +----+----+----+----+---

> >         |  G |  B |  G |  R | ...

> >         +----+----+----+----+---

> >         | IR |  G | IR |  G | ...

> >         +----+----+----+----+---

> >         | .. | .. | .. | .. | ..

> > 

> > [1] https://www.framos.com/media/pdf/96/ac/8f/AR0237CS-D-PDF-framos.pdf

> > 

> > Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>

> > Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>

> > ---

> >  include/uapi/linux/videodev2.h | 4 ++++

> 

> The documentation is missing.


I've send a seperate patch for this. Those two could be squashed.

Regards,
  Marco
diff mbox series

Patch

diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
index 311a01cc5775..45ffd3867394 100644
--- a/include/uapi/linux/videodev2.h
+++ b/include/uapi/linux/videodev2.h
@@ -632,6 +632,8 @@  struct v4l2_pix_format {
 #define V4L2_PIX_FMT_SGBRG8  v4l2_fourcc('G', 'B', 'R', 'G') /*  8  GBGB.. RGRG.. */
 #define V4L2_PIX_FMT_SGRBG8  v4l2_fourcc('G', 'R', 'B', 'G') /*  8  GRGR.. BGBG.. */
 #define V4L2_PIX_FMT_SRGGB8  v4l2_fourcc('R', 'G', 'G', 'B') /*  8  RGRG.. GBGB.. */
+	/* 8bit infrared interleaved bayer format */
+#define V4L2_PIX_FMT_SGRGB_IGIG_GBGR_IGIG8 v4l2_fourcc('I', 'R', '0', '8') /* 8 GRGB.. IGIG.. GBGR.. IGIG.. */
 #define V4L2_PIX_FMT_SBGGR10 v4l2_fourcc('B', 'G', '1', '0') /* 10  BGBG.. GRGR.. */
 #define V4L2_PIX_FMT_SGBRG10 v4l2_fourcc('G', 'B', '1', '0') /* 10  GBGB.. RGRG.. */
 #define V4L2_PIX_FMT_SGRBG10 v4l2_fourcc('B', 'A', '1', '0') /* 10  GRGR.. BGBG.. */
@@ -673,6 +675,8 @@  struct v4l2_pix_format {
 #define V4L2_PIX_FMT_SGBRG16 v4l2_fourcc('G', 'B', '1', '6') /* 16  GBGB.. RGRG.. */
 #define V4L2_PIX_FMT_SGRBG16 v4l2_fourcc('G', 'R', '1', '6') /* 16  GRGR.. BGBG.. */
 #define V4L2_PIX_FMT_SRGGB16 v4l2_fourcc('R', 'G', '1', '6') /* 16  RGRG.. GBGB.. */
+	/* 16bit infrared interleaved bayer format */
+#define V4L2_PIX_FMT_SGRGB_IGIG_GBGR_IGIG16 v4l2_fourcc('I', 'R', '1', '6') /* 16 GRGB.. IGIG.. GBGR.. IGIG.. */
 
 /* HSV formats */
 #define V4L2_PIX_FMT_HSV24 v4l2_fourcc('H', 'S', 'V', '3')