diff mbox series

[v6,1/7] media: uapi: pixfmt-luma: Document MIPI CSI-2 packing

Message ID 20240502110503.38412-2-jacopo.mondi@ideasonboard.com (mailing list archive)
State New, archived
Headers show
Series media: raspberrypi: Add support for PiSP Back End | expand

Commit Message

Jacopo Mondi May 2, 2024, 11:04 a.m. UTC
The Y10P, Y12P and Y14P format variants are packed according to
the RAW10, RAW12 and RAW14 formats as defined by the MIPI CSI-2
specification. Document it.

Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
---
 Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Sakari Ailus May 23, 2024, 10:46 a.m. UTC | #1
Hi Jacopo,

On Thu, May 02, 2024 at 01:04:56PM +0200, Jacopo Mondi wrote:
> The Y10P, Y12P and Y14P format variants are packed according to
> the RAW10, RAW12 and RAW14 formats as defined by the MIPI CSI-2
> specification. Document it.
> 
> Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
> ---
>  Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst b/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
> index b3c5779521d8..f02e6cf3516a 100644
> --- a/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
> +++ b/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
> @@ -209,3 +209,7 @@ are often referred to as greyscale formats.
>      For Y012 and Y12 formats, Y012 places its data in the 12 high bits, with
>      padding zeros in the 4 low bits, in contrast to the Y12 format, which has
>      its padding located in the most significant bits of the 16 bit word.
> +
> +    The 'P' variations of the Y10, Y12 and Y14 formats are packed according to
> +    the RAW10, RAW12 and RAW14 packing scheme as defined by the MIPI CSI-2
> +    specification.

The CSI-2 specification isn't publicly available. I think you'll need to
add similar examples of the packing the packed raw formats have.
Sakari Ailus May 23, 2024, 10:57 a.m. UTC | #2
On Thu, May 23, 2024 at 01:57:22PM +0300, Laurent Pinchart wrote:
> On Thu, May 23, 2024 at 10:46:59AM +0000, Sakari Ailus wrote:
> > Hi Jacopo,
> > 
> > On Thu, May 02, 2024 at 01:04:56PM +0200, Jacopo Mondi wrote:
> > > The Y10P, Y12P and Y14P format variants are packed according to
> > > the RAW10, RAW12 and RAW14 formats as defined by the MIPI CSI-2
> > > specification. Document it.
> > > 
> > > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
> > > ---
> > >  Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst | 4 ++++
> > >  1 file changed, 4 insertions(+)
> > > 
> > > diff --git a/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst b/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
> > > index b3c5779521d8..f02e6cf3516a 100644
> > > --- a/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
> > > +++ b/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
> > > @@ -209,3 +209,7 @@ are often referred to as greyscale formats.
> > >      For Y012 and Y12 formats, Y012 places its data in the 12 high bits, with
> > >      padding zeros in the 4 low bits, in contrast to the Y12 format, which has
> > >      its padding located in the most significant bits of the 16 bit word.
> > > +
> > > +    The 'P' variations of the Y10, Y12 and Y14 formats are packed according to
> > > +    the RAW10, RAW12 and RAW14 packing scheme as defined by the MIPI CSI-2
> > > +    specification.
> > 
> > The CSI-2 specification isn't publicly available. I think you'll need to
> > add similar examples of the packing the packed raw formats have.
> 
> Would referencing the CSI-2-packed bayer formats be acceptable ?
> Otherwise we'll essentially duplicate documentation.

I'm fine with that but the packing should be then documented independently
of formats. I'd prefer referring to component numbers (1 to 4) so this
could be re-used with Bayer formats.

