All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hverkuil-cisco@xs4all.nl>
To: linux-media@vger.kernel.org
Subject: [PATCH 0/3] vb2: do not allow support_requests + min_buffers_needed
Date: Thu, 29 Jul 2021 15:36:24 +0200	[thread overview]
Message-ID: <20210729133627.1592672-1-hverkuil-cisco@xs4all.nl> (raw)

If the vb2_queue field min_buffers_needed is non-zero, then only
allow that if support_requests is false. Otherwise when a request is
queued and vb2_core_qbuf is called, that function could fail if it
needs to call start_streaming(). There is no way for the request API
to propagate such an error back to userspace, and you really don't
want that either.

If this is ever needed, then an API extension is most likely needed.

Currently there are only two drivers that set this combination of
features: cedrus and vivid.

There is no reason for a non-zero min_buffers_needed in the cedrus
driver, so just drop that.

For the vivid driver a new module option was added that allows the
user to control whether requests are not supported, supported (default)
or required. In the latter two cases min_buffers_needed is set to 0
in the vivid driver.

I would appreciate if someone can verify that the cedrus patch doesn't
break anything since that has only been compile tested.

Regards,

	Hans

Hans Verkuil (3):
  cedrus: drop min_buffers_needed.
  vivid: add module option to set request support mode
  videobuf2-core: sanity checks for requests and qbuf

 .../media/common/videobuf2/videobuf2-core.c   | 23 ++++++++++++++++++-
 drivers/media/test-drivers/vivid/vivid-core.c | 14 +++++++++--
 .../staging/media/sunxi/cedrus/cedrus_video.c |  2 --
 3 files changed, 34 insertions(+), 5 deletions(-)

-- 
2.30.2


             reply	other threads:[~2021-07-29 13:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-29 13:36 Hans Verkuil [this message]
2021-07-29 13:36 ` [PATCH 1/3] cedrus: drop min_buffers_needed Hans Verkuil
2021-07-29 15:05   ` Ezequiel Garcia
2021-07-29 13:36 ` [PATCH 2/3] vivid: add module option to set request support mode Hans Verkuil
2021-07-29 13:36 ` [PATCH 3/3] videobuf2-core: sanity checks for requests and qbuf Hans Verkuil
2021-07-29 15:08   ` Ezequiel Garcia

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=20210729133627.1592672-1-hverkuil-cisco@xs4all.nl \
    --to=hverkuil-cisco@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --subject='Re: [PATCH 0/3] vb2: do not allow support_requests + min_buffers_needed' \
    /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

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.