From: Maxime Ripard <mripard@kernel.org>
To: Mauro Carvalho Chehab <mchehab@kernel.org>,
Mats Randgaard <matrandg@cisco.com>,
Alain Volmat <alain.volmat@foss.st.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Hans Verkuil <hverkuil@kernel.org>
Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
Hans Verkuil <hans.verkuil@cisco.com>,
Dave Stevenson <dave.stevenson@raspberrypi.com>,
Maxime Ripard <mripard@kernel.org>
Subject: [PATCH v2 0/4] media: Fix CSI2 RGB vs BGR pixel order
Date: Thu, 11 Sep 2025 11:15:31 +0200 [thread overview]
Message-ID: <20250911-csi-bgr-rgb-v2-0-e6c6b10c1040@kernel.org> (raw)
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 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 | 23 +++++++++-
drivers/media/i2c/tc358743.c | 51 ++++++++++++++++++----
include/uapi/linux/media-bus-format.h | 3 +-
4 files changed, 110 insertions(+), 18 deletions(-)
---
base-commit: 76eeb9b8de9880ca38696b2fb56ac45ac0a25c6c
change-id: 20250612-csi-bgr-rgb-b837980c00b3
Best regards,
--
Maxime Ripard <mripard@kernel.org>
next reply other threads:[~2025-09-11 9:15 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-11 9:15 Maxime Ripard [this message]
2025-09-11 9:15 ` [PATCH v2 1/4] media: uapi: Clarify MBUS color component order for serial buses Maxime Ripard
2025-09-11 9:15 ` [PATCH v2 2/4] media: uapi: Introduce MEDIA_BUS_FMT_BGR565_1X16 Maxime Ripard
2025-09-11 10:42 ` Dave Stevenson
2025-09-11 9:15 ` [PATCH v2 3/4] media: tc358743: Fix the RGB MBUS format Maxime Ripard
2025-09-11 11:11 ` Dave Stevenson
2025-09-11 9:15 ` [PATCH v2 4/4] media: gc2145: " Maxime Ripard
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=20250911-csi-bgr-rgb-v2-0-e6c6b10c1040@kernel.org \
--to=mripard@kernel.org \
--cc=alain.volmat@foss.st.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=matrandg@cisco.com \
--cc=mchehab@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
all inboxes | Powered by JetHome®