From: "Jernej Škrabec" <jernej.skrabec@gmail.com>
To: linux-media@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-staging@lists.linux.dev,
Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Cc: Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Chen-Yu Tsai <wens@csie.org>,
Samuel Holland <samuel@sholland.org>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Adam Pigg <adam@piggz.co.uk>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH 6/9] media: sun6i-csi: capture: Implement MC I/O with extended enum_fmt
Date: Sat, 25 Mar 2023 08:13:39 +0100 [thread overview]
Message-ID: <3225394.44csPzL39Z@kista> (raw)
In-Reply-To: <20230324151228.2778112-7-paul.kocialkowski@bootlin.com>
Dne petek, 24. marec 2023 ob 16:12:25 CET je Paul Kocialkowski napisal(a):
> This driver needs the media-controller API to operate and should not be
> considered as a video-device-centric implementation.
>
> Properly report the IO_MC device cap and extend the enum_fmt
> implementation to support enumeration with an explicit mbus_code.
>
> Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> ---
> .../sunxi/sun6i-csi/sun6i_csi_capture.c | 36 ++++++++++++++++---
> 1 file changed, 32 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c
> index 6ce7f1d3ed57..9627030ff060 100644
> --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c
> +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c
> @@ -777,13 +777,40 @@ static int sun6i_csi_capture_enum_fmt(struct file *file, void *private,
> struct v4l2_fmtdesc *fmtdesc)
> {
> u32 index = fmtdesc->index;
> + u32 mbus_code = fmtdesc->mbus_code;
Nit: reverse christmas tree.
Other than that:
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Best regards,
Jernej
> + unsigned int index_valid = 0;
> + unsigned int i;
> +
> + if (!mbus_code) {
> + if (index >= ARRAY_SIZE(sun6i_csi_capture_formats))
> + return -EINVAL;
> +
> + fmtdesc->pixelformat =
> + sun6i_csi_capture_formats[index].pixelformat;
> +
> + return 0;
> + }
> +
> + /* Check capture pixel format matching with mbus code. */
>
> - if (index >= ARRAY_SIZE(sun6i_csi_capture_formats))
> + if (!sun6i_csi_bridge_format_find(mbus_code))
> return -EINVAL;
>
> - fmtdesc->pixelformat = sun6i_csi_capture_formats[index].pixelformat;
> + for (i = 0; i < ARRAY_SIZE(sun6i_csi_capture_formats); i++) {
> + u32 pixelformat = sun6i_csi_capture_formats[i].pixelformat;
>
> - return 0;
> + if (!sun6i_csi_capture_format_check(pixelformat, mbus_code))
> + continue;
> +
> + if (index == index_valid) {
> + fmtdesc->pixelformat = pixelformat;
> + return 0;
> + }
> +
> + index_valid++;
> + }
> +
> + return -EINVAL;
> }
>
> static int sun6i_csi_capture_g_fmt(struct file *file, void *private,
> @@ -1039,7 +1066,8 @@ int sun6i_csi_capture_setup(struct sun6i_csi_device *csi_dev)
>
> strscpy(video_dev->name, SUN6I_CSI_CAPTURE_NAME,
> sizeof(video_dev->name));
> - video_dev->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
> + video_dev->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING |
> + V4L2_CAP_IO_MC;
> video_dev->vfl_dir = VFL_DIR_RX;
> video_dev->release = video_device_release_empty;
> video_dev->fops = &sun6i_csi_capture_fops;
> --
> 2.39.2
>
>
WARNING: multiple messages have this Message-ID (diff)
From: "Jernej Škrabec" <jernej.skrabec@gmail.com>
To: linux-media@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org,
linux-staging@lists.linux.dev,
Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Cc: Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Chen-Yu Tsai <wens@csie.org>,
Samuel Holland <samuel@sholland.org>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Adam Pigg <adam@piggz.co.uk>,
Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH 6/9] media: sun6i-csi: capture: Implement MC I/O with extended enum_fmt
Date: Sat, 25 Mar 2023 08:13:39 +0100 [thread overview]
Message-ID: <3225394.44csPzL39Z@kista> (raw)
In-Reply-To: <20230324151228.2778112-7-paul.kocialkowski@bootlin.com>
Dne petek, 24. marec 2023 ob 16:12:25 CET je Paul Kocialkowski napisal(a):
> This driver needs the media-controller API to operate and should not be
> considered as a video-device-centric implementation.
>
> Properly report the IO_MC device cap and extend the enum_fmt
> implementation to support enumeration with an explicit mbus_code.
>
> Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
> ---
> .../sunxi/sun6i-csi/sun6i_csi_capture.c | 36 ++++++++++++++++---
> 1 file changed, 32 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c
> index 6ce7f1d3ed57..9627030ff060 100644
> --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c
> +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi_capture.c
> @@ -777,13 +777,40 @@ static int sun6i_csi_capture_enum_fmt(struct file *file, void *private,
> struct v4l2_fmtdesc *fmtdesc)
> {
> u32 index = fmtdesc->index;
> + u32 mbus_code = fmtdesc->mbus_code;
Nit: reverse christmas tree.
Other than that:
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Best regards,
Jernej
> + unsigned int index_valid = 0;
> + unsigned int i;
> +
> + if (!mbus_code) {
> + if (index >= ARRAY_SIZE(sun6i_csi_capture_formats))
> + return -EINVAL;
> +
> + fmtdesc->pixelformat =
> + sun6i_csi_capture_formats[index].pixelformat;
> +
> + return 0;
> + }
> +
> + /* Check capture pixel format matching with mbus code. */
>
> - if (index >= ARRAY_SIZE(sun6i_csi_capture_formats))
> + if (!sun6i_csi_bridge_format_find(mbus_code))
> return -EINVAL;
>
> - fmtdesc->pixelformat = sun6i_csi_capture_formats[index].pixelformat;
> + for (i = 0; i < ARRAY_SIZE(sun6i_csi_capture_formats); i++) {
> + u32 pixelformat = sun6i_csi_capture_formats[i].pixelformat;
>
> - return 0;
> + if (!sun6i_csi_capture_format_check(pixelformat, mbus_code))
> + continue;
> +
> + if (index == index_valid) {
> + fmtdesc->pixelformat = pixelformat;
> + return 0;
> + }
> +
> + index_valid++;
> + }
> +
> + return -EINVAL;
> }
>
> static int sun6i_csi_capture_g_fmt(struct file *file, void *private,
> @@ -1039,7 +1066,8 @@ int sun6i_csi_capture_setup(struct sun6i_csi_device *csi_dev)
>
> strscpy(video_dev->name, SUN6I_CSI_CAPTURE_NAME,
> sizeof(video_dev->name));
> - video_dev->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
> + video_dev->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING |
> + V4L2_CAP_IO_MC;
> video_dev->vfl_dir = VFL_DIR_RX;
> video_dev->release = video_device_release_empty;
> video_dev->fops = &sun6i_csi_capture_fops;
> --
> 2.39.2
>
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-03-25 7:13 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-24 15:12 [PATCH 0/9] media: sun6i-csi/isp: Implement MC I/O support Paul Kocialkowski
2023-03-24 15:12 ` Paul Kocialkowski
2023-03-24 15:12 ` [PATCH 1/9] media: v4l2: Add RGB565X pixel format to v4l2 format info Paul Kocialkowski
2023-03-24 15:12 ` Paul Kocialkowski
2023-03-25 7:06 ` Jernej Škrabec
2023-03-25 7:06 ` Jernej Škrabec
2023-03-25 20:59 ` Laurent Pinchart
2023-03-25 20:59 ` Laurent Pinchart
2023-03-24 15:12 ` [PATCH 2/9] media: v4l2: Add NV12_16L16 " Paul Kocialkowski
2023-03-24 15:12 ` Paul Kocialkowski
2023-03-25 7:06 ` Jernej Škrabec
2023-03-25 7:06 ` Jernej Škrabec
2023-03-25 21:01 ` Laurent Pinchart
2023-03-25 21:01 ` Laurent Pinchart
2023-03-31 18:54 ` Nicolas Dufresne
2023-03-31 18:54 ` Nicolas Dufresne
2023-04-05 4:21 ` Laurent Pinchart
2023-04-05 4:21 ` Laurent Pinchart
2023-04-11 13:03 ` Nicolas Dufresne
2023-04-11 13:03 ` Nicolas Dufresne
2023-04-11 15:30 ` Nicolas Dufresne
2023-04-11 15:30 ` Nicolas Dufresne
2023-03-24 15:12 ` [PATCH 3/9] media: v4l2: Introduce compressed pixel encoding definition and helper Paul Kocialkowski
2023-03-24 15:12 ` Paul Kocialkowski
2023-03-25 7:07 ` Jernej Škrabec
2023-03-25 7:07 ` Jernej Škrabec
2023-03-24 15:12 ` [PATCH 4/9] media: v4l2: Add JPEG pixel format to v4l2 format info Paul Kocialkowski
2023-03-24 15:12 ` Paul Kocialkowski
2023-03-25 7:08 ` Jernej Škrabec
2023-03-25 7:08 ` Jernej Škrabec
2023-03-31 19:07 ` Nicolas Dufresne
2023-03-31 19:07 ` Nicolas Dufresne
2023-03-24 15:12 ` [PATCH 5/9] media: sun6i-csi: capture: Rework and separate format validation Paul Kocialkowski
2023-03-24 15:12 ` Paul Kocialkowski
2023-03-25 7:09 ` Jernej Škrabec
2023-03-25 7:09 ` Jernej Škrabec
2023-03-25 21:24 ` Laurent Pinchart
2023-03-25 21:24 ` Laurent Pinchart
2023-03-24 15:12 ` [PATCH 6/9] media: sun6i-csi: capture: Implement MC I/O with extended enum_fmt Paul Kocialkowski
2023-03-24 15:12 ` Paul Kocialkowski
2023-03-25 7:13 ` Jernej Škrabec [this message]
2023-03-25 7:13 ` Jernej Škrabec
2023-03-25 21:29 ` Laurent Pinchart
2023-03-25 21:29 ` Laurent Pinchart
2023-03-24 15:12 ` [PATCH 7/9] media: sun6i-csi: capture: Implement enum_framesizes Paul Kocialkowski
2023-03-24 15:12 ` Paul Kocialkowski
2023-03-25 7:13 ` Jernej Škrabec
2023-03-25 7:13 ` Jernej Škrabec
2023-03-25 21:33 ` Laurent Pinchart
2023-03-25 21:33 ` Laurent Pinchart
2023-03-24 15:12 ` [PATCH 8/9] media: sun6i-isp: capture: Implement MC I/O with extended enum_fmt Paul Kocialkowski
2023-03-24 15:12 ` Paul Kocialkowski
2023-03-25 7:14 ` Jernej Škrabec
2023-03-25 7:14 ` Jernej Škrabec
2023-03-25 21:42 ` Laurent Pinchart
2023-03-25 21:42 ` Laurent Pinchart
2023-03-24 15:12 ` [PATCH 9/9] media: sun6i-isp: capture: Implement enum_framesizes Paul Kocialkowski
2023-03-24 15:12 ` Paul Kocialkowski
2023-03-25 7:14 ` Jernej Škrabec
2023-03-25 7:14 ` Jernej Škrabec
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=3225394.44csPzL39Z@kista \
--to=jernej.skrabec@gmail.com \
--cc=adam@piggz.co.uk \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=linux-sunxi@lists.linux.dev \
--cc=mchehab@kernel.org \
--cc=paul.kocialkowski@bootlin.com \
--cc=samuel@sholland.org \
--cc=thomas.petazzoni@bootlin.com \
--cc=wens@csie.org \
/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.