All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Corbet <corbet@lwn.net>
To: Marek Szyprowski <m.szyprowski@samsung.com>
Cc: linux-media@vger.kernel.org,
	"'Kyungmin Park'" <kyungmin.park@samsung.com>,
	"'Pawel Osciak'" <pawel@osciak.com>,
	"'Uwe Kleine-König'" <u.kleine-koenig@pengutronix.de>,
	"'Hans Verkuil'" <hverkuil@xs4all.nl>,
	"'Marin Mitov'" <mitov@issp.bas.bg>,
	"'Laurent Pinchart'" <laurent.pinchart@ideasonboard.com>,
	"'Guennadi Liakhovetski'" <g.liakhovetski@gmx.de>,
	"Sylwester Nawrocki" <s.nawrocki@samsung.com>
Subject: Re: [PATCH/RFC] media: vb2: change queue initialization order
Date: Thu, 30 Jun 2011 16:18:03 -0600	[thread overview]
Message-ID: <20110630161803.04e1db20@bike.lwn.net> (raw)
In-Reply-To: <003501cc3666$5725a230$0570e690$%szyprowski@samsung.com>

On Wed, 29 Jun 2011 16:10:45 +0200
Marek Szyprowski <m.szyprowski@samsung.com> wrote:

> > I do still wonder why this is an issue - why not pass the buffers through
> > to the driver at VIDIOC_QBUF time?  I assume there must be a reason for
> > doing things this way, I'd like to understand what it is.  
> 
> I want to delay giving the ownership of the buffers to the driver until it
> is certain that start_streaming method will be called. This way I achieve
> a well defined states of the queued buffers:
> 
> 1. successful start_streaming() -> the driver is processing the queue buffers
> 2. unsuccessful start_streaming() -> the driver is responsible to discard all
>    queued buffers
> 3. stop_streaming() called -> the driver has finished or discarded all queued
>    buffers

So it's a buffer ownership thing.  I wonder if there would be value in
adding a buf_give_them_all_back_now() callback?  You have an implicit
change of buffer ownership now that seems easy for drivers to mess up.  It
might be better to send an explicit signal at such times and, perhaps,
even require the driver to explicitly hand each buffer back to vb2?  That
would make the rules clear and give some flexibility - stopping and
starting streaming without needing to start over with buffers, for example.

Dunno, I'm just sort of babbling as I think; what's there now clearly
works.

Thanks,

jon

  reply	other threads:[~2011-06-30 22:18 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-29  9:49 [PATCH/RFC] media: vb2: change queue initialization order Marek Szyprowski
2011-06-29 10:44 ` Laurent Pinchart
2011-06-29 10:55   ` Marek Szyprowski
2011-06-29 11:01   ` Hans Verkuil
2011-06-29 11:28     ` Marek Szyprowski
2011-06-29 11:15 ` Hans Verkuil
2011-06-29 11:26   ` Marek Szyprowski
2011-06-29 13:26 ` Jonathan Corbet
2011-06-29 14:10   ` Marek Szyprowski
2011-06-30 22:18     ` Jonathan Corbet [this message]
2011-07-06 14:06       ` Marek Szyprowski
2011-07-25  1:53       ` Pawel Osciak
2011-08-23 10:11 ` Hans Verkuil
2011-08-23 10:14   ` Marek Szyprowski
2011-08-23 13:22     ` Hans Verkuil

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=20110630161803.04e1db20@bike.lwn.net \
    --to=corbet@lwn.net \
    --cc=g.liakhovetski@gmx.de \
    --cc=hverkuil@xs4all.nl \
    --cc=kyungmin.park@samsung.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mitov@issp.bas.bg \
    --cc=pawel@osciak.com \
    --cc=s.nawrocki@samsung.com \
    --cc=u.kleine-koenig@pengutronix.de \
    /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.