public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Maxime Ripard <mripard@kernel.org>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
	Sakari Ailus <sakari.ailus@linux.intel.com>,
	Hans Verkuil <hverkuil@kernel.org>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	Hans Verkuil <hans.verkuil@cisco.com>,
	Dave Stevenson <dave.stevenson@raspberrypi.com>
Subject: Re: [PATCH v6 1/2] media: uapi: Clarify MBUS color component order for serial buses
Date: Thu, 5 Mar 2026 13:14:08 +0100	[thread overview]
Message-ID: <20260305121408.GA208179@killaraus.ideasonboard.com> (raw)
In-Reply-To: <20260217-csi-bgr-rgb-v6-1-064607effe42@redhat.com>

On Tue, Feb 17, 2026 at 09:38:57AM +0100, Maxime Ripard wrote:
> The subdev format documentation has a subsection describing how to use
> the media bus pixel codes for serial buses. While it describes the
> sampling part well, it doesn't really describe the current convention
> used for the components order.
> 
> Let's improve that.
> 
> Signed-off-by: Maxime Ripard <mripard@kernel.org>
> ---
>  .../userspace-api/media/v4l/subdev-formats.rst        | 19 +++++++++++--------
>  1 file changed, 11 insertions(+), 8 deletions(-)
> 
> diff --git a/Documentation/userspace-api/media/v4l/subdev-formats.rst b/Documentation/userspace-api/media/v4l/subdev-formats.rst
> index cf970750dd4c6ab32274f75453390eb8148ef3c6..6d57c325ffa506fd57dad0845c9a742fd199a6f0 100644
> --- a/Documentation/userspace-api/media/v4l/subdev-formats.rst
> +++ b/Documentation/userspace-api/media/v4l/subdev-formats.rst
> @@ -157,18 +157,21 @@ memory.
>  While there is a relationship between image formats on buses and image
>  formats in memory (a raw Bayer image won't be magically converted to
>  JPEG just by storing it to memory), there is no one-to-one
>  correspondence between them.
>  
> -The media bus pixel codes document parallel formats. Should the pixel data be
> -transported over a serial bus, the media bus pixel code that describes a
> -parallel format that transfers a sample on a single clock cycle is used. For
> -instance, both MEDIA_BUS_FMT_BGR888_1X24 and MEDIA_BUS_FMT_BGR888_3X8 are used
> -on parallel busses for transferring an 8 bits per sample BGR data, whereas on
> -serial busses the data in this format is only referred to using
> -MEDIA_BUS_FMT_BGR888_1X24. This is because there is effectively only a single
> -way to transport that format on the serial busses.
> +While the media bus pixel codes are named based on how pixels are
> +transmitted on parallel buses, serial buses do not define separate
> +codes. By convention, they use the codes that transfer a sample on a
> +single clock cycle. and whose names correspond to the order in which

s/cycle./cycle,/

I would write "bit orders from LSB to MSB" instead of "names", as in the
example below the "name" contains "RGB" but the described order is blue,
green, red.

> +colour components are transmitted on the serial bus. For instance, the
> +MIPI CSI-2 24-bit RGB (RGB888) format uses the MEDIA_BUS_FMT_RGB888_1X24
> +media bus code because CSI-2 transmits the blue colour component first,
> +followed by green and red, and MEDIA_BUS_FMT_RGB888_1X24 defines the
> +first bit of blue at index 0. While used for 24-bit RGB data on parallel

s/index 0/bit 0/

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> +buses, the MEDIA_BUS_FMT_RGB888_3X8 or MEDIA_BUS_FMT_BGR888_1X24 codes
> +must not be used for CSI-2.
>  
>  Packed RGB Formats
>  ^^^^^^^^^^^^^^^^^^
>  
>  Those formats transfer pixel data as red, green and blue components. The

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2026-03-05 12:14 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-17  8:38 [PATCH v6 0/2] media: Fix CSI2 RGB vs BGR pixel order Maxime Ripard
2026-02-17  8:38 ` [PATCH v6 1/2] media: uapi: Clarify MBUS color component order for serial buses Maxime Ripard
2026-03-05 12:14   ` Laurent Pinchart [this message]
2026-02-17  8:38 ` [PATCH v6 2/2] media: bcm2835-unicam: Fix RGB format / mbus code association Maxime Ripard
2026-03-05 12:17   ` 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=20260305121408.GA208179@killaraus.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=dave.stevenson@raspberrypi.com \
    --cc=hans.verkuil@cisco.com \
    --cc=hverkuil@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=mripard@kernel.org \
    --cc=sakari.ailus@linux.intel.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