mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] media: imx-mipi-csis: add support for MEDIA_BUS_FMT_YUYV8_1X16
@ 2026-10-09 10:58 guoniu.zhou
  2026-10-12 19:37 ` Frank Li
  2026-10-14 21:56 ` Laurent Pinchart
  0 siblings, 2 replies; 5+ messages in thread
From: guoniu.zhou @ 2026-10-09 10:58 UTC (permalink / raw)
  To: Laurent Pinchart, Frank Li, Martin Kepplinger-Novakovic,
	Rui Miguel Silva, Purism Kernel Team, Bryan O'Donoghue,
	Mauro Carvalho Chehab, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam
  Cc: imx, linux-media, linux-arm-kernel, linux-kernel, Alice Yuan,
	Guoniu Zhou

From: Alice Yuan <alice.yuan@nxp.com>

Add MEDIA_BUS_FMT_YUYV8_1X16 to the list of supported bus formats.

The format uses the same CSI-2 YUV422 8-bit data type and 16-bit
parallel bus width as MEDIA_BUS_FMT_UYVY8_1X16, but with a different
component ordering. Supporting YUYV allows sensors and bridge devices
that output YUYV formatted YUV422 data to be used with the i.MX MIPI
CSIS driver without requiring format conversion.

Signed-off-by: Alice Yuan <alice.yuan@nxp.com>
Signed-off-by: Guoniu Zhou <guoniu.zhou@oss.nxp.com>
---
 drivers/media/platform/nxp/imx-mipi-csis.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/media/platform/nxp/imx-mipi-csis.c b/drivers/media/platform/nxp/imx-mipi-csis.c
index 5f9691d76434..14a00b9fcedf 100644
--- a/drivers/media/platform/nxp/imx-mipi-csis.c
+++ b/drivers/media/platform/nxp/imx-mipi-csis.c
@@ -382,6 +382,11 @@ static const struct csis_pix_format mipi_csis_formats[] = {
 		.output = MEDIA_BUS_FMT_UYVY8_1X16,
 		.data_type = MIPI_CSI2_DT_YUV422_8B,
 		.width = 16,
+	}, {
+		.code = MEDIA_BUS_FMT_YUYV8_1X16,
+		.output = MEDIA_BUS_FMT_YUYV8_1X16,
+		.data_type = MIPI_CSI2_DT_YUV422_8B,
+		.width = 16,
 	},
 	/* RGB formats. */
 	{

---
base-commit: b38d06ad1e13c32970d58039c154f009b81a3368
change-id: 20261009-csis_sam-c5c10ed12322

Best regards,
-- 
Guoniu Zhou <guoniu.zhou@oss.nxp.com>


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

* Re: [PATCH] media: imx-mipi-csis: add support for MEDIA_BUS_FMT_YUYV8_1X16
  2026-10-09 10:58 [PATCH] media: imx-mipi-csis: add support for MEDIA_BUS_FMT_YUYV8_1X16 guoniu.zhou
@ 2026-10-12 19:37 ` Frank Li
  2026-10-14 21:56 ` Laurent Pinchart
  1 sibling, 0 replies; 5+ messages in thread
From: Frank Li @ 2026-10-12 19:37 UTC (permalink / raw)
  To: guoniu.zhou
  Cc: Laurent Pinchart, Frank Li, Martin Kepplinger-Novakovic,
	Rui Miguel Silva, Purism Kernel Team, Bryan O'Donoghue,
	Mauro Carvalho Chehab, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, imx, linux-media, linux-arm-kernel, linux-kernel,
	Alice Yuan

On Fri, Oct 09, 2026 at 06:58:41PM +0800, guoniu.zhou@oss.nxp.com wrote:
> From: Alice Yuan <alice.yuan@nxp.com>
>
> Add MEDIA_BUS_FMT_YUYV8_1X16 to the list of supported bus formats.
>
> The format uses the same CSI-2 YUV422 8-bit data type and 16-bit
> parallel bus width as MEDIA_BUS_FMT_UYVY8_1X16, but with a different
> component ordering. Supporting YUYV allows sensors and bridge devices
> that output YUYV formatted YUV422 data to be used with the i.MX MIPI
> CSIS driver without requiring format conversion.
>
> Signed-off-by: Alice Yuan <alice.yuan@nxp.com>
> Signed-off-by: Guoniu Zhou <guoniu.zhou@oss.nxp.com>
> ---

Reviewed-by: Frank Li <Frank.Li@nxp.com>

>  drivers/media/platform/nxp/imx-mipi-csis.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/media/platform/nxp/imx-mipi-csis.c b/drivers/media/platform/nxp/imx-mipi-csis.c
> index 5f9691d76434..14a00b9fcedf 100644
> --- a/drivers/media/platform/nxp/imx-mipi-csis.c
> +++ b/drivers/media/platform/nxp/imx-mipi-csis.c
> @@ -382,6 +382,11 @@ static const struct csis_pix_format mipi_csis_formats[] = {
>  		.output = MEDIA_BUS_FMT_UYVY8_1X16,
>  		.data_type = MIPI_CSI2_DT_YUV422_8B,
>  		.width = 16,
> +	}, {
> +		.code = MEDIA_BUS_FMT_YUYV8_1X16,
> +		.output = MEDIA_BUS_FMT_YUYV8_1X16,
> +		.data_type = MIPI_CSI2_DT_YUV422_8B,
> +		.width = 16,
>  	},
>  	/* RGB formats. */
>  	{
>
> ---
> base-commit: b38d06ad1e13c32970d58039c154f009b81a3368
> change-id: 20261009-csis_sam-c5c10ed12322
>
> Best regards,
> --
> Guoniu Zhou <guoniu.zhou@oss.nxp.com>
>
>

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

* Re: [PATCH] media: imx-mipi-csis: add support for MEDIA_BUS_FMT_YUYV8_1X16
  2026-10-09 10:58 [PATCH] media: imx-mipi-csis: add support for MEDIA_BUS_FMT_YUYV8_1X16 guoniu.zhou
  2026-10-12 19:37 ` Frank Li
@ 2026-10-14 21:56 ` Laurent Pinchart
  2026-10-15  3:31   ` G.N. Zhou (OSS)
  1 sibling, 1 reply; 5+ messages in thread
From: Laurent Pinchart @ 2026-10-14 21:56 UTC (permalink / raw)
  To: guoniu.zhou
  Cc: Frank Li, Martin Kepplinger-Novakovic, Rui Miguel Silva,
	Purism Kernel Team, Bryan O'Donoghue, Mauro Carvalho Chehab,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, imx,
	linux-media, linux-arm-kernel, linux-kernel, Alice Yuan

Hello Guoniu,

Thank you for the patch.

On Fri, Oct 09, 2026 at 06:58:41PM +0800, guoniu.zhou@oss.nxp.com wrote:
> From: Alice Yuan <alice.yuan@nxp.com>
> 
> Add MEDIA_BUS_FMT_YUYV8_1X16 to the list of supported bus formats.
> 
> The format uses the same CSI-2 YUV422 8-bit data type and 16-bit
> parallel bus width as MEDIA_BUS_FMT_UYVY8_1X16, but with a different
> component ordering. Supporting YUYV allows sensors and bridge devices
> that output YUYV formatted YUV422 data to be used with the i.MX MIPI
> CSIS driver without requiring format conversion.

What sensor(s) do you have in mind ? CSI-2 does not support other
component orderings, the YUV4222_8B data type specifies the ordering on
the bus as [U1, Y1, V1, Y2], and V4L2 maps that to
MEDIA_BUS_FMT_UYVY8_1X16.

> Signed-off-by: Alice Yuan <alice.yuan@nxp.com>
> Signed-off-by: Guoniu Zhou <guoniu.zhou@oss.nxp.com>
> ---
>  drivers/media/platform/nxp/imx-mipi-csis.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/media/platform/nxp/imx-mipi-csis.c b/drivers/media/platform/nxp/imx-mipi-csis.c
> index 5f9691d76434..14a00b9fcedf 100644
> --- a/drivers/media/platform/nxp/imx-mipi-csis.c
> +++ b/drivers/media/platform/nxp/imx-mipi-csis.c
> @@ -382,6 +382,11 @@ static const struct csis_pix_format mipi_csis_formats[] = {
>  		.output = MEDIA_BUS_FMT_UYVY8_1X16,
>  		.data_type = MIPI_CSI2_DT_YUV422_8B,
>  		.width = 16,
> +	}, {
> +		.code = MEDIA_BUS_FMT_YUYV8_1X16,
> +		.output = MEDIA_BUS_FMT_YUYV8_1X16,
> +		.data_type = MIPI_CSI2_DT_YUV422_8B,
> +		.width = 16,
>  	},
>  	/* RGB formats. */
>  	{
> 
> ---
> base-commit: b38d06ad1e13c32970d58039c154f009b81a3368
> change-id: 20261009-csis_sam-c5c10ed12322

-- 
Regards,

Laurent Pinchart

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

* RE: [PATCH] media: imx-mipi-csis: add support for MEDIA_BUS_FMT_YUYV8_1X16
  2026-10-14 21:56 ` Laurent Pinchart
@ 2026-10-15  3:31   ` G.N. Zhou (OSS)
  2026-11-09 23:05     ` Laurent Pinchart
  0 siblings, 1 reply; 5+ messages in thread
From: G.N. Zhou (OSS) @ 2026-10-15  3:31 UTC (permalink / raw)
  To: Laurent Pinchart, G.N. Zhou (OSS)
  Cc: Frank Li, Martin Kepplinger-Novakovic, Rui Miguel Silva,
	Purism Kernel Team, Bryan O'Donoghue, Mauro Carvalho Chehab,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, imx,
	linux-media, linux-arm-kernel, linux-kernel, Alice Yuan

Hi Laurent,

Thanks for your review.


NXP Confidential
> -----Original Message-----
> From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Sent: Thursday, October 15, 2026 5:56 AM
> To: G.N. Zhou (OSS) <guoniu.zhou@oss.nxp.com>
> Cc: Frank Li <frank.li@nxp.com>; Martin Kepplinger-Novakovic
> <martink@posteo.de>; Rui Miguel Silva <rmfrfs@gmail.com>; Purism Kernel
> Team <kernel@puri.sm>; Bryan O'Donoghue <bod@kernel.org>; Mauro
> Carvalho Chehab <mchehab@kernel.org>; Sascha Hauer
> <s.hauer@pengutronix.de>; Pengutronix Kernel Team
> <kernel@pengutronix.de>; Fabio Estevam <festevam@gmail.com>;
> imx@lists.linux.dev; linux-media@vger.kernel.org; linux-arm-
> kernel@lists.infradead.org; linux-kernel@vger.kernel.org; Alice Yuan
> <alice.yuan@nxp.com>
> Subject: Re: [PATCH] media: imx-mipi-csis: add support for
> MEDIA_BUS_FMT_YUYV8_1X16
>
> Hello Guoniu,
>
> Thank you for the patch.
>
> On Fri, Oct 09, 2026 at 06:58:41PM +0800, guoniu.zhou@oss.nxp.com wrote:
> > From: Alice Yuan <alice.yuan@nxp.com>
> >
> > Add MEDIA_BUS_FMT_YUYV8_1X16 to the list of supported bus formats.
> >
> > The format uses the same CSI-2 YUV422 8-bit data type and 16-bit
> > parallel bus width as MEDIA_BUS_FMT_UYVY8_1X16, but with a different
> > component ordering. Supporting YUYV allows sensors and bridge devices
> > that output YUYV formatted YUV422 data to be used with the i.MX MIPI
> > CSIS driver without requiring format conversion.
>
> What sensor(s) do you have in mind ? CSI-2 does not support other component
> orderings, the YUV4222_8B data type specifies the ordering on the bus as [U1,
> Y1, V1, Y2], and V4L2 maps that to MEDIA_BUS_FMT_UYVY8_1X16.

The sensor is the OV5640. Its driver already advertises MEDIA_BUS_FMT_YUYV8_1X16
for CSI-2 mode in mainline (ov5640.c, ov5640_csi2_formats[]). According to datasheet,
ov5640 ISP reorders YUV components via register 0x4300 before transmitting over the
CSI-2 link using the YUV422_8B data type. The CSIS itself is a pass-through — it does not
interpret or reorder pixel data, it just forwards whatever the sensor sends. Without
YUYV8_1X16 in the CSIS format table, media link validation fails when using the OV5640
in YUYV mode.

Best Regards
G.N Zhou


>
> > Signed-off-by: Alice Yuan <alice.yuan@nxp.com>
> > Signed-off-by: Guoniu Zhou <guoniu.zhou@oss.nxp.com>
> > ---
> >  drivers/media/platform/nxp/imx-mipi-csis.c | 5 +++++
> >  1 file changed, 5 insertions(+)
> >
> > diff --git a/drivers/media/platform/nxp/imx-mipi-csis.c
> > b/drivers/media/platform/nxp/imx-mipi-csis.c
> > index 5f9691d76434..14a00b9fcedf 100644
> > --- a/drivers/media/platform/nxp/imx-mipi-csis.c
> > +++ b/drivers/media/platform/nxp/imx-mipi-csis.c
> > @@ -382,6 +382,11 @@ static const struct csis_pix_format
> mipi_csis_formats[] = {
> >             .output = MEDIA_BUS_FMT_UYVY8_1X16,
> >             .data_type = MIPI_CSI2_DT_YUV422_8B,
> >             .width = 16,
> > +   }, {
> > +           .code = MEDIA_BUS_FMT_YUYV8_1X16,
> > +           .output = MEDIA_BUS_FMT_YUYV8_1X16,
> > +           .data_type = MIPI_CSI2_DT_YUV422_8B,
> > +           .width = 16,
> >     },
> >     /* RGB formats. */
> >     {
> >
> > ---
> > base-commit: b38d06ad1e13c32970d58039c154f009b81a3368
> > change-id: 20261009-csis_sam-c5c10ed12322
>
> --
> Regards,
>
> Laurent Pinchart

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

* Re: [PATCH] media: imx-mipi-csis: add support for MEDIA_BUS_FMT_YUYV8_1X16
  2026-10-15  3:31   ` G.N. Zhou (OSS)
@ 2026-11-09 23:05     ` Laurent Pinchart
  0 siblings, 0 replies; 5+ messages in thread
From: Laurent Pinchart @ 2026-11-09 23:05 UTC (permalink / raw)
  To: G.N. Zhou (OSS)
  Cc: Frank Li, Martin Kepplinger-Novakovic, Rui Miguel Silva,
	Purism Kernel Team, Bryan O'Donoghue, Mauro Carvalho Chehab,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam, imx,
	linux-media, linux-arm-kernel, linux-kernel, Alice Yuan

On Thu, Oct 15, 2026 at 03:31:53AM +0000, G.N. Zhou (OSS) wrote:
> On Thursday, October 15, 2026 5:56 AM, Laurent Pinchart wrote:
> > On Fri, Oct 09, 2026 at 06:58:41PM +0800, guoniu.zhou@oss.nxp.com wrote:
> > > From: Alice Yuan <alice.yuan@nxp.com>
> > >
> > > Add MEDIA_BUS_FMT_YUYV8_1X16 to the list of supported bus formats.
> > >
> > > The format uses the same CSI-2 YUV422 8-bit data type and 16-bit
> > > parallel bus width as MEDIA_BUS_FMT_UYVY8_1X16, but with a different
> > > component ordering. Supporting YUYV allows sensors and bridge devices
> > > that output YUYV formatted YUV422 data to be used with the i.MX MIPI
> > > CSIS driver without requiring format conversion.
> >
> > What sensor(s) do you have in mind ? CSI-2 does not support other component
> > orderings, the YUV4222_8B data type specifies the ordering on the bus as [U1,
> > Y1, V1, Y2], and V4L2 maps that to MEDIA_BUS_FMT_UYVY8_1X16.
> 
> The sensor is the OV5640. Its driver already advertises MEDIA_BUS_FMT_YUYV8_1X16
> for CSI-2 mode in mainline (ov5640.c, ov5640_csi2_formats[]). According to datasheet,
> ov5640 ISP reorders YUV components via register 0x4300 before transmitting over the
> CSI-2 link using the YUV422_8B data type. The CSIS itself is a pass-through — it does not
> interpret or reorder pixel data, it just forwards whatever the sensor sends. Without
> YUYV8_1X16 in the CSIS format table, media link validation fails when using the OV5640
> in YUYV mode.

That makes sense. Overall we may have been better off by not exposing
MEDIA_BUS_FMT_YUYV8_1X16 in the ov5640 driver and relying on the DMA
engine on the host side to handle different YUV formats, but as the
driver exposes it, it makes sense to support it here too. I don't like
that all CSI-2 receiver drivers would need to be patched to support
this, but the number of YUV components ordering isn't as large as for
CFA patterns, so we can live with it.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> > > Signed-off-by: Alice Yuan <alice.yuan@nxp.com>
> > > Signed-off-by: Guoniu Zhou <guoniu.zhou@oss.nxp.com>
> > > ---
> > >  drivers/media/platform/nxp/imx-mipi-csis.c | 5 +++++
> > >  1 file changed, 5 insertions(+)
> > >
> > > diff --git a/drivers/media/platform/nxp/imx-mipi-csis.c
> > > b/drivers/media/platform/nxp/imx-mipi-csis.c
> > > index 5f9691d76434..14a00b9fcedf 100644
> > > --- a/drivers/media/platform/nxp/imx-mipi-csis.c
> > > +++ b/drivers/media/platform/nxp/imx-mipi-csis.c
> > > @@ -382,6 +382,11 @@ static const struct csis_pix_format
> > mipi_csis_formats[] = {
> > >             .output = MEDIA_BUS_FMT_UYVY8_1X16,
> > >             .data_type = MIPI_CSI2_DT_YUV422_8B,
> > >             .width = 16,
> > > +   }, {
> > > +           .code = MEDIA_BUS_FMT_YUYV8_1X16,
> > > +           .output = MEDIA_BUS_FMT_YUYV8_1X16,
> > > +           .data_type = MIPI_CSI2_DT_YUV422_8B,
> > > +           .width = 16,
> > >     },
> > >     /* RGB formats. */
> > >     {
> > >
> > > ---
> > > base-commit: b38d06ad1e13c32970d58039c154f009b81a3368
> > > change-id: 20261009-csis_sam-c5c10ed12322

-- 
Regards,

Laurent Pinchart

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

end of thread, other threads:[~2026-11-09 23:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-09 10:58 [PATCH] media: imx-mipi-csis: add support for MEDIA_BUS_FMT_YUYV8_1X16 guoniu.zhou
2026-10-12 19:37 ` Frank Li
2026-10-14 21:56 ` Laurent Pinchart
2026-10-15  3:31   ` G.N. Zhou (OSS)
2026-11-09 23:05     ` Laurent Pinchart

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®