The documentation from the Bayer formats should be usable for this almost
as-is.
Laurent Pinchart May 23, 2024, 10:57 a.m. UTC | #3
On Thu, May 23, 2024 at 10:46:59AM +0000, Sakari Ailus wrote:
> Hi Jacopo,
> 
> On Thu, May 02, 2024 at 01:04:56PM +0200, Jacopo Mondi wrote:
> > The Y10P, Y12P and Y14P format variants are packed according to
> > the RAW10, RAW12 and RAW14 formats as defined by the MIPI CSI-2
> > specification. Document it.
> > 
> > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
> > ---
> >  Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst | 4 ++++
> >  1 file changed, 4 insertions(+)
> > 
> > diff --git a/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst b/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
> > index b3c5779521d8..f02e6cf3516a 100644
> > --- a/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
> > +++ b/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
> > @@ -209,3 +209,7 @@ are often referred to as greyscale formats.
> >      For Y012 and Y12 formats, Y012 places its data in the 12 high bits, with
> >      padding zeros in the 4 low bits, in contrast to the Y12 format, which has
> >      its padding located in the most significant bits of the 16 bit word.
> > +
> > +    The 'P' variations of the Y10, Y12 and Y14 formats are packed according to
> > +    the RAW10, RAW12 and RAW14 packing scheme as defined by the MIPI CSI-2
> > +    specification.
> 
> The CSI-2 specification isn't publicly available. I think you'll need to
> add similar examples of the packing the packed raw formats have.

Would referencing the CSI-2-packed bayer formats be acceptable ?
Otherwise we'll essentially duplicate documentation.
Laurent Pinchart May 23, 2024, 11:04 a.m. UTC | #4
On Thu, May 23, 2024 at 10:57:09AM +0000, Sakari Ailus wrote:
> On Thu, May 23, 2024 at 01:57:22PM +0300, Laurent Pinchart wrote:
> > On Thu, May 23, 2024 at 10:46:59AM +0000, Sakari Ailus wrote:
> > > Hi Jacopo,
> > > 
> > > On Thu, May 02, 2024 at 01:04:56PM +0200, Jacopo Mondi wrote:
> > > > The Y10P, Y12P and Y14P format variants are packed according to
> > > > the RAW10, RAW12 and RAW14 formats as defined by the MIPI CSI-2
> > > > specification. Document it.
> > > > 
> > > > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> > > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > > Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
> > > > ---
> > > >  Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst | 4 ++++
> > > >  1 file changed, 4 insertions(+)
> > > > 
> > > > diff --git a/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst b/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
> > > > index b3c5779521d8..f02e6cf3516a 100644
> > > > --- a/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
> > > > +++ b/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
> > > > @@ -209,3 +209,7 @@ are often referred to as greyscale formats.
> > > >      For Y012 and Y12 formats, Y012 places its data in the 12 high bits, with
> > > >      padding zeros in the 4 low bits, in contrast to the Y12 format, which has
> > > >      its padding located in the most significant bits of the 16 bit word.
> > > > +
> > > > +    The 'P' variations of the Y10, Y12 and Y14 formats are packed according to
> > > > +    the RAW10, RAW12 and RAW14 packing scheme as defined by the MIPI CSI-2
> > > > +    specification.
> > > 
> > > The CSI-2 specification isn't publicly available. I think you'll need to
> > > add similar examples of the packing the packed raw formats have.
> > 
> > Would referencing the CSI-2-packed bayer formats be acceptable ?
> > Otherwise we'll essentially duplicate documentation.
> 
> I'm fine with that but the packing should be then documented independently
> of formats. I'd prefer referring to component numbers (1 to 4) so this
> could be re-used with Bayer formats.
> 
> The documentation from the Bayer formats should be usable for this almost
> as-is.

Sounds good to me.
Laurent Pinchart May 23, 2024, 11:05 a.m. UTC | #5
On Thu, May 23, 2024 at 02:04:15PM +0300, Laurent Pinchart wrote:
> On Thu, May 23, 2024 at 10:57:09AM +0000, Sakari Ailus wrote:
> > On Thu, May 23, 2024 at 01:57:22PM +0300, Laurent Pinchart wrote:
> > > On Thu, May 23, 2024 at 10:46:59AM +0000, Sakari Ailus wrote:
> > > > On Thu, May 02, 2024 at 01:04:56PM +0200, Jacopo Mondi wrote:
> > > > > The Y10P, Y12P and Y14P format variants are packed according to
> > > > > the RAW10, RAW12 and RAW14 formats as defined by the MIPI CSI-2
> > > > > specification. Document it.
> > > > > 
> > > > > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> > > > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > > > Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
> > > > > ---
> > > > >  Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst | 4 ++++
> > > > >  1 file changed, 4 insertions(+)
> > > > > 
> > > > > diff --git a/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst b/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
> > > > > index b3c5779521d8..f02e6cf3516a 100644
> > > > > --- a/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
> > > > > +++ b/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
> > > > > @@ -209,3 +209,7 @@ are often referred to as greyscale formats.
> > > > >      For Y012 and Y12 formats, Y012 places its data in the 12 high bits, with
> > > > >      padding zeros in the 4 low bits, in contrast to the Y12 format, which has
> > > > >      its padding located in the most significant bits of the 16 bit word.
> > > > > +
> > > > > +    The 'P' variations of the Y10, Y12 and Y14 formats are packed according to
> > > > > +    the RAW10, RAW12 and RAW14 packing scheme as defined by the MIPI CSI-2
> > > > > +    specification.
> > > > 
> > > > The CSI-2 specification isn't publicly available. I think you'll need to
> > > > add similar examples of the packing the packed raw formats have.
> > > 
> > > Would referencing the CSI-2-packed bayer formats be acceptable ?
> > > Otherwise we'll essentially duplicate documentation.
> > 
> > I'm fine with that but the packing should be then documented independently
> > of formats. I'd prefer referring to component numbers (1 to 4) so this
> > could be re-used with Bayer formats.
> > 
> > The documentation from the Bayer formats should be usable for this almost
> > as-is.
> 
> Sounds good to me.

Oh, and obviously, the best way to address all this would be for the
MIPI Alliance to publish an open version of the CSI-2 specification,
covering at least the parts that are relevant from a software point of
view.
Jacopo Mondi May 23, 2024, 1:22 p.m. UTC | #6
Hi Sakari, Laurent

On Thu, May 23, 2024 at 10:57:09AM GMT, Sakari Ailus wrote:
> On Thu, May 23, 2024 at 01:57:22PM +0300, Laurent Pinchart wrote:
> > On Thu, May 23, 2024 at 10:46:59AM +0000, Sakari Ailus wrote:
> > > Hi Jacopo,
> > >
> > > On Thu, May 02, 2024 at 01:04:56PM +0200, Jacopo Mondi wrote:
> > > > The Y10P, Y12P and Y14P format variants are packed according to
> > > > the RAW10, RAW12 and RAW14 formats as defined by the MIPI CSI-2
> > > > specification. Document it.
> > > >
> > > > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> > > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > > Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
> > > > ---
> > > >  Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst | 4 ++++
> > > >  1 file changed, 4 insertions(+)
> > > >
> > > > diff --git a/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst b/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
> > > > index b3c5779521d8..f02e6cf3516a 100644
> > > > --- a/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
> > > > +++ b/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
> > > > @@ -209,3 +209,7 @@ are often referred to as greyscale formats.
> > > >      For Y012 and Y12 formats, Y012 places its data in the 12 high bits, with
> > > >      padding zeros in the 4 low bits, in contrast to the Y12 format, which has
> > > >      its padding located in the most significant bits of the 16 bit word.
> > > > +
> > > > +    The 'P' variations of the Y10, Y12 and Y14 formats are packed according to
> > > > +    the RAW10, RAW12 and RAW14 packing scheme as defined by the MIPI CSI-2
> > > > +    specification.
> > >
> > > The CSI-2 specification isn't publicly available. I think you'll need to
> > > add similar examples of the packing the packed raw formats have.

Don't we have the packaging examples in the tables already ? In
mainline already for 10P and introduced by:

adb1d4655e53 ("media: v4l: Add V4L2-PIX-FMT-Y14P format")
181047763040 ("media: v4l: Add V4L2-PIX-FMT-Y12P format")

in the media staging tree.

> >
> > Would referencing the CSI-2-packed bayer formats be acceptable ?
> > Otherwise we'll essentially duplicate documentation.
>
> I'm fine with that but the packing should be then documented independently
> of formats. I'd prefer referring to component numbers (1 to 4) so this
> could be re-used with Bayer formats.
>
> The documentation from the Bayer formats should be usable for this almost
> as-is.
>
> --
> Sakari Ailus
Sakari Ailus May 23, 2024, 4:28 p.m. UTC | #7
Hi Jacopo,

On Thu, May 23, 2024 at 03:22:56PM +0200, Jacopo Mondi wrote:
> Hi Sakari, Laurent
> 
> On Thu, May 23, 2024 at 10:57:09AM GMT, Sakari Ailus wrote:
> > On Thu, May 23, 2024 at 01:57:22PM +0300, Laurent Pinchart wrote:
> > > On Thu, May 23, 2024 at 10:46:59AM +0000, Sakari Ailus wrote:
> > > > Hi Jacopo,
> > > >
> > > > On Thu, May 02, 2024 at 01:04:56PM +0200, Jacopo Mondi wrote:
> > > > > The Y10P, Y12P and Y14P format variants are packed according to
> > > > > the RAW10, RAW12 and RAW14 formats as defined by the MIPI CSI-2
> > > > > specification. Document it.
> > > > >
> > > > > Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
> > > > > Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > > > > Reviewed-by: Naushir Patuck <naush@raspberrypi.com>
> > > > > ---
> > > > >  Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst | 4 ++++
> > > > >  1 file changed, 4 insertions(+)
> > > > >
> > > > > diff --git a/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst b/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
> > > > > index b3c5779521d8..f02e6cf3516a 100644
> > > > > --- a/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
> > > > > +++ b/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
> > > > > @@ -209,3 +209,7 @@ are often referred to as greyscale formats.
> > > > >      For Y012 and Y12 formats, Y012 places its data in the 12 high bits, with
> > > > >      padding zeros in the 4 low bits, in contrast to the Y12 format, which has
> > > > >      its padding located in the most significant bits of the 16 bit word.
> > > > > +
> > > > > +    The 'P' variations of the Y10, Y12 and Y14 formats are packed according to
> > > > > +    the RAW10, RAW12 and RAW14 packing scheme as defined by the MIPI CSI-2
> > > > > +    specification.
> > > >
> > > > The CSI-2 specification isn't publicly available. I think you'll need to
> > > > add similar examples of the packing the packed raw formats have.
> 
> Don't we have the packaging examples in the tables already ? In
> mainline already for 10P and introduced by:
> 
> adb1d4655e53 ("media: v4l: Add V4L2-PIX-FMT-Y14P format")
> 181047763040 ("media: v4l: Add V4L2-PIX-FMT-Y12P format")
> 
> in the media staging tree.

I missed we had these already defined and thought this was all the
documentation there was. Ok, this is fine then.

It'd be nice to merge the packing documentations but it doesn't have to be
in this set IMO.
diff mbox series

Patch

diff --git a/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst b/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
index b3c5779521d8..f02e6cf3516a 100644
--- a/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
+++ b/Documentation/userspace-api/media/v4l/pixfmt-yuv-luma.rst
@@ -209,3 +209,7 @@  are often referred to as greyscale formats.
     For Y012 and Y12 formats, Y012 places its data in the 12 high bits, with
     padding zeros in the 4 low bits, in contrast to the Y12 format, which has
     its padding located in the most significant bits of the 16 bit word.
+
+    The 'P' variations of the Y10, Y12 and Y14 formats are packed according to
+    the RAW10, RAW12 and RAW14 packing scheme as defined by the MIPI CSI-2
+    specification.