Hi Laurent, On Thu, Jun 08, 2023 at 10:54:43AM +0200, Hans Verkuil wrote: > On 05/05/2023 23:52, Sakari Ailus wrote: > > Generic 8-bit metadata formats define the in-memory data layout but not > > the format of the data itself. The reasoning for having such formats is to > > allow CSI-2 receiver drivers to receive and DMA drivers to write the data > > to memory without knowing a large number of device specific formats. > > > > These formats may be used only in conjunction of a Media controller > > pipeline where the internal pad of the source sub-device defines the > > specific format of the data (using an mbus code). > > > > Signed-off-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx> > > --- > > .../userspace-api/media/v4l/meta-formats.rst | 1 + > > .../media/v4l/metafmt-generic.rst | 317 ++++++++++++++++++ > > drivers/media/v4l2-core/v4l2-ioctl.c | 8 + > > include/uapi/linux/videodev2.h | 9 + > > 4 files changed, 335 insertions(+) > > create mode 100644 Documentation/userspace-api/media/v4l/metafmt-generic.rst > > > > diff --git a/Documentation/userspace-api/media/v4l/meta-formats.rst b/Documentation/userspace-api/media/v4l/meta-formats.rst > > index 0bb61fc5bc00..919f595576b9 100644 > > --- a/Documentation/userspace-api/media/v4l/meta-formats.rst > > +++ b/Documentation/userspace-api/media/v4l/meta-formats.rst > > @@ -19,3 +19,4 @@ These formats are used for the :ref:`metadata` interface only. > > metafmt-vsp1-hgo > > metafmt-vsp1-hgt > > metafmt-vivid > > + metafmt-generic > > diff --git a/Documentation/userspace-api/media/v4l/metafmt-generic.rst b/Documentation/userspace-api/media/v4l/metafmt-generic.rst > > new file mode 100644 > > index 000000000000..09d3fabb1e94 > > --- /dev/null > > +++ b/Documentation/userspace-api/media/v4l/metafmt-generic.rst > > @@ -0,0 +1,317 @@ > > +.. SPDX-License-Identifier: GPL-2.0 OR GFDL-1.1-no-invariants-or-later > > + > > +************************************************************************************************************************************************************************************************************************************************************************************************************************** > > +V4L2_META_FMT_GENERIC_8 ('MET8'), V4L2_META_FMT_GENERIC_CSI2_10 ('MC1A'), V4L2_META_FMT_GENERIC_CSI2_12 ('MC1C'), V4L2_META_FMT_GENERIC_CSI2_14 ('MC1E'), V4L2_META_FMT_GENERIC_CSI2_16 ('MC1G'), V4L2_META_FMT_GENERIC_CSI2_20 ('MC1K'), V4L2_META_FMT_GENERIC_CSI2_24 ('MC1O'), V4L2_META_FMT_GENERIC_CSI2_2_24 ('MC2O') > > +************************************************************************************************************************************************************************************************************************************************************************************************************************** > > + > > + > > +Generic line-based metadata formats > > + > > + > > +Description > > +=========== > > + > > +These generic line-based metadata formats define the memory layout of the data > > +without defining the format or meaning of the metadata itself. These formats may > > +only be used with a Media controller pipeline where the more specific format is > > +defined in an :ref:`internal source pad <MEDIA-PAD-FL-INTERNAL-SOURCE>` of the > > +source sub-device. See also :ref:`source routes <v4l2-subdev-source-routes>`. > > + > > +.. _v4l2-meta-fmt-generic-8: > > + > > +V4L2_META_FMT_GENERIC_8 > > +----------------------- > > + > > +The V4L2_META_FMT_GENERIC_8 format is a plain 8-bit metadata format whereas the > > +rest of the formats have CSI-2 packing that are typically used on camera sensors > > +in conjunction with pixel data of the same bit depth. > > You keep referring to CSI-2 packing without ever defining it. > > I'm not sure you should include CSI2 in the name either. It is OK to say something > here like: "The way the data is stored follows the CSI-2 specification." > > But it is not limited to CSI-2 and can be used with other buses as well. That's true, certainly, but where this packing is most commonly used is CSI-2 (or derives from CSI-2). > > > + > > +This format is also used on CSI-2 on both 8 bits per sample as well as on > > +16 bits per sample when two bytes of metadata are packed into one sample. > > Little or big endian? Little endian. I'll address these for v2. -- Kind regards, Sakari Ailus