Re: [PATCH v2 1/4] media: v4l2: Add Renesas Camera Receiver Unit pixel formats

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Laurent, Dan,

On Tue, Nov 12, 2024 at 07:53:09PM +0200, Laurent Pinchart wrote:
> Hi Dan,
> 
> Thank you for the patch.
> 
> On Tue, Nov 12, 2024 at 12:46:11PM +0000, Daniel Scally wrote:
> > From: Daniel Scally <dan.scally+renesas@xxxxxxxxxxxxxxxx>
> > 
> > The Renesas Camera Receiver Unit in the RZ/V2H SoC can output RAW
> > data captured from an image sensor without conversion to an RGB/YUV
> > format. In that case the data are packed into 64-bit blocks, with a
> > variable amount of padding in the most significant bits depending on
> > the bitdepth of the data. Add new V4L2 pixel format codes for the new
> > formats, along with documentation to describe them.
> > 
> > Reviewed-by: Jacopo Mondi <jacopo.mondi@xxxxxxxxxxxxxxxx>
> > Signed-off-by: Daniel Scally <dan.scally+renesas@xxxxxxxxxxxxxxxx>
> > ---
> > Changes in v2:
> > 
> > 	- Added labels to the new formats in the documentation file
> > 	- Added 20-bit formats
> > 
> >  .../userspace-api/media/v4l/pixfmt-bayer.rst  |   1 +
> >  .../media/v4l/pixfmt-srggbnn-cru.rst          | 168 ++++++++++++++++++
> >  drivers/media/v4l2-core/v4l2-common.c         |  16 ++
> >  drivers/media/v4l2-core/v4l2-ioctl.c          |  16 ++
> >  include/uapi/linux/videodev2.h                |  21 +++
> >  5 files changed, 222 insertions(+)
> >  create mode 100644 Documentation/userspace-api/media/v4l/pixfmt-srggbnn-cru.rst
> > 
> > diff --git a/Documentation/userspace-api/media/v4l/pixfmt-bayer.rst b/Documentation/userspace-api/media/v4l/pixfmt-bayer.rst
> > index ed3eb432967d..658068364ea1 100644
> > --- a/Documentation/userspace-api/media/v4l/pixfmt-bayer.rst
> > +++ b/Documentation/userspace-api/media/v4l/pixfmt-bayer.rst
> > @@ -31,3 +31,4 @@ orders. See also `the Wikipedia article on Bayer filter
> >      pixfmt-srggb14
> >      pixfmt-srggb14p
> >      pixfmt-srggb16
> > +    pixfmt-srggbnn-cru
> > diff --git a/Documentation/userspace-api/media/v4l/pixfmt-srggbnn-cru.rst b/Documentation/userspace-api/media/v4l/pixfmt-srggbnn-cru.rst
> > new file mode 100644
> > index 000000000000..ee2a72eb05fb
> > --- /dev/null
> > +++ b/Documentation/userspace-api/media/v4l/pixfmt-srggbnn-cru.rst
> > @@ -0,0 +1,168 @@
> > +.. SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later
> > +
> > +.. _v4l2-pix-fmt-cru-sbggr10:
> > +.. _v4l2-pix-fmt-cru-sgbrg10:
> > +.. _v4l2-pix-fmt-cru-sgrbg10:
> > +.. _v4l2-pix-fmt-cru-srggb10:
> > +.. _v4l2-pix-fmt-cru-sbggr12:
> > +.. _v4l2-pix-fmt-cru-sgbrg12:
> > +.. _v4l2-pix-fmt-cru-sgrbg12:
> > +.. _v4l2-pix-fmt-cru-srggb12:
> > +.. _v4l2-pix-fmt-cru-sbggr14:
> > +.. _v4l2-pix-fmt-cru-sgbrg14:
> > +.. _v4l2-pix-fmt-cru-sgrbg14:
> > +.. _v4l2-pix-fmt-cru-srggb14:
> > +.. _v4l2-pix-fmt-cru-sbggr20:
> > +.. _v4l2-pix-fmt-cru-sgbrg20:
> > +.. _v4l2-pix-fmt-cru-sgrbg20:
> > +.. _v4l2-pix-fmt-cru-srggb20:
> > +
> > +******************************************************************************************************************************************
> > +V4L2_PIX_FMT_CRU_SBGGRnn ('CnnB'), V4L2_PIX_FMT_CRU_SGBRGnn ('CnnG'), V4L2_PIX_FMT_CRU_SGRBGnn ('Cnng'), V4L2_PIX_FMT_CRU_SRGGBnn ('CnnR')
> > +******************************************************************************************************************************************
> > +
> > +===============================================================
> > +Renesas RZ/V2H Camera Receiver Unit 64-bit packed pixel formats
> > +===============================================================
> > +
> > +| V4L2_PIX_FMT_CRU_SBGGR10 (C10B)
> > +| V4L2_PIX_FMT_CRU_SGBRG10 (C10G)
> > +| V4L2_PIX_FMT_CRU_SGRBG10 (C10g)
> > +| V4L2_PIX_FMT_CRU_SRGGB10 (C10R)
> > +| V4L2_PIX_FMT_CRU_SBGGR12 (C12B)
> > +| V4L2_PIX_FMT_CRU_SGBRG12 (C12G)
> > +| V4L2_PIX_FMT_CRU_SGRBG12 (C12g)
> > +| V4L2_PIX_FMT_CRU_SRGGB12 (C12R)
> > +| V4L2_PIX_FMT_CRU_SBGGR14 (C14B)
> > +| V4L2_PIX_FMT_CRU_SGBRG14 (C14G)
> > +| V4L2_PIX_FMT_CRU_SGRBG14 (C14g)
> > +| V4L2_PIX_FMT_CRU_SRGGB14 (C14R)
> > +| V4L2_PIX_FMT_CRU_SBGGR20 (C20B)
> > +| V4L2_PIX_FMT_CRU_SGBRG20 (C20G)
> > +| V4L2_PIX_FMT_CRU_SGRBG20 (C20g)
> > +| V4L2_PIX_FMT_CRU_SRGGB20 (C20R)
> 
> That's a long list of pixel formats. Is it time to byte the bullet and
> stop encoding the CFA pattern in the pixel formats ? Userspace can
> retrieve the information from the media bus code on the source. You can
> then slash the number of new pixel formats by a factor of 4, defining
> V4L2_PIX_FMT_CRU_RAW10, V4L2_PIX_FMT_CRU_RAW12, V4L2_PIX_FMT_CRU_RAW14
> and V4L2_PIX_FMT_CRU_RAW20. Those formats would also be applicable to
> monochrome raw data.
> 
> Sakari, any opinion ?

I'd be in favour of that approach, yes. We can introduce the corresponding
media bus codes later on, that's a separate issue but the same approach
should be used there, too.

-- 
Kind regards,

Sakari Ailus




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]

  Powered by Linux