linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gustavo Padovan <gustavo@padovan.org>
To: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Cc: linux-media@vger.kernel.org, Hans Verkuil <hverkuil@xs4all.nl>,
	Shuah Khan <shuahkh@osg.samsung.com>,
	Pawel Osciak <pawel@osciak.com>,
	Alexandre Courbot <acourbot@chromium.org>,
	Sakari Ailus <sakari.ailus@iki.fi>,
	Brian Starkey <brian.starkey@arm.com>,
	Thierry Escande <thierry.escande@collabora.com>,
	linux-kernel@vger.kernel.org,
	Gustavo Padovan <gustavo.padovan@collabora.com>
Subject: Re: [PATCH v6 1/6] [media] vb2: add is_unordered callback for drivers
Date: Thu, 21 Dec 2017 18:32:03 -0200	[thread overview]
Message-ID: <20171221203203.GB12003@jade> (raw)
In-Reply-To: <20171221165128.31e16dc4@vento.lan>

2017-12-21 Mauro Carvalho Chehab <mchehab@osg.samsung.com>:

> Em Mon, 11 Dec 2017 16:27:36 -0200
> Gustavo Padovan <gustavo@padovan.org> escreveu:
> 
> > From: Gustavo Padovan <gustavo.padovan@collabora.com>
> > 
> > Explicit synchronization benefits a lot from ordered queues, they fit
> > better in a pipeline with DRM for example so create a opt-in way for
> > drivers notify videobuf2 that the queue is unordered.
> > 
> > Drivers don't need implement it if the queue is ordered.
> > 
> > Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com>
> > ---
> >  include/media/videobuf2-core.h | 5 +++++
> >  1 file changed, 5 insertions(+)
> > 
> > diff --git a/include/media/videobuf2-core.h b/include/media/videobuf2-core.h
> > index ef9b64398c8c..eddb38a2a2f3 100644
> > --- a/include/media/videobuf2-core.h
> > +++ b/include/media/videobuf2-core.h
> > @@ -368,6 +368,9 @@ struct vb2_buffer {
> >   *			callback by calling vb2_buffer_done() with either
> >   *			%VB2_BUF_STATE_DONE or %VB2_BUF_STATE_ERROR; may use
> >   *			vb2_wait_for_all_buffers() function
> > + * @is_unordered:	tell if the queue format is unordered. The default is
> > + *			assumed to be ordered and this function only needs to
> > + *			be implemented for unordered queues.
> >   * @buf_queue:		passes buffer vb to the driver; driver may start
> >   *			hardware operation on this buffer; driver should give
> >   *			the buffer back by calling vb2_buffer_done() function;
> > @@ -391,6 +394,7 @@ struct vb2_ops {
> >  
> >  	int (*start_streaming)(struct vb2_queue *q, unsigned int count);
> >  	void (*stop_streaming)(struct vb2_queue *q);
> > +	int (*is_unordered)(struct vb2_queue *q);
> >  
> >  	void (*buf_queue)(struct vb2_buffer *vb);
> >  };
> > @@ -564,6 +568,7 @@ struct vb2_queue {
> >  	u32				cnt_wait_finish;
> >  	u32				cnt_start_streaming;
> >  	u32				cnt_stop_streaming;
> > +	u32				cnt_is_unordered;
> 
> If I understand, this is just a bit, right?
> 
> if so, better to declare it as:
> 
> 	u32				cnt_is_unordered : 1;

no, is_unordered() is a vb2 callback to ask drivers if their current
queue is not ordered and cnt_is_unordered is the counter of how many
times this callback was called. This happens for all vb2 callbacks, see
the other counters above, so I decided to add one for is_unordered() as
well.

Gustavo

  reply	other threads:[~2017-12-21 20:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-11 18:27 [PATCH v6 0/6] V4L2 Explicit Synchronization Gustavo Padovan
2017-12-11 18:27 ` [PATCH v6 1/6] [media] vb2: add is_unordered callback for drivers Gustavo Padovan
2017-12-21 18:51   ` Mauro Carvalho Chehab
2017-12-21 20:32     ` Gustavo Padovan [this message]
2017-12-11 18:27 ` [PATCH v6 2/6] [media] v4l: add 'unordered' flag to format description ioctl Gustavo Padovan
2017-12-21 18:17   ` Mauro Carvalho Chehab
2017-12-11 18:27 ` [PATCH v6 3/6] [media] vb2: add explicit fence user API Gustavo Padovan
2017-12-21 18:52   ` Mauro Carvalho Chehab
2017-12-21 20:36     ` Gustavo Padovan
2017-12-11 18:27 ` [PATCH v6 4/6] [media] vb2: add in-fence support to QBUF Gustavo Padovan
2017-12-21 18:57   ` Mauro Carvalho Chehab
2017-12-21 20:41     ` Gustavo Padovan
2017-12-11 18:27 ` [PATCH v6 5/6] [media] vb2: add out-fence " Gustavo Padovan
2017-12-11 18:27 ` [PATCH v6 6/6] [media] v4l: Document explicit synchronization behavior Gustavo Padovan
2017-12-21 18:49 ` [PATCH v6 0/6] V4L2 Explicit Synchronization Mauro Carvalho Chehab
2017-12-21 19:07   ` Mauro Carvalho Chehab
2017-12-21 20:28   ` Gustavo Padovan

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=20171221203203.GB12003@jade \
    --to=gustavo@padovan.org \
    --cc=acourbot@chromium.org \
    --cc=brian.starkey@arm.com \
    --cc=gustavo.padovan@collabora.com \
    --cc=hverkuil@xs4all.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@osg.samsung.com \
    --cc=pawel@osciak.com \
    --cc=sakari.ailus@iki.fi \
    --cc=shuahkh@osg.samsung.com \
    --cc=thierry.escande@collabora.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;
as well as URLs for NNTP newsgroup(s).