linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jacopo Mondi <jacopo@jmondi.org>
To: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Cc: dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org,
	linux-renesas-soc@vger.kernel.org,
	Maxime Ripard <maxime.ripard@bootlin.com>
Subject: Re: [PATCH 3/9] v4l: Add definitions for missing 16-bit RGB555 formats
Date: Thu, 4 Apr 2019 17:57:39 +0200	[thread overview]
Message-ID: <20190404155739.byhj4hqid2o6aqb4@uno.localdomain> (raw)
In-Reply-To: <20190328070723.26553-4-laurent.pinchart+renesas@ideasonboard.com>

[-- Attachment #1: Type: text/plain, Size: 5754 bytes --]

Hi Laurent

On Thu, Mar 28, 2019 at 09:07:17AM +0200, Laurent Pinchart wrote:
> The V4L2 API is missing the 16-bit RGB555 formats for the RGBA, RGBX,
> ABGR, XBGR, BGRA and BGRX component orders. Add them, using the same
> 4CCs as DRM.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> ---
>  .../media/uapi/v4l/pixfmt-packed-rgb.rst      | 138 ++++++++++++++++++
>  include/uapi/linux/videodev2.h                |   6 +
>  2 files changed, 144 insertions(+)
>
> diff --git a/Documentation/media/uapi/v4l/pixfmt-packed-rgb.rst b/Documentation/media/uapi/v4l/pixfmt-packed-rgb.rst
> index b475cbba492f..9a9c1993b0fd 100644
> --- a/Documentation/media/uapi/v4l/pixfmt-packed-rgb.rst
> +++ b/Documentation/media/uapi/v4l/pixfmt-packed-rgb.rst
> @@ -323,6 +323,144 @@ next to each other in memory.
>        - g\ :sub:`4`
>        - g\ :sub:`3`
>        -
> +    * .. _V4L2-PIX-FMT-RGBA555:
> +
> +      - ``V4L2_PIX_FMT_RGBA555``
> +      - 'RA15'
> +
> +      - g\ :sub:`1`
> +      - g\ :sub:`0`
> +      - b\ :sub:`4`
> +      - b\ :sub:`3`
> +      - b\ :sub:`2`
> +      - b\ :sub:`1`
> +      - b\ :sub:`0`
> +      - a
> +
> +      - r\ :sub:`4`
> +      - r\ :sub:`3`
> +      - r\ :sub:`2`
> +      - r\ :sub:`1`
> +      - r\ :sub:`0`
> +      - g\ :sub:`4`
> +      - g\ :sub:`3`
> +      - g\ :sub:`2`
> +      -
> +    * .. _V4L2-PIX-FMT-RGBX555:
> +
> +      - ``V4L2_PIX_FMT_RGBX555``
> +      - 'RX15'
> +
> +      - g\ :sub:`1`
> +      - g\ :sub:`0`
> +      - b\ :sub:`4`
> +      - b\ :sub:`3`
> +      - b\ :sub:`2`
> +      - b\ :sub:`1`
> +      - b\ :sub:`0`
> +      -
> +
> +      - r\ :sub:`4`
> +      - r\ :sub:`3`
> +      - r\ :sub:`2`
> +      - r\ :sub:`1`
> +      - r\ :sub:`0`
> +      - g\ :sub:`4`
> +      - g\ :sub:`3`
> +      - g\ :sub:`2`
> +      -
> +    * .. _V4L2-PIX-FMT-ABGR555:
> +
> +      - ``V4L2_PIX_FMT_ABGR555``
> +      - 'AB15'
> +
> +      - g\ :sub:`2`
> +      - g\ :sub:`1`
> +      - g\ :sub:`0`
> +      - r\ :sub:`4`
> +      - r\ :sub:`3`
> +      - r\ :sub:`2`
> +      - r\ :sub:`1`
> +      - r\ :sub:`0`
> +
> +      - a
> +      - b\ :sub:`4`
> +      - b\ :sub:`3`
> +      - b\ :sub:`2`
> +      - b\ :sub:`1`
> +      - b\ :sub:`0`
> +      - g\ :sub:`4`
> +      - g\ :sub:`3`
> +      -
> +    * .. _V4L2-PIX-FMT-XBGR555:
> +
> +      - ``V4L2_PIX_FMT_XBGR555``
> +      - 'XB15'
> +
> +      - g\ :sub:`2`
> +      - g\ :sub:`1`
> +      - g\ :sub:`0`
> +      - r\ :sub:`4`
> +      - r\ :sub:`3`
> +      - r\ :sub:`2`
> +      - r\ :sub:`1`
> +      - r\ :sub:`0`
> +
> +      -
> +      - b\ :sub:`4`
> +      - b\ :sub:`3`
> +      - b\ :sub:`2`
> +      - b\ :sub:`1`
> +      - b\ :sub:`0`
> +      - g\ :sub:`4`
> +      - g\ :sub:`3`
> +      -
> +    * .. _V4L2-PIX-FMT-BGRA555:
> +
> +      - ``V4L2_PIX_FMT_BGRA555``
> +      - 'BA15'
> +
> +      - g\ :sub:`2`
> +      - g\ :sub:`1`
> +      - g\ :sub:`0`
> +      - r\ :sub:`4`
> +      - r\ :sub:`3`
> +      - r\ :sub:`2`
> +      - r\ :sub:`1`
> +      - r\ :sub:`0`
> +      - a
> +
> +      - b\ :sub:`4`
> +      - b\ :sub:`3`
> +      - b\ :sub:`2`
> +      - b\ :sub:`1`
> +      - b\ :sub:`0`
> +      - g\ :sub:`4`
> +      - g\ :sub:`3`
> +      -
> +    * .. _V4L2-PIX-FMT-BGRX555:
> +
> +      - ``V4L2_PIX_FMT_BGRX555``
> +      - 'BX15'
> +
> +      - g\ :sub:`2`
> +      - g\ :sub:`1`
> +      - g\ :sub:`0`
> +      - r\ :sub:`4`
> +      - r\ :sub:`3`
> +      - r\ :sub:`2`
> +      - r\ :sub:`1`
> +      - r\ :sub:`0`
> +      -
> +
> +      - b\ :sub:`4`
> +      - b\ :sub:`3`
> +      - b\ :sub:`2`
> +      - b\ :sub:`1`
> +      - b\ :sub:`0`
> +      - g\ :sub:`4`
> +      - g\ :sub:`3`
> +      -

I see the last 4 formats are identical in their components
disposition. Is this intended?

                   B1                          B0
          b7                   b0   b7                  b0
ABGR555 | g2 g1 g0 b4 b3 b2 b1 b0 | a r4 r3 r2 r1 r0 g4 g3 |
XBGR555 | g2 g1 g0 b4 b3 b2 b1 b0 | x r4 r3 r2 r1 r0 g4 g3 |
BGRA555 | g2 g1 g0 b4 b3 b2 b1 b0 | a r4 r3 r2 r1 r0 g4 g3 |
BGRX555 | g2 g1 g0 b4 b3 b2 b1 b0 | x r4 r3 r2 r1 r0 g4 g3 |

If there is any correlation with the naming scheme (but I think
there's not, at least not a strict one) 'a' and 'x' of BGR* formats
should be in the most significant bit of Byte 1.

Thanks
  j

>      * .. _V4L2-PIX-FMT-RGB565:
>
>        - ``V4L2_PIX_FMT_RGB565``
> diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h
> index df9fa78a6ab7..fb6f01a7c91c 100644
> --- a/include/uapi/linux/videodev2.h
> +++ b/include/uapi/linux/videodev2.h
> @@ -523,6 +523,12 @@ struct v4l2_pix_format {
>  #define V4L2_PIX_FMT_RGB555  v4l2_fourcc('R', 'G', 'B', 'O') /* 16  RGB-5-5-5     */
>  #define V4L2_PIX_FMT_ARGB555 v4l2_fourcc('A', 'R', '1', '5') /* 16  ARGB-1-5-5-5  */
>  #define V4L2_PIX_FMT_XRGB555 v4l2_fourcc('X', 'R', '1', '5') /* 16  XRGB-1-5-5-5  */
> +#define V4L2_PIX_FMT_RGBA555 v4l2_fourcc('R', 'A', '1', '5') /* 16  RGBA-5-5-5-1  */
> +#define V4L2_PIX_FMT_RGBX555 v4l2_fourcc('R', 'X', '1', '5') /* 16  RGBX-5-5-5-1  */
> +#define V4L2_PIX_FMT_ABGR555 v4l2_fourcc('A', 'B', '1', '5') /* 16  ABGR-1-5-5-5  */
> +#define V4L2_PIX_FMT_XBGR555 v4l2_fourcc('X', 'B', '1', '5') /* 16  XBGR-1-5-5-5  */
> +#define V4L2_PIX_FMT_BGRA555 v4l2_fourcc('B', 'A', '1', '5') /* 16  BGRA-5-5-5-1  */
> +#define V4L2_PIX_FMT_BGRX555 v4l2_fourcc('B', 'X', '1', '5') /* 16  BGRX-5-5-5-1  */
>  #define V4L2_PIX_FMT_RGB565  v4l2_fourcc('R', 'G', 'B', 'P') /* 16  RGB-5-6-5     */
>  #define V4L2_PIX_FMT_RGB555X v4l2_fourcc('R', 'G', 'B', 'Q') /* 16  RGB-5-5-5 BE  */
>  #define V4L2_PIX_FMT_ARGB555X v4l2_fourcc_be('A', 'R', '1', '5') /* 16  ARGB-5-5-5 BE */
> --
> Regards,
>
> Laurent Pinchart
>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2019-04-04 15:56 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-28  7:07 [PATCH 0/9] R-Car DU: Add missing RGB pixel formats Laurent Pinchart
2019-03-28  7:07 ` [PATCH 1/9] v4l: Add definitions for missing 32-bit RGB formats Laurent Pinchart
2019-03-28 13:15   ` Jacopo Mondi
2019-04-02 12:12     ` Laurent Pinchart
2019-04-04 16:02       ` Jacopo Mondi
2019-03-28  7:07 ` [PATCH 2/9] v4l: Add definitions for missing 16-bit RGB4444 formats Laurent Pinchart
2019-04-04 16:00   ` Jacopo Mondi
2019-04-18  5:57     ` Laurent Pinchart
2019-07-09 12:56   ` Hans Verkuil
2019-03-28  7:07 ` [PATCH 3/9] v4l: Add definitions for missing 16-bit RGB555 formats Laurent Pinchart
2019-04-04 15:57   ` Jacopo Mondi [this message]
2019-04-18  6:25     ` Laurent Pinchart
2019-04-18  6:27   ` [PATCH v1.1 " Laurent Pinchart
2019-04-23 11:53     ` Jacopo Mondi
2019-03-28  7:07 ` [PATCH 4/9] media: vsp1: Add support for missing 32-bit RGB formats Laurent Pinchart
2019-04-04 17:39   ` Jacopo Mondi
2019-04-18  6:06     ` Laurent Pinchart
2019-04-23 13:21       ` Jacopo Mondi
2019-04-23 14:10         ` Laurent Pinchart
2019-03-28  7:07 ` [PATCH 5/9] media: vsp1: Add support for missing 16-bit RGB444 formats Laurent Pinchart
2019-04-23 13:38   ` Jacopo Mondi
2019-03-28  7:07 ` [PATCH 6/9] media: vsp1: Add support for missing 16-bit RGB555 formats Laurent Pinchart
2019-04-23 13:55   ` Jacopo Mondi
2019-04-23 14:46     ` Laurent Pinchart
2019-04-23 16:56       ` Jacopo Mondi
2019-04-23 19:29         ` Laurent Pinchart
2019-03-28  7:07 ` [PATCH 7/9] drm: rcar-du: Add support for missing 32-bit RGB formats Laurent Pinchart
2019-04-23 14:05   ` Jacopo Mondi
2019-03-28  7:07 ` [PATCH 8/9] drm: rcar-du: Add support for missing 16-bit RGB4444 formats Laurent Pinchart
2019-04-23 14:06   ` Jacopo Mondi
2019-03-28  7:07 ` [PATCH 9/9] drm: rcar-du: Add support for missing 16-bit RGB1555 formats Laurent Pinchart
2019-04-23 14:09   ` Jacopo Mondi
2019-04-20 13:09 ` [PATCH 0/9] R-Car DU: Add missing RGB pixel formats 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=20190404155739.byhj4hqid2o6aqb4@uno.localdomain \
    --to=jacopo@jmondi.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=laurent.pinchart+renesas@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=maxime.ripard@bootlin.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).