Hi Bingbu, On Wed, Dec 20, 2023 at 11:42:47AM +0800, Bingbu Cao wrote: > On 7/27/23 3:15 PM, bingbu.cao@xxxxxxxxx wrote: > > From: Bingbu Cao <bingbu.cao@xxxxxxxxx> > > > > Register v4l2 video device and setup the vb2 queue to > > support basic video capture. Video streaming callback > > will trigger the input system driver to construct a > > input system stream configuration for firmware based on > > data type and stream ID and then queue buffers to firmware > > to do capture. > > > > Signed-off-by: Bingbu Cao <bingbu.cao@xxxxxxxxx> > > --- > > .../media/pci/intel/ipu6/ipu6-isys-queue.c | 864 ++++++++++++ > > .../media/pci/intel/ipu6/ipu6-isys-queue.h | 97 ++ > > .../media/pci/intel/ipu6/ipu6-isys-video.c | 1237 +++++++++++++++++ > > .../media/pci/intel/ipu6/ipu6-isys-video.h | 133 ++ > > 4 files changed, 2331 insertions(+) > > create mode 100644 drivers/media/pci/intel/ipu6/ipu6-isys-queue.c > > create mode 100644 drivers/media/pci/intel/ipu6/ipu6-isys-queue.h > > create mode 100644 drivers/media/pci/intel/ipu6/ipu6-isys-video.c > > create mode 100644 drivers/media/pci/intel/ipu6/ipu6-isys-video.h > > > > diff --git a/drivers/media/pci/intel/ipu6/ipu6-isys-queue.c b/drivers/media/pci/intel/ipu6/ipu6-isys-queue.c > > new file mode 100644 > > index 000000000000..c683a1b7c91f > --snip-- > > > +static const struct vb2_ops ipu6_isys_queue_ops = { > > + .queue_setup = queue_setup, > > + .wait_prepare = vb2_ops_wait_prepare, > > + .wait_finish = vb2_ops_wait_finish, > > + .buf_prepare = buf_prepare, > > + .start_streaming = start_streaming, > > + .stop_streaming = stop_streaming, > > + .buf_queue = buf_queue, > > +}; > > + > > +int ipu6_isys_queue_init(struct ipu6_isys_queue *aq) > > +{ > > + struct ipu6_isys *isys = ipu6_isys_queue_to_video(aq)->isys; > > + struct ipu6_isys_video *av = ipu6_isys_queue_to_video(aq); > > + int ret; > > + > > + /* no support for userptr */ > > + if (!aq->vbq.io_modes) > > + aq->vbq.io_modes = VB2_MMAP | VB2_DMABUF; > > > There are some improvement and bug fixing in vb2 USERPTR in the past > months, I remember someone told me the userptr is buggy, I remove the > USERPTR support from current IPU6 ISYS driver. However, there is some > userspace application still need the USERPTR, so I am not sure whether > I should add it back. Do you have any suggestion? Modern applications should really not use USERPTR, so I wouldn't add it back. It's still a deprecated interface. In the vast majority of cases, the PSYS will be used through libcamera, which doesn't use USERPTR. I expect the remaining use cases to be very specialized and not rely on pre-existing code that would require USERPTR. -- Regards, Laurent Pinchart