public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/4] media: Fix CSI2 RGB vs BGR pixel order
@ 2025-10-13 11:01 Maxime Ripard
  2025-10-13 11:01 ` [PATCH v4 1/4] media: uapi: Clarify MBUS color component order for serial buses Maxime Ripard
                   ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: Maxime Ripard @ 2025-10-13 11:01 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Mats Randgaard, Alain Volmat, Sakari Ailus,
	Hans Verkuil, Laurent Pinchart
  Cc: linux-media, linux-kernel, Hans Verkuil, Dave Stevenson,
	Maxime Ripard

Hi,

Here's an(other [1]) attempt at fixing the current mess due to the
opposite meaning of what v4l2 and the MIPI-CSI2 spec call "RGB". By v4l2
nomenclature, the format CSI calls RGB is actually BGR.

Unfortunately, a handful of CSI transceivers report through RGB media
bus pixel code, which is then understood as V4L2_PIX_FMT_RGB24 by CSI
receivers.

This is made somewhat worse the fact that media bus codes have been made
mostly with parallel busses in mind, and thus the order of pixels wasn't
clearly defined anywhere.

So the v4l2 vs CSI mismatch was confusing (but there's nothing we can do
about it), but the doc didn't really make an attempt at clearing it up
either.

We did have a convention so far though, that about half the affected
drivers were following. 

This series improves the doc, adds the missing media bus codes, and
converts the transceiver drivers to the rightful media bus format.

We'll also need that series [2] from Laurent to fix all the affected
transceivers. 

Let me know what you think,
Maxime

1: https://lore.kernel.org/r/20250606-rpi-unicam-rgb-bgr-fix-v1-1-9930b963f3eb@kernel.org
2: https://lore.kernel.org/r/20250611181528.19542-1-laurent.pinchart@ideasonboard.com

---
Changes in v4:
- Rebased on 6.18-rc1
- Link to v3: https://lore.kernel.org/r/20250917-csi-bgr-rgb-v3-0-0145571b3aa4@kernel.org

Changes in v3:
- Fix typos in commit messages
- use dev_warn_once for deprecation warnings
- Reintroduce dropped unsupported colorspace handling
- Remove unneeded fallthroughs
- Link to v2: https://lore.kernel.org/r/20250911-csi-bgr-rgb-v2-0-e6c6b10c1040@kernel.org

Changes in v2:
- Don't drop RGB, but treat it as deprecated instead.
- Rebase on 6.17-rc5
- Link to v1: https://lore.kernel.org/r/20250612-csi-bgr-rgb-v1-0-dc8a309118f8@kernel.org

---
Maxime Ripard (4):
      media: uapi: Clarify MBUS color component order for serial buses
      media: uapi: Introduce MEDIA_BUS_FMT_BGR565_1X16
      media: tc358743: Fix the RGB MBUS format
      media: gc2145: Fix the RGB MBUS format

 .../userspace-api/media/v4l/subdev-formats.rst     | 51 ++++++++++++++++++---
 drivers/media/i2c/gc2145.c                         | 24 +++++++++-
 drivers/media/i2c/tc358743.c                       | 53 ++++++++++++++++++----
 include/uapi/linux/media-bus-format.h              |  3 +-
 4 files changed, 113 insertions(+), 18 deletions(-)
---
base-commit: 3a8660878839faadb4f1a6dd72c3179c1df56787
change-id: 20250612-csi-bgr-rgb-b837980c00b3

Best regards,
-- 
Maxime Ripard <mripard@kernel.org>


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2026-02-04 19:42 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-13 11:01 [PATCH v4 0/4] media: Fix CSI2 RGB vs BGR pixel order Maxime Ripard
2025-10-13 11:01 ` [PATCH v4 1/4] media: uapi: Clarify MBUS color component order for serial buses Maxime Ripard
2025-10-26 23:12   ` Laurent Pinchart
2025-10-13 11:01 ` [PATCH v4 2/4] media: uapi: Introduce MEDIA_BUS_FMT_BGR565_1X16 Maxime Ripard
2025-10-26 23:15   ` Laurent Pinchart
2025-10-26 23:33     ` Laurent Pinchart
2025-12-08 15:32       ` Maxime Ripard
2026-01-23 15:34         ` Laurent Pinchart
2026-01-28 12:32           ` Maxime Ripard
2026-01-28 13:19             ` Laurent Pinchart
2026-02-02  7:23               ` Jai Luthra
2026-02-02  9:31                 ` Laurent Pinchart
2026-02-02 10:51                   ` Jai Luthra
2026-02-03 23:43                     ` Laurent Pinchart
2026-02-04  0:52                       ` Jai Luthra
2026-02-03  8:52               ` Maxime Ripard
2026-02-03 23:40                 ` Laurent Pinchart
2026-02-04  9:31                   ` Maxime Ripard
2026-02-04 19:41                     ` Laurent Pinchart
2025-10-13 11:01 ` [PATCH v4 3/4] media: tc358743: Fix the RGB MBUS format Maxime Ripard
2025-10-13 17:15   ` Dave Stevenson
2025-10-13 11:01 ` [PATCH v4 4/4] media: gc2145: " Maxime Ripard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox