From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Maxime Ripard <mripard@kernel.org>
Cc: Raspberry Pi Kernel Maintenance <kernel-list@raspberrypi.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Florian Fainelli <florian.fainelli@broadcom.com>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.com>,
Ray Jui <rjui@broadcom.com>,
Scott Branden <sbranden@broadcom.com>,
Dave Stevenson <dave.stevenson@raspberrypi.com>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
Hans Verkuil <hverkuil@xs4all.nl>,
Jean-Michel Hautbois <jeanmichel.hautbois@yoseli.org>,
Naushir Patuck <naush@raspberrypi.com>,
linux-media@vger.kernel.org,
linux-rpi-kernel@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] media: bcm2835-unicam: Remove RGB24 support
Date: Mon, 9 Jun 2025 03:37:51 +0300 [thread overview]
Message-ID: <20250609003751.GD14545@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20250606-rpi-unicam-rgb-bgr-fix-v1-1-9930b963f3eb@kernel.org>
Hi Maxime,
Thank you for the patch.
On Fri, Jun 06, 2025 at 04:53:03PM +0200, Maxime Ripard wrote:
> The RGB24 V4L2 format is defined as a pixel format with 8 bits per
> components, with the components being in the red, green, and blue order
> from left to right.
>
> The RGB MIPI-CSI2 is defined in the specification (Section 11.3.1,
> RGB888) with blue coming first, then green, then red. So the opposite of
> what V4L2 means by RGB.
>
> Since the hardware cannot reorder the components, this means that when
> selecting the RGB24 format, you get inverted red and blue components
> compared to what you'd expect.
>
> The driver already supports BGR24, so we can simply remove the RGB24
> format from the driver.
The only reason I could think of to explain why the driver exposes
V4L2_PIX_FMT_RGB24 is to support CSI-2 sources that transfer RGB888 data
with a non-standard order. I don't know what hardware would do that.
Dave, Naush, do you recall why this pixel format is supported by the
unicam driver ?
> Fixes: 392cd78d495f ("media: bcm2835-unicam: Add support for CCP2/CSI2 camera interface")
> Signed-off-by: Maxime Ripard <mripard@kernel.org>
> ---
> drivers/media/platform/broadcom/bcm2835-unicam.c | 5 -----
> 1 file changed, 5 deletions(-)
>
> diff --git a/drivers/media/platform/broadcom/bcm2835-unicam.c b/drivers/media/platform/broadcom/bcm2835-unicam.c
> index f10064107d543caf867249d0566a0f42d6d8c4c6..1f549019efd53c9aae83193e74f1a3601ebf274d 100644
> --- a/drivers/media/platform/broadcom/bcm2835-unicam.c
> +++ b/drivers/media/platform/broadcom/bcm2835-unicam.c
> @@ -338,15 +338,10 @@ static const struct unicam_format_info unicam_image_formats[] = {
> /* RGB Formats */
> .fourcc = V4L2_PIX_FMT_RGB565, /* gggbbbbb rrrrrggg */
> .code = MEDIA_BUS_FMT_RGB565_1X16,
> .depth = 16,
> .csi_dt = MIPI_CSI2_DT_RGB565,
> - }, {
> - .fourcc = V4L2_PIX_FMT_RGB24, /* rgb */
> - .code = MEDIA_BUS_FMT_RGB888_1X24,
> - .depth = 24,
> - .csi_dt = MIPI_CSI2_DT_RGB888,
> }, {
> .fourcc = V4L2_PIX_FMT_BGR24, /* bgr */
> .code = MEDIA_BUS_FMT_BGR888_1X24,
> .depth = 24,
> .csi_dt = MIPI_CSI2_DT_RGB888,
>
> ---
> base-commit: 0ff41df1cb268fc69e703a08a57ee14ae967d0ca
> change-id: 20250606-rpi-unicam-rgb-bgr-fix-d1b6f46a75ad
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2025-06-09 0:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-06 14:53 [PATCH] media: bcm2835-unicam: Remove RGB24 support Maxime Ripard
2025-06-09 0:37 ` Laurent Pinchart [this message]
2025-06-09 14:33 ` Dave Stevenson
2025-06-10 9:52 ` Laurent Pinchart
2025-06-10 12:47 ` Sakari Ailus
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=20250609003751.GD14545@pendragon.ideasonboard.com \
--to=laurent.pinchart@ideasonboard.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=dave.stevenson@raspberrypi.com \
--cc=florian.fainelli@broadcom.com \
--cc=hverkuil@xs4all.nl \
--cc=jeanmichel.hautbois@yoseli.org \
--cc=kernel-list@raspberrypi.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=mchehab@kernel.org \
--cc=mripard@kernel.org \
--cc=naush@raspberrypi.com \
--cc=rjui@broadcom.com \
--cc=sakari.ailus@linux.intel.com \
--cc=sbranden@broadcom.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