All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Guoniu Zhou <guoniu.zhou@oss.nxp.com>
Cc: Frank Li <Frank.Li@nxp.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Loic Poulain <loic.poulain@oss.qualcomm.com>,
	linux-media@vger.kernel.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH v4 03/11] media: imx8-isi: Support mbus_code filtering in format enumeration
Date: Thu, 12 Nov 2026 03:42:57 +0200	[thread overview]
Message-ID: <20261112014257.GB449716@killaraus.ideasonboard.com> (raw)
In-Reply-To: <20260929-isi_imx952-v4-3-e69f89c7c651@oss.nxp.com>

On Tue, Sep 29, 2026 at 04:52:24PM +0800, Guoniu Zhou wrote:
> Extend mxc_isi_format_enum() to accept a v4l2_fmtdesc pointer instead
> of a plain index, so it can filter formats by mbus_code when set. This
> is used by the capture path to enumerate only formats compatible with
> the connected subdev output.

It's not in this patch, mxc_isi_format_enum() is used for M2M only. It
will only be used in the capture path in patch 04/11.

> 
> For the M2M device, the V4L2 framework clears mbus_code to 0 for
> devices without V4L2_CAP_IO_MC (v4l2-ioctl.c), so this change has no
> effect on M2M format enumeration.
> 
> Signed-off-by: Guoniu Zhou <guoniu.zhou@oss.nxp.com>
> ---
> Changes in v4:
> - New patch
> ---
>  drivers/media/platform/nxp/imx8-isi/imx8-isi-core.h  | 2 +-
>  drivers/media/platform/nxp/imx8-isi/imx8-isi-m2m.c   | 2 +-
>  drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c | 6 +++++-
>  3 files changed, 7 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.h b/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.h
> index 58b47335afc7..a30633a7e2e9 100644
> --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.h
> +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.h
> @@ -322,7 +322,7 @@ mxc_isi_bus_format_by_index(unsigned int index, unsigned int pad);
>  const struct mxc_isi_format_info *
>  mxc_isi_format_by_fourcc(u32 fourcc, enum mxc_isi_video_type type);
>  const struct mxc_isi_format_info *
> -mxc_isi_format_enum(unsigned int index, enum mxc_isi_video_type type);
> +mxc_isi_format_enum(const struct v4l2_fmtdesc *f, enum mxc_isi_video_type type);
>  const struct mxc_isi_format_info *
>  mxc_isi_format_try(struct mxc_isi_pipe *pipe, struct v4l2_pix_format_mplane *pix,
>  		   enum mxc_isi_video_type type);
> diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-m2m.c b/drivers/media/platform/nxp/imx8-isi/imx8-isi-m2m.c
> index b729eecad0fe..1178947bb548 100644
> --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-m2m.c
> +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-m2m.c
> @@ -492,7 +492,7 @@ static int mxc_isi_m2m_enum_fmt_vid(struct file *file, void *fh,
>  		MXC_ISI_VIDEO_M2M_OUT : MXC_ISI_VIDEO_M2M_CAP;
>  	const struct mxc_isi_format_info *info;
>  
> -	info = mxc_isi_format_enum(f->index, type);
> +	info = mxc_isi_format_enum(f, type);
>  	if (!info)
>  		return -EINVAL;
>  
> 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 f45c2aae59ce..0d87a1082727 100644
> --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c
> +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c
> @@ -482,13 +482,17 @@ mxc_isi_format_by_fourcc(u32 fourcc, enum mxc_isi_video_type type)
>  }
>  
>  const struct mxc_isi_format_info *
> -mxc_isi_format_enum(unsigned int index, enum mxc_isi_video_type type)
> +mxc_isi_format_enum(const struct v4l2_fmtdesc *f, enum mxc_isi_video_type type)
>  {
> +	unsigned int index = f->index;
>  	unsigned int i;
>  
>  	for (i = 0; i < ARRAY_SIZE(mxc_isi_formats); i++) {
>  		const struct mxc_isi_format_info *fmt = &mxc_isi_formats[i];
>  
> +		if (f->mbus_code && fmt->mbus_code != f->mbus_code)
> +			continue;
> +
>  		if (!(fmt->type & type))
>  			continue;
>  

-- 
Regards,

Laurent Pinchart


  parent reply	other threads:[~2026-11-12  1:43 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-29  8:52 [PATCH v4 00/11] media: imx8-isi: Add i.MX952 ISI support Guoniu Zhou
2026-09-29  8:52 ` [PATCH v4 01/11] media: imx8-isi: Reorder mxc_imx95_data to follow mxc_imx93_data Guoniu Zhou
2026-09-29  8:52 ` [PATCH v4 02/11] media: imx8-isi: Extend output format mask to 7 bits Guoniu Zhou
2026-09-29 14:20   ` Frank Li
2026-11-12  1:37   ` Laurent Pinchart
2026-11-12  8:06   ` Loic Poulain
2026-09-29  8:52 ` [PATCH v4 03/11] media: imx8-isi: Support mbus_code filtering in format enumeration Guoniu Zhou
2026-09-29 14:22   ` Frank Li
2026-11-12  1:42   ` Laurent Pinchart [this message]
2026-09-29  8:52 ` [PATCH v4 04/11] media: imx8-isi: Reuse mxc_isi_format_enum() in capture " Guoniu Zhou
2026-09-29 14:23   ` Frank Li
2026-11-12  1:47   ` Laurent Pinchart
2026-09-29  8:52 ` [PATCH v4 05/11] media: imx8-isi: Apply RAW output format workaround at runtime Guoniu Zhou
2026-09-29 14:26   ` Frank Li
2026-09-29  8:52 ` [PATCH v4 06/11] media: imx8-isi: Add RAW14 output format support Guoniu Zhou
2026-09-29 14:28   ` Frank Li
2026-09-29  8:52 ` [PATCH v4 07/11] media: imx8-isi: Select MSB-aligned RAW input from pixel link on i.MX95 Guoniu Zhou
2026-09-29 14:31   ` Frank Li
2026-09-30  2:39     ` G.N. Zhou (OSS)
2026-09-30 16:11       ` Frank Li
2026-09-29  8:52 ` [PATCH v4 08/11] media: imx8-isi: Exclude RAW10/12/14 output formats " Guoniu Zhou
2026-09-29 14:33   ` Frank Li
2026-09-29  8:52 ` [PATCH v4 09/11] media: dt-bindings: nxp,imx8-isi: Add i.MX952 ISI compatible string Guoniu Zhou
2026-09-29  8:52 ` [PATCH v4 10/11] media: imx8-isi: Add i.MX952 ISI support Guoniu Zhou
2026-09-29  8:52 ` [PATCH v4 11/11] media: imx8-isi: Enable RAW10/12/14 output LSB alignment on i.MX952 Guoniu Zhou

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=20261112014257.GB449716@killaraus.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=Frank.Li@nxp.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=guoniu.zhou@oss.nxp.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=krzk+dt@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=loic.poulain@oss.qualcomm.com \
    --cc=mchehab@kernel.org \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.