Re: [PATCH v3 3/3] media: nxp: imx8-isi: Add additional 32-bit RGB format support

[email protected]
Newsgroups dev.linux.lists.imx
Message-ID <[email protected]>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Hardware format configuration collision between V4L2_PIX_FMT_RGBX32 and V4L2_PIX_FMT_XBGR32 causing color swap in M2M reads.
--

--- Patch [3]: [PATCH v3 3/3] media: nxp: imx8-isi: Add additional 32-bit RGB format support ---
commit 02b3513d44dce2138fe49ccef7f4dc91a18d3043
Author: Guoniu Zhou <[email protected]>

media: nxp: imx8-isi: Add additional 32-bit RGB format support

Add support for additional 32-bit RGB pixel formats (BGRA32, RGBA32,
BGRX32, RGBX32, ARGB2101010).

> diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c b/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c
> index 92647ee1e7933..646a7c3d12639 100644
> --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c
> +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c
[ ... ]
> @@ -166,6 +166,57 @@ static const struct mxc_isi_format_info mxc_isi_formats[] = {
[ ... ]
> +	}, {
> +		.mbus_code	= MEDIA_BUS_FMT_RGB888_1X24,
> +		.fourcc		= V4L2_PIX_FMT_RGBX32,
> +		.type		= MXC_ISI_VIDEO_CAP | MXC_ISI_VIDEO_M2M_OUT
> +				| MXC_ISI_VIDEO_M2M_CAP,
> +		.isi_in_format	= CHNL_MEM_RD_CTRL_IMG_TYPE_XBGR8,

[Severity: High]
This is a pre-existing issue, but does mapping V4L2_PIX_FMT_RGBX32 to the same
hardware input format (CHNL_MEM_RD_CTRL_IMG_TYPE_XBGR8) as V4L2_PIX_FMT_XBGR32
cause a color swap during M2M reads?

Since V4L2_PIX_FMT_XBGR32 (memory layout: [B, G, R, X]) and V4L2_PIX_FMT_RGBX32
(memory layout: [R, G, B, X]) have opposite red and blue channel positions in
memory, mapping both to the exact same hardware input configuration
structurally guarantees that one of these formats will suffer from a silent
color swap when read by the hardware.

> +		.isi_out_format	= CHNL_IMG_CTRL_FORMAT_XBGR888,
> +		.mem_planes	= 1,
> +		.color_planes	= 1,
> +		.depth		= { 32 },
> +		.encoding	= MXC_ISI_ENC_RGB,
[ ... ]

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=3
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.