public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: "Cao, Bingbu" <bingbu.cao@intel.com>,
	Claus Stovgaard <claus.stovgaard@gmail.com>,
	Bingbu Cao <bingbu.cao@linux.intel.com>,
	"linux-media@vger.kernel.org" <linux-media@vger.kernel.org>,
	"sakari.ailus@linux.intel.com" <sakari.ailus@linux.intel.com>,
	"ilpo.jarvinen@linux.intel.com" <ilpo.jarvinen@linux.intel.com>,
	"tfiga@chromium.org" <tfiga@chromium.org>,
	"senozhatsky@chromium.org" <senozhatsky@chromium.org>,
	"andriy.shevchenko@linux.intel.com" 
	<andriy.shevchenko@linux.intel.com>,
	"tomi.valkeinen@ideasonboard.com"
	<tomi.valkeinen@ideasonboard.com>,
	"Qiu, Tian Shu" <tian.shu.qiu@intel.com>,
	"Wang, Hongju" <hongju.wang@intel.com>
Subject: Re: [PATCH 00/15] Intel IPU6 and IPU6 input system drivers
Date: Mon, 2 Oct 2023 20:38:41 +0300	[thread overview]
Message-ID: <20231002173841.GD10113@pendragon.ideasonboard.com> (raw)
In-Reply-To: <bc4a6204-6487-9403-243d-6f0a1b20e8ab@redhat.com>

On Mon, Oct 02, 2023 at 07:19:13PM +0200, Hans de Goede wrote:
> Hi,
> 
> On 9/4/23 05:13, Cao, Bingbu wrote:
> > Hans,
> > 
> > Thanks for your test and report.
> > 
> > I have made some changes locally which will support the latest
> > v4l2-async APIs, I will also add the fix for this issue and merge
> > them in v3.
> 
> I have been trying to make rawbayer capture with the mainline isys code
> work in libcamera and I have hit several short comings in the ipu6-isys
> code. I have attached 3 patches to fix various issues please integrate
> these into the next version of this series.

They look good to me.

> Talking about the next version of this series, I think it would be
> good to post a new version soon ?
> 

> From 14f42fd3071a7aba8b83b98802ca3b413794296d Mon Sep 17 00:00:00 2001
> From: Hans de Goede <hdegoede@redhat.com>
> Date: Mon, 2 Oct 2023 16:37:11 +0200
> Subject: [PATCH 1/3] media: intel/ipu6: Add mbus code filtering to isys
>  /dev/video enum_fmt
> 
> Add mbus code filtering to ipu6_isys_vidioc_enum_fmt().
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  .../media/pci/intel/ipu6/ipu6-isys-video.c    | 29 +++++++++++++++----
>  1 file changed, 23 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/media/pci/intel/ipu6/ipu6-isys-video.c b/drivers/media/pci/intel/ipu6/ipu6-isys-video.c
> index dc1605491352..20fd03f6f204 100644
> --- a/drivers/media/pci/intel/ipu6/ipu6-isys-video.c
> +++ b/drivers/media/pci/intel/ipu6/ipu6-isys-video.c
> @@ -130,14 +130,31 @@ int ipu6_isys_vidioc_querycap(struct file *file, void *fh,
>  int ipu6_isys_vidioc_enum_fmt(struct file *file, void *fh,
>  			      struct v4l2_fmtdesc *f)
>  {
> -	if (f->index >= ARRAY_SIZE(ipu6_isys_pfmts))
> -		return -EINVAL;
> +	unsigned int i, found = 0;
>  
> -	f->flags = 0;
> -	f->pixelformat = ipu6_isys_pfmts[f->index].pixelformat;
> -	f->mbus_code = ipu6_isys_pfmts[f->index].code;
> +	if (!f->mbus_code) {
> +		if (f->index >= ARRAY_SIZE(ipu6_isys_pfmts))
> +			return -EINVAL;
>  
> -	return 0;
> +		f->flags = 0;
> +		f->pixelformat = ipu6_isys_pfmts[f->index].pixelformat;
> +		f->mbus_code = ipu6_isys_pfmts[f->index].code;
> +	}
> +
> +	for (i = 0; i < ARRAY_SIZE(ipu6_isys_pfmts); i++) {
> +		if (f->mbus_code != ipu6_isys_pfmts[i].code)
> +			continue;
> +
> +		if (f->index == found) {
> +			f->flags = 0;
> +			f->pixelformat = ipu6_isys_pfmts[i].pixelformat;
> +			return 0;
> +		}
> +
> +		found++;
> +	}
> +
> +	return -EINVAL;
>  }
>  
>  static int vidioc_g_fmt_vid_cap_mplane(struct file *file, void *fh,
> -- 
> 2.41.0
> 

> From 8250d2c3fd1c2ab83debcca80b4947d3b9d410f7 Mon Sep 17 00:00:00 2001
> From: Hans de Goede <hdegoede@redhat.com>
> Date: Mon, 2 Oct 2023 17:02:06 +0200
> Subject: [PATCH 2/3] media: intel/ipu6: Implement g_enum_framesizes for isys
>  /dev/video# nodes
> 
> Implement g_enum_framesizes for isys /dev/video# nodes.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/media/pci/intel/ipu6/ipu6-isys-video.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
> 
> diff --git a/drivers/media/pci/intel/ipu6/ipu6-isys-video.c b/drivers/media/pci/intel/ipu6/ipu6-isys-video.c
> index 20fd03f6f204..ad74a19527b7 100644
> --- a/drivers/media/pci/intel/ipu6/ipu6-isys-video.c
> +++ b/drivers/media/pci/intel/ipu6/ipu6-isys-video.c
> @@ -157,6 +157,23 @@ int ipu6_isys_vidioc_enum_fmt(struct file *file, void *fh,
>  	return -EINVAL;
>  }
>  
> +static int ipu6_isys_vidioc_g_enum_framesizes(struct file *file, void *fh,
> +					      struct v4l2_frmsizeenum *fsize)
> +{
> +	if (fsize->index > 0)
> +		return -EINVAL;
> +
> +	fsize->type = V4L2_FRMSIZE_TYPE_CONTINUOUS;
> +	fsize->stepwise.min_width = IPU6_ISYS_MIN_WIDTH;
> +	fsize->stepwise.max_width = IPU6_ISYS_MAX_WIDTH;
> +	fsize->stepwise.min_height = IPU6_ISYS_MIN_HEIGHT;
> +	fsize->stepwise.max_height = IPU6_ISYS_MAX_HEIGHT;
> +	fsize->stepwise.step_width = 1;
> +	fsize->stepwise.step_height = 1;
> +
> +	return 0;
> +}
> +
>  static int vidioc_g_fmt_vid_cap_mplane(struct file *file, void *fh,
>  				       struct v4l2_format *fmt)
>  {
> @@ -987,6 +1004,7 @@ int ipu6_isys_video_set_streaming(struct ipu6_isys_video *av, int state,
>  static const struct v4l2_ioctl_ops ioctl_ops_mplane = {
>  	.vidioc_querycap = ipu6_isys_vidioc_querycap,
>  	.vidioc_enum_fmt_vid_cap = ipu6_isys_vidioc_enum_fmt,
> +	.vidioc_enum_framesizes = ipu6_isys_vidioc_g_enum_framesizes,
>  	.vidioc_g_fmt_vid_cap_mplane = vidioc_g_fmt_vid_cap_mplane,
>  	.vidioc_s_fmt_vid_cap_mplane = vidioc_s_fmt_vid_cap_mplane,
>  	.vidioc_try_fmt_vid_cap_mplane = vidioc_try_fmt_vid_cap_mplane,
> -- 
> 2.41.0
> 

> From b5db94bbd147711885986c1f6e46f59fdca10d3c Mon Sep 17 00:00:00 2001
> From: Hans de Goede <hdegoede@redhat.com>
> Date: Mon, 2 Oct 2023 16:05:35 +0200
> Subject: [PATCH 3/3] media: intel/ipu6: Set V4L2_CAP_IO_MC flag for isys
>  /dev/video# nodes
> 
> The IPU6 isys is a media-controller centric device which needs
> the pipeline to be configured using the media controller API before use.
> 
> Set the V4L2_CAP_IO_MC flag to reflect this.
> 
> This also allows dropping of the enum_input() g_input() and s_input()
> implementations, with V4L2_CAP_IO_MC set the v4l2-core will take care
> of those.
> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  .../media/pci/intel/ipu6/ipu6-isys-video.c    | 29 ++-----------------
>  1 file changed, 2 insertions(+), 27 deletions(-)
> 
> diff --git a/drivers/media/pci/intel/ipu6/ipu6-isys-video.c b/drivers/media/pci/intel/ipu6/ipu6-isys-video.c
> index ad74a19527b7..e6fc32603c3f 100644
> --- a/drivers/media/pci/intel/ipu6/ipu6-isys-video.c
> +++ b/drivers/media/pci/intel/ipu6/ipu6-isys-video.c
> @@ -262,29 +262,6 @@ static int vidioc_try_fmt_vid_cap_mplane(struct file *file, void *fh,
>  	return 0;
>  }
>  
> -static int vidioc_enum_input(struct file *file, void *fh,
> -			     struct v4l2_input *input)
> -{
> -	if (input->index > 0)
> -		return -EINVAL;
> -	strscpy(input->name, "camera", sizeof(input->name));
> -	input->type = V4L2_INPUT_TYPE_CAMERA;
> -
> -	return 0;
> -}
> -
> -static int vidioc_g_input(struct file *file, void *fh, unsigned int *input)
> -{
> -	*input = 0;
> -
> -	return 0;
> -}
> -
> -static int vidioc_s_input(struct file *file, void *fh, unsigned int input)
> -{
> -	return input == 0 ? 0 : -EINVAL;
> -}
> -
>  static int link_validate(struct media_link *link)
>  {
>  	struct ipu6_isys_video *av =
> @@ -1017,9 +994,6 @@ static const struct v4l2_ioctl_ops ioctl_ops_mplane = {
>  	.vidioc_streamon = vb2_ioctl_streamon,
>  	.vidioc_streamoff = vb2_ioctl_streamoff,
>  	.vidioc_expbuf = vb2_ioctl_expbuf,
> -	.vidioc_enum_input = vidioc_enum_input,
> -	.vidioc_g_input = vidioc_g_input,
> -	.vidioc_s_input = vidioc_s_input,
>  };
>  
>  static const struct media_entity_operations entity_ops = {
> @@ -1217,7 +1191,8 @@ int ipu6_isys_video_init(struct ipu6_isys_video *av)
>  
>  	mutex_init(&av->mutex);
>  	av->vdev.device_caps = V4L2_CAP_STREAMING |
> -			       V4L2_CAP_VIDEO_CAPTURE_MPLANE;
> +			       V4L2_CAP_VIDEO_CAPTURE_MPLANE |
> +			       V4L2_CAP_IO_MC;
>  	av->vdev.vfl_dir = VFL_DIR_RX;
>  
>  	ret = ipu6_isys_queue_init(&av->aq);
> -- 
> 2.41.0
> 


-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2023-10-02 17:38 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-27  7:15 [PATCH 00/15] Intel IPU6 and IPU6 input system drivers bingbu.cao
2023-07-27  7:15 ` [PATCH 01/15] media: intel/ipu6: add Intel IPU6 PCI device driver bingbu.cao
2023-07-27 10:47   ` Andy Shevchenko
2023-10-03 10:12   ` Andreas Helbech Kleist
2023-10-16  9:39     ` Andreas Helbech Kleist
2023-10-19  8:23       ` Bingbu Cao
2023-10-20 10:48         ` Andreas Helbech Kleist
2023-10-20 10:48         ` Andreas Helbech Kleist
2023-07-27  7:15 ` [PATCH 02/15] media: intel/ipu6: add IPU auxiliary devices bingbu.cao
2023-10-03 10:13   ` Andreas Helbech Kleist
2023-10-19  8:24     ` Bingbu Cao
2023-07-27  7:15 ` [PATCH 03/15] media: intel/ipu6: add IPU6 buttress interface driver bingbu.cao
2023-07-27  7:15 ` [PATCH 04/15] media: intel/ipu6: CPD parsing for get firmware components bingbu.cao
2023-07-27  7:15 ` [PATCH 05/15] media: intel/ipu6: add IPU6 DMA mapping API and MMU table bingbu.cao
2023-07-27  7:15 ` [PATCH 06/15] media: intel/ipu6: add syscom interfaces between firmware and driver bingbu.cao
2023-07-27  7:15 ` [PATCH 07/15] media: intel/ipu6: input system ABI " bingbu.cao
2023-07-27  7:15 ` [PATCH 08/15] media: intel/ipu6: add IPU6 CSI2 receiver v4l2 sub-device bingbu.cao
2023-07-27  7:15 ` [PATCH 09/15] media: intel/ipu6: add the CSI2 DPHY implementation bingbu.cao
2023-07-27  7:15 ` [PATCH 10/15] media: intel/ipu6: add input system driver bingbu.cao
2023-10-03 10:13   ` Andreas Helbech Kleist
2023-10-19  8:28     ` Bingbu Cao
2023-10-19 12:22       ` Andy Shevchenko
2023-10-20  2:21         ` Cao, Bingbu
2023-10-20 10:20           ` Andy Shevchenko
2023-10-20 10:47       ` Andreas Helbech Kleist
2023-10-20 14:39         ` Hans de Goede
2023-10-23  6:23           ` Andreas Helbech Kleist
2023-10-23  7:44             ` Hans de Goede
2023-10-23  8:23               ` Bingbu Cao
2023-10-23 11:29               ` Andy Shevchenko
2023-12-20 12:53               ` RFC: Intel IPU4 driver proof of concept Andreas Helbech Kleist
2026-02-22 19:57                 ` Ruslan Bay
2026-03-04 11:03                   ` Ruslan Bay
2026-03-04 12:16                     ` johannes.goede
2023-10-23 11:29             ` [PATCH 10/15] media: intel/ipu6: add input system driver Andy Shevchenko
2023-07-27  7:15 ` [PATCH 11/15] media: intel/ipu6: input system video capture nodes bingbu.cao
2023-10-23 11:36   ` Andreas Helbech Kleist
2023-12-07  9:28   ` Andreas Helbech Kleist
2023-12-20  3:42   ` Bingbu Cao
2023-12-20  6:51     ` Laurent Pinchart
2023-12-20  9:25       ` Bingbu Cao
2023-07-27  7:15 ` [PATCH 12/15] media: add Kconfig and Makefile for IPU6 bingbu.cao
2023-10-03 10:13   ` Andreas Helbech Kleist
2023-10-19  8:28     ` Bingbu Cao
2023-07-27  7:15 ` [PATCH 13/15] MAINTAINERS: add maintainers for Intel IPU6 input system driver bingbu.cao
2023-07-27 10:19   ` Andy Shevchenko
2023-07-27  7:15 ` [PATCH 14/15] Documentation: add Intel IPU6 ISYS driver admin-guide doc bingbu.cao
2023-07-27  7:15 ` [PATCH 15/15] Documentation: add documentation of Intel IPU6 driver and hardware overview bingbu.cao
2023-08-20 15:09 ` [PATCH 00/15] Intel IPU6 and IPU6 input system drivers Claus Stovgaard
2023-08-21  3:14   ` Bingbu Cao
2023-08-21  6:22     ` Bingbu Cao
2023-08-21  6:55       ` Claus Stovgaard
2023-08-21 10:07         ` Claus Stovgaard
2023-08-21 12:19           ` Laurent Pinchart
2023-08-22 12:52             ` claus.stovgaard
2023-08-22 14:22               ` Laurent Pinchart
2023-08-24 20:35                 ` Claus Stovgaard
2023-08-22  3:05           ` Bingbu Cao
2023-08-24 20:19             ` Claus Stovgaard
2023-08-31 21:24           ` Hans de Goede
2023-09-02 14:54             ` Hans de Goede
2023-09-03 14:32               ` Hans de Goede
2023-09-04  3:13                 ` Cao, Bingbu
2023-09-04  7:35                   ` Hans de Goede
2023-10-02 17:19                   ` Hans de Goede
2023-10-02 17:38                     ` Laurent Pinchart [this message]
2023-10-02 17:41                       ` Hans de Goede
2023-10-09  6:23                         ` Bingbu Cao
2023-10-09 12:25                         ` Bingbu Cao
2023-10-09 12:53                           ` Hans de Goede
2023-10-10  2:54                             ` Bingbu Cao
2023-10-10  8:10                               ` Hans de Goede
2023-10-10  8:35                                 ` Bingbu Cao
2023-09-04  6:12                 ` Bingbu Cao
2023-09-04  9:16                   ` Andy Shevchenko
2023-09-19 10:23                   ` Hans de Goede
2023-09-20  4:46                     ` Bingbu Cao
2023-09-20  8:52                       ` Hans de Goede
2023-09-20 12:32                         ` Claus Stovgaard

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=20231002173841.GD10113@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bingbu.cao@intel.com \
    --cc=bingbu.cao@linux.intel.com \
    --cc=claus.stovgaard@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=hongju.wang@intel.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-media@vger.kernel.org \
    --cc=sakari.ailus@linux.intel.com \
    --cc=senozhatsky@chromium.org \
    --cc=tfiga@chromium.org \
    --cc=tian.shu.qiu@intel.com \
    --cc=tomi.valkeinen@ideasonboard.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