Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

media: uapi: Clarify MBUS color component order for serial buses

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.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Maxime Ripard <mripard@kernel.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>

authored by

Maxime Ripard and committed by
Hans Verkuil
7b0288bc 40c6da8a

+12 -8
+12 -8
Documentation/userspace-api/media/v4l/subdev-formats.rst
··· 159 159 JPEG just by storing it to memory), there is no one-to-one 160 160 correspondence between them. 161 161 162 - The media bus pixel codes document parallel formats. Should the pixel data be 163 - transported over a serial bus, the media bus pixel code that describes a 164 - parallel format that transfers a sample on a single clock cycle is used. For 165 - instance, both MEDIA_BUS_FMT_BGR888_1X24 and MEDIA_BUS_FMT_BGR888_3X8 are used 166 - on parallel busses for transferring an 8 bits per sample BGR data, whereas on 167 - serial busses the data in this format is only referred to using 168 - MEDIA_BUS_FMT_BGR888_1X24. This is because there is effectively only a single 169 - way to transport that format on the serial busses. 162 + While the media bus pixel codes are named based on how pixels are 163 + transmitted on parallel buses, serial buses do not define separate 164 + codes. By convention, they use the codes that transfer a sample on a 165 + single clock cycle, and whose bit orders from LSB to MSB correspond to 166 + the order in which colour components are transmitted on the serial bus. 167 + For instance, the MIPI CSI-2 24-bit RGB (RGB888) format uses the 168 + MEDIA_BUS_FMT_RGB888_1X24 media bus code because CSI-2 transmits the 169 + blue colour component first, followed by green and red, and 170 + MEDIA_BUS_FMT_RGB888_1X24 defines the first bit of blue at bit 0. 171 + While used for 24-bit RGB data on parallel buses, the 172 + MEDIA_BUS_FMT_RGB888_3X8 or MEDIA_BUS_FMT_BGR888_1X24 codes must not be 173 + used for CSI-2. 170 174 171 175 Packed RGB Formats 172 176 ^^^^^^^^^^^^^^^^^^