Linux Media Controller development
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Cc: linux-media@vger.kernel.org, Eugen Hristev <eugen.hristev@microchip.com>
Subject: Re: [PATCH 0/2] vb2: add (un)prepare_streaming vb2_queue ops
Date: Wed, 22 Jun 2022 12:44:12 +0300	[thread overview]
Message-ID: <YrLkbMZYb/Jpdidv@pendragon.ideasonboard.com> (raw)
In-Reply-To: <20220622093145.927377-1-hverkuil-cisco@xs4all.nl>

Hi Hans,

On Wed, Jun 22, 2022 at 11:31:43AM +0200, Hans Verkuil wrote:
> Add support for two new (un)prepare_streaming queue ops that are called
> when the user calls VIDIOC_STREAMON and STREAMOFF (or closes the fh).
> 
> This gives drivers a callback to validate the video pipeline and claim
> or release streaming resources at the time that userspace indicates
> that it wants to start streaming (VIDIOC_STREAMON) rather than when
> the actual DMA engine kicks in (the start_streaming callback). This
> is relevant for drivers that needs a minimum of X buffers before the
> DMA can start. The actual pipeline validation needs to happen sooner
> to avoid unnecessary errors at VIDIOC_QBUF time.
> 
> As a bonus this allows us to move the horrible call to
> v4l_vb2q_enable_media_source() in vb2_core_streamon() to the au0828
> driver (currently the only driver that uses this feature).

Can we drop the horrible .enable_source() from media_device too ? :-)

> That call never belonged in vb2, but it had the same purpose as the
> new prepare_streaming op: validate the pipeline.
> 
> This is a follow-up from my previous RFCv2:
> 
> https://patchwork.linuxtv.org/project/linux-media/patch/ba4bca14-488f-94ea-48d9-e7343103c5aa@xs4all.nl/
> 
> I would like to get consensus for this series.

I don't like it much. vb2 is already doing too much in my opinion,
growing it isn't the right way to fix it.

I'm still working on a new version of the V4L2 streams series that may
conflict with this, I'd propose discussing the two together.

> Hans Verkuil (2):
>   vb2: add (un)prepare_streaming queue ops
>   vb2/au0828: move the v4l_vb2q_enable_media_source to the au0828 driver
> 
>  .../media/common/videobuf2/videobuf2-core.c   | 26 ++++++++++++++-----
>  drivers/media/usb/au0828/au0828-vbi.c         |  2 ++
>  drivers/media/usb/au0828/au0828-video.c       |  1 +
>  include/media/videobuf2-core.h                | 14 ++++++++++
>  4 files changed, 37 insertions(+), 6 deletions(-)

-- 
Regards,

Laurent Pinchart

  parent reply	other threads:[~2022-06-22  9:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-22  9:31 [PATCH 0/2] vb2: add (un)prepare_streaming vb2_queue ops Hans Verkuil
2022-06-22  9:31 ` [PATCH 1/2] vb2: add (un)prepare_streaming queue ops Hans Verkuil
2022-06-22  9:31 ` [PATCH 2/2] vb2/au0828: move the v4l_vb2q_enable_media_source to the au0828 driver Hans Verkuil
2022-06-22  9:44 ` Laurent Pinchart [this message]
2022-06-22 10:00   ` [PATCH 0/2] vb2: add (un)prepare_streaming vb2_queue ops Hans Verkuil
2022-06-22 10:08     ` Laurent Pinchart
2022-11-04  9:46       ` Hans Verkuil
2022-11-04 10:57         ` Eugen.Hristev
2022-06-22 10:23     ` Eugen.Hristev

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=YrLkbMZYb/Jpdidv@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=eugen.hristev@microchip.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=linux-media@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox