LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Brian Starkey <brian.starkey@arm.com>
To: Gustavo Padovan <gustavo.padovan@collabora.com>
Cc: Hans Verkuil <hverkuil@xs4all.nl>,
	Ezequiel Garcia <ezequiel@collabora.com>,
	linux-media@vger.kernel.org, kernel@collabora.com,
	Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
	Shuah Khan <shuahkh@osg.samsung.com>,
	Pawel Osciak <pawel@osciak.com>,
	Alexandre Courbot <acourbot@chromium.org>,
	Sakari Ailus <sakari.ailus@iki.fi>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v9 11/15] vb2: add in-fence support to QBUF
Date: Wed, 9 May 2018 11:35:05 +0100	[thread overview]
Message-ID: <20180509103504.GB39838@e107564-lin.cambridge.arm.com> (raw)
In-Reply-To: <1525821486.1445.17.camel@collabora.com>

Hi,

On Tue, May 08, 2018 at 08:18:06PM -0300, Gustavo Padovan wrote:
>
>Hi Hans,
>
>On Mon, 2018-05-07 at 14:07 +0200, Hans Verkuil wrote:
>> On 04/05/18 22:06, Ezequiel Garcia wrote:
>> > From: Gustavo Padovan <gustavo.padovan@collabora.com>

[snip]

>> > diff --git a/include/media/videobuf2-core.h
>> > b/include/media/videobuf2-core.h
>> > index 364e4cb41b10..28ce8f66882e 100644
>> > --- a/include/media/videobuf2-core.h
>> > +++ b/include/media/videobuf2-core.h
>> > @@ -17,6 +17,7 @@
>> >  #include <linux/poll.h>
>> >  #include <linux/dma-buf.h>
>> >  #include <linux/bitops.h>
>> > +#include <linux/dma-fence.h>
>> >
>> >  #define VB2_MAX_FRAME	(32)
>> >  #define VB2_MAX_PLANES	(8)
>> > @@ -255,12 +256,21 @@ struct vb2_buffer {
>> >  	 * done_entry:		entry on the list that
>> > stores all buffers ready
>> >  	 *			to be dequeued to userspace
>> >  	 * vb2_plane:		per-plane information; do not
>> > change
>> > +	 * in_fence:		fence received from vb2 client
>> > to wait on before
>> > +	 *			using the buffer (queueing to
>> > the driver)
>> > +	 * fence_cb:		fence callback information
>> > +	 * fence_cb_lock:	protect callback signal/remove
>> >  	 */
>> >  	enum vb2_buffer_state	state;
>> >
>> >  	struct vb2_plane	planes[VB2_MAX_PLANES];
>> >  	struct list_head	queued_entry;
>> >  	struct list_head	done_entry;
>> > +
>> > +	struct dma_fence	*in_fence;
>> > +	struct dma_fence_cb	fence_cb;
>> > +	spinlock_t              fence_cb_lock;
>> > +
>>
>> So for the _MPLANE formats this is one fence for all planes. Which
>> makes sense, but how
>> does drm handle that? Also one fence for all planes?
>
>Yes, this is one fence for all planes.
>
>The DRM concept for planes is a totally different concept and is
>basically a representation of an user definable square on the screen,
>and to that plane there in one framebuffer attached - display hw has no
>such a multiplanar for the same image AFAICT. So you probably need some
>blit to convert the v4l2 multiplanar to a DRM framebuffer.
>

Lots of display hardware can do multi-planar formats, and there's
space in struct drm_framebuffer for up to 4 buffer handles (e.g. 3
handles are passed for Luma, Cr, and Cb when the framebuffer format is
DRM_FORMAT_YUV420) - like V4L2 MPLANE.

The V4L2 code here matches with the DRM "explicit sync"
(IN_FENCE_FD/OUT_FENCE_PTR) stuff, which is probably what we want.
The main difference is that in DRM, explicit fences aren't associated
with framebuffers, they're associated with the things using the
framebuffers - but practically it doesn't make a difference.

There can be per-buffer "implicit sync" via dma-buf reservation
objects, but I don't think this series should attempt to deal with
that.

Cheers,
-Brian

>>
>> I think there should be a comment about this somewhere.
>
>Yes, we've been over this exact discussion a few times :)
>Having entirely different things with the same name is quite confusing.
>
>Regards,
>
>Gustavo
>
>-- 
>Gustavo Padovan
>Principal Software Engineer
>Collabora Ltd.

  reply	other threads:[~2018-05-09 10:35 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-04 20:05 [PATCH v9 00/15] V4L2 Explicit Synchronization Ezequiel Garcia
2018-05-04 20:05 ` [PATCH v9 01/15] xilinx: regroup caps on querycap Ezequiel Garcia
2018-05-04 20:05 ` [PATCH v9 02/15] hackrf: group device capabilities Ezequiel Garcia
2018-05-04 20:06 ` [PATCH v9 03/15] omap3isp: " Ezequiel Garcia
2018-05-04 20:06 ` [PATCH v9 04/15] vb2: move vb2_ops functions to videobuf2-core.[ch] Ezequiel Garcia
2018-05-04 20:06 ` [PATCH v9 05/15] vb2: add unordered vb2_queue property for drivers Ezequiel Garcia
2018-05-07 11:03   ` Hans Verkuil
2018-05-04 20:06 ` [PATCH v9 06/15] v4l: add unordered flag to format description ioctl Ezequiel Garcia
2018-05-04 20:06 ` [PATCH v9 07/15] v4l: mark unordered formats Ezequiel Garcia
2018-05-07 13:45   ` Hans Verkuil
2018-05-04 20:06 ` [PATCH v9 08/15] cobalt: set queue as unordered Ezequiel Garcia
2018-05-07 11:04   ` Hans Verkuil
2018-05-04 20:06 ` [PATCH v9 09/15] vb2: mark codec drivers " Ezequiel Garcia
2018-05-07 11:02   ` Hans Verkuil
2018-05-04 20:06 ` [PATCH v9 10/15] vb2: add explicit fence user API Ezequiel Garcia
2018-05-07 11:30   ` Hans Verkuil
2018-05-09 10:33   ` Brian Starkey
2018-05-09 15:52     ` Ezequiel Garcia
2018-05-09 16:33       ` Brian Starkey
2018-05-09 19:10         ` Ezequiel Garcia
2018-05-09 19:40         ` Ezequiel Garcia
2018-05-04 20:06 ` [PATCH v9 11/15] vb2: add in-fence support to QBUF Ezequiel Garcia
2018-05-07 12:07   ` Hans Verkuil
2018-05-08 19:16     ` Ezequiel Garcia
2018-05-09  7:04       ` Hans Verkuil
2018-05-08 23:18     ` Gustavo Padovan
2018-05-09 10:35       ` Brian Starkey [this message]
2018-05-09 10:36   ` Brian Starkey
2018-05-09 10:52     ` Hans Verkuil
2018-05-09 16:03     ` Ezequiel Garcia
2018-05-09 16:45       ` Brian Starkey
2018-05-04 20:06 ` [PATCH v9 12/15] vb2: add out-fence " Ezequiel Garcia
2018-05-07 12:29   ` Hans Verkuil
2018-05-09 10:37   ` Brian Starkey
2018-05-04 20:06 ` [PATCH v9 13/15] v4l: introduce the fences capability Ezequiel Garcia
2018-05-04 20:06 ` [PATCH v9 14/15] v4l: Add V4L2_CAP_FENCES to drivers Ezequiel Garcia
2018-05-07 12:42   ` Hans Verkuil
2018-05-04 20:06 ` [PATCH v9 15/15] v4l: Document explicit synchronization behavior Ezequiel Garcia
2018-05-07 12:51   ` 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=20180509103504.GB39838@e107564-lin.cambridge.arm.com \
    --to=brian.starkey@arm.com \
    --cc=acourbot@chromium.org \
    --cc=ezequiel@collabora.com \
    --cc=gustavo.padovan@collabora.com \
    --cc=hverkuil@xs4all.nl \
    --cc=kernel@collabora.com \
    --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 \
    --subject='Re: [PATCH v9 11/15] vb2: add in-fence support to QBUF' \
    /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 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).