From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: linux-media@vger.kernel.org,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Dylan Yip <dylany@xilinx.com>, Vishal Sagar <vsagar@xilinx.com>,
Nicolas Dufresne <nicolas@ndufresne.ca>
Subject: Re: [PATCH v2 15/19] media: v4l2: Add 10-, 12- and 16-bpc BGR formats
Date: Mon, 16 Nov 2020 20:10:03 +0200 [thread overview]
Message-ID: <20201116181003.GV6540@pendragon.ideasonboard.com> (raw)
In-Reply-To: <a2fd9dba-b0aa-7c27-21c4-127942548028@xs4all.nl>
Hi Hans,
On Mon, Nov 16, 2020 at 01:03:31PM +0100, Hans Verkuil wrote:
> On 02/11/2020 23:40, Laurent Pinchart wrote:
> > Add three new pixel formats that store RGB data in BGR order with 10, 12
> > and 16 bits per component. They are used by the Xilinx Video Frame
> > Buffer Read/Write IP cores.
> >
> > The nomenclature for these new formats follows the 8- and 16-bpp RGB
> > formats and the DRM format naming conventions, which differs from the
> > 24- and 32-bpp RGB formats in V4L2.
> >
> > As the number of bits per pixel grows quite large, a table with one
> > column per bit would be difficult to read. These formats are thus
> > described with one column per byte.
> >
> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > ---
> > Changes since v1:
> >
> > - Interleave component names and number of bits
> > ---
> > .../userspace-api/media/v4l/pixfmt-rgb.rst | 69 +++++++++++++++++++
> > include/uapi/linux/videodev2.h | 5 ++
> > 2 files changed, 74 insertions(+)
> >
> > diff --git a/Documentation/userspace-api/media/v4l/pixfmt-rgb.rst b/Documentation/userspace-api/media/v4l/pixfmt-rgb.rst
> > index 405d6f032078..846d307624fc 100644
> > --- a/Documentation/userspace-api/media/v4l/pixfmt-rgb.rst
> > +++ b/Documentation/userspace-api/media/v4l/pixfmt-rgb.rst
> > @@ -1079,6 +1079,75 @@ order of components as seen in a 24- or 32-bit little endian word.
> > \endgroup
> >
> >
> > +More Than 8 Bits Per Component
> > +==============================
> > +
> > +These formats store an RGB triplet in four bytes or more. Similarly to the 8-
> > +and 16-bpp formats, they are named based on the order of the RGB components as
> > +seen in a word, which is then stored in memory in little endian byte order, and
> > +on the number of bits for each component. The component names and the
> > +corresponding number of bits are interleaved for clarity.
> > +
> > +.. raw:: latex
> > +
> > + \begingroup
> > + \tiny
> > + \setlength{\tabcolsep}{2pt}
> > +
> > +.. tabularcolumns:: |p{2.8cm}|p{2.0cm}|p{2.0cm}|p{2.0cm}|p{2.0cm}|p{2.0cm}|p{2.0cm}|p{2.0cm}|
> > +
> > +
> > +.. flat-table:: RGB Formats With More Than 8 Bits Per Component
> > + :stub-columns: 0
> > +
> > + * - Identifier
> > + - Code
> > + - Byte 0 in memory
> > + - Byte 1
> > + - Byte 2
> > + - Byte 3
> > + - Byte 4
> > + - Byte 5
> > + * .. _V4L2-PIX-FMT-X2B10G10R10:
> > +
> > + - ``V4L2_PIX_FMT_X2B10G10R10``
> > + - 'XB30'
> > +
> > + - R\ :sub:`7-0`
> > + - G\ :sub:`5-0` R\ :sub:`9-8`
> > + - B\ :sub:`3-0` G\ :sub:`9-6`
> > + - `-`\ :sub:`1-0` B\ :sub:`9-4`
>
> Hmm, this is hard to read and understand.
>
> The problem here is the use of '-' to indicate padding (unused) bits.
>
> I was wondering whether it wouldn't be clearer to replace '-' by 'x' (for
> an unused bit) or 'X' (for an unused byte) throughout these docs.
>
> So this then becomes: X\ :sub:`1-0`.
>
> It would also nicely correspond to the use of 'X' in the format name.
OK, I'll do so.
> > +
> > + -
> > + * .. _V4L2-PIX-FMT-X4B12G12R12:
> > +
> > + - ``V4L2_PIX_FMT_X4B12G12R12``
> > + - 'XB36'
> > +
> > + - R\ :sub:`7-0`
> > + - G\ :sub:`3-0` R\ :sub:`11-8`
> > + - G\ :sub:`11-4`
> > + - B\ :sub:`7-0`
> > + - `-`\ :sub:`3-0` B\ :sub:`11-8`
> > +
> > + -
> > + * .. _V4L2-PIX-FMT-B16G16R16:
> > +
> > + - ``V4L2_PIX_FMT_B16G16R16``
> > + - 'XB48'
> > +
> > + - R\ :sub:`7-0`
> > + - R\ :sub:`15-8`
> > + - G\ :sub:`7-0`
> > + - G\ :sub:`15-8`
> > + - B\ :sub:`7-0`
> > + - B\ :sub:`15-8`
> > +
> > +.. raw:: latex
> > +
> > + \endgroup
> > +
> > +
> > Deprecated RGB Formats
> > ======================
> >
> > diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> > index 54b9fe3b7636..fab1dbb1a618 100644
> > --- a/include/uapi/linux/videodev2.h
> > +++ b/include/uapi/linux/videodev2.h
> > @@ -558,6 +558,11 @@ struct v4l2_pix_format {
> > #define V4L2_PIX_FMT_ARGB32 v4l2_fourcc('B', 'A', '2', '4') /* 32 ARGB-8-8-8-8 */
> > #define V4L2_PIX_FMT_XRGB32 v4l2_fourcc('B', 'X', '2', '4') /* 32 XRGB-8-8-8-8 */
> >
> > +/* RGB formats (more than 8 bits per component) */
> > +#define V4L2_PIX_FMT_X2B10G10R10 v4l2_fourcc('X', 'B', '3', '0') /* 32 XBGR-2-10-10-10 */
> > +#define V4L2_PIX_FMT_X4B12G12R12 v4l2_fourcc('X', 'B', '3', '6') /* 40 XBGR-4-12-12-12 */
> > +#define V4L2_PIX_FMT_B16G16R16 v4l2_fourcc('X', 'B', '4', '8') /* 48 BGR-16-16-16 */
> > +
> > /* Grey formats */
> > #define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */
> > #define V4L2_PIX_FMT_Y4 v4l2_fourcc('Y', '0', '4', ' ') /* 4 Greyscale */
> >
>
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2020-11-16 18:10 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-02 22:40 [PATCH v2 00/19] media: Add new pixel formats for Xilinx v-frmbuf Laurent Pinchart
2020-11-02 22:40 ` [PATCH v2 01/19] media: videodev2.h: Remove unneeded comment about 4CC value Laurent Pinchart
2020-11-02 22:40 ` [PATCH v2 02/19] media: videodev2.h: Move HI240 format to vendor-specific section Laurent Pinchart
2020-11-02 22:40 ` [PATCH v2 03/19] media: videodev2.h: Move HM12 format to YUV semi-planar section Laurent Pinchart
2020-11-02 22:40 ` [PATCH v2 04/19] media: doc: pixfmt-rgb: Remove layout table for packed RGB formats Laurent Pinchart
2020-11-02 22:40 ` [PATCH v2 05/19] media: doc: pixfmt-rgb: Add title for deprecated formats Laurent Pinchart
2020-11-02 22:40 ` [PATCH v2 06/19] media: doc: pixfmt-rgb: Clarify naming scheme for RGB formats Laurent Pinchart
2020-11-16 11:51 ` Hans Verkuil
2020-11-16 11:58 ` Hans Verkuil
2020-11-16 17:29 ` Laurent Pinchart
2020-11-16 17:26 ` Laurent Pinchart
2020-11-16 17:35 ` Laurent Pinchart
2020-11-16 18:20 ` Hans Verkuil
2020-11-02 22:40 ` [PATCH v2 07/19] media: doc: pixfmt-yuv: Document subsampling in more details Laurent Pinchart
2020-11-02 22:40 ` [PATCH v2 08/19] media: doc: pixfmt-yuv: Move all packed YUV formats to common file Laurent Pinchart
2020-11-02 22:40 ` [PATCH v2 09/19] media: doc: pixfmt-packed-yuv: Fill padding bits with '-' Laurent Pinchart
2020-11-02 22:40 ` [PATCH v2 10/19] media: doc: pixfmt-packed-yuv: Express 4:4:4 formats in a more compact way Laurent Pinchart
2020-11-02 22:40 ` [PATCH v2 11/19] media: doc: pixfmt-packed-yuv: Clarify naming scheme for 4:4:4 formats Laurent Pinchart
2020-11-02 22:40 ` [PATCH v2 12/19] media: doc: pixfmt-yuv: Move all luma-only YUV formats to common file Laurent Pinchart
2020-11-03 12:05 ` Sakari Ailus
2020-11-02 22:40 ` [PATCH v2 13/19] media: doc: pixfmt-yuv: Move all semi-planar " Laurent Pinchart
2020-11-02 22:40 ` [PATCH v2 14/19] media: doc: pixfmt-yuv: Move all planar " Laurent Pinchart
2020-11-02 22:40 ` [PATCH v2 15/19] media: v4l2: Add 10-, 12- and 16-bpc BGR formats Laurent Pinchart
2020-11-16 12:03 ` Hans Verkuil
2020-11-16 18:10 ` Laurent Pinchart [this message]
2020-11-02 22:40 ` [PATCH v2 16/19] media: v4l2: Add a few missing packed YUV 4:4:4 formats Laurent Pinchart
2020-11-16 12:25 ` Hans Verkuil
2020-11-02 22:41 ` [PATCH v2 17/19] media: v4l2: Add 10-, 12- and 16-bpc 4:4:4 packed VUY formats Laurent Pinchart
2020-11-02 22:41 ` [PATCH v2 18/19] media: v4l2: Add 10- and 12-bpc luma-only formats with linear packing Laurent Pinchart
2020-11-02 22:41 ` [PATCH v2 19/19] media: v4l2: Add 10-, 12- and 16-bpc 4:2:0 and 4:2:2 semi-planar YUV formats Laurent Pinchart
2020-11-16 12:10 ` Hans Verkuil
2020-11-16 12:17 ` Hans Verkuil
2020-11-16 18:41 ` Laurent Pinchart
2020-11-03 8:57 ` [PATCH v2 00/19] media: Add new pixel formats for Xilinx v-frmbuf Sakari Ailus
2020-11-03 10:25 ` Laurent Pinchart
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20201116181003.GV6540@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=dylany@xilinx.com \
--cc=hverkuil-cisco@xs4all.nl \
--cc=linux-media@vger.kernel.org \
--cc=nicolas@ndufresne.ca \
--cc=sakari.ailus@linux.intel.com \
--cc=vsagar@xilinx.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).