dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Daniel Stone <daniel@fooishbar.org>
Cc: "Daniel Vetter" <daniel.vetter@intel.com>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	"Jason Ekstrand" <jason@jlekstrand.net>,
	"Christian König" <christian.koenig@amd.com>
Subject: Re: [PATCH 4/4] RFC: dma-buf: Add an API for importing sync files (v6)
Date: Wed, 26 May 2021 15:44:28 +0200	[thread overview]
Message-ID: <YK5QvIJYTJ7AJZNx@phenom.ffwll.local> (raw)
In-Reply-To: <CAPj87rOW_633K_n4nwq2qkPt5Q5efc3BpRnzT+=Npb=agWGTew@mail.gmail.com>

On Wed, May 26, 2021 at 02:08:19PM +0100, Daniel Stone wrote:
> Hey,
> 
> On Wed, 26 May 2021 at 13:35, Daniel Vetter <daniel@ffwll.ch> wrote:
> > On Wed, May 26, 2021 at 1:09 PM Daniel Stone <daniel@fooishbar.org> wrote:
> > > Yeah, I don't think there's any difference between shared and
> > > exclusive wrt safety. The difference lies in, well, exclusive putting
> > > a hard serialisation barrier between everything which comes before and
> > > everything that comes after, and shared being more relaxed to allow
> > > for reads to retire in parallel.
> > >
> > > As said below, I think there's a good argument for the latter once you
> > > get out of the very straightforward uses. One of the arguments for
> > > these ioctls is to eliminate oversync, but then the import ioctl
> > > mandates oversync in the case where the consumer only does
> > > non-destructive reads - which is the case for the vast majority of
> > > users!
> >
> > Just wanted to comment on this: Right now we attach always attach a
> > shared end-of-batch fence to every dma_resv. So reads are
> > automatically and always synced. So in that sense having an explicit
> > ioct to set the read fence is not really useful, since at most you
> > just make everything worse.
> 
> Are you saying that if a compositor imports a client-provided dmabuf
> as an EGLImage to use as a source texture for its rendering, and then
> provides it to VA-API or V4L2 to use as a media encode source (both
> purely read-only ops), that these will both serialise against each
> other? Like, my media decode job won't begin execution until the
> composition read has fully retired?
> 
> If so, a) good lord that hurts, and b) what are shared fences actually ... for?

Shared is shared, I just meant to say that we always add the shared fence.
So an explicit ioctl to add more shared fences is kinda pointless.

So yeah on a good driver this will run in parallel. On a not-so-good
driver (which currently includes amdgpu and panfrost) this will serialize,
because those drivers don't have the concept of a non-exclusive fence for
such shared buffers (amdgpu does not sync internally, but will sync as
soon as it's cross-drm_file).
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch

  reply	other threads:[~2021-05-26 13:44 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-20 19:00 [PATCH 0/4] dma-buf: Add an API for exporting sync files (v8) Jason Ekstrand
2021-05-20 19:00 ` [PATCH 1/4] dma-buf: add dma_fence_array_for_each (v2) Jason Ekstrand
2021-05-21  7:51   ` Christian König
2021-05-21 16:27     ` Jason Ekstrand
2021-05-21 18:11       ` Christian König
2021-05-20 19:00 ` [PATCH 2/4] dma-buf: add dma_resv_get_singleton_rcu (v4) Jason Ekstrand
2021-05-21 17:48   ` Daniel Vetter
2021-05-24 20:04     ` Jason Ekstrand
2021-05-25 12:38       ` Daniel Vetter
2021-05-25 15:50         ` Christian König
2021-05-22 14:38   ` kernel test robot
2021-05-22 18:59   ` kernel test robot
2021-05-20 19:00 ` [PATCH 3/4] dma-buf: Add an API for exporting sync files (v9) Jason Ekstrand
2021-05-20 19:00 ` [PATCH 4/4] RFC: dma-buf: Add an API for importing sync files (v6) Jason Ekstrand
2021-05-22 20:05   ` Daniel Stone
2021-05-23 17:15     ` EPOLL for drm_syncfile (was Re: [PATCH 4/4] RFC: dma-buf: Add an API for importing sync files (v6)) Christian König
2021-05-23 21:34       ` Daniel Stone
2021-05-25  5:55         ` Daniel Vetter
2021-05-26  9:45         ` Simon Ser
2021-05-24 17:11     ` [PATCH 4/4] RFC: dma-buf: Add an API for importing sync files (v6) Jason Ekstrand
2021-05-25  6:27       ` Daniel Vetter
2021-05-26 11:08       ` Daniel Stone
2021-05-26 12:35         ` Daniel Vetter
2021-05-26 13:08           ` Daniel Stone
2021-05-26 13:44             ` Daniel Vetter [this message]
2021-05-26 15:13               ` Daniel Stone
2021-05-26 16:52                 ` Daniel Vetter
2021-05-26 18:01                   ` Daniel Stone
2021-05-27  7:21                   ` Christian König
2021-05-26 13:52         ` Daniel Stone
2021-05-26 15:24         ` Jason Ekstrand
2021-05-26 18:14           ` Daniel Stone
2021-05-27  4:32             ` Jason Ekstrand
2021-05-27 10:19               ` Daniel Vetter
2021-05-27 10:39                 ` Christian König
2021-05-26 12:21       ` Vlad Zahorodnii
2021-05-21 21:32 ` [PATCH 0/4] dma-buf: Add an API for exporting sync files (v8) Jason Ekstrand

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=YK5QvIJYTJ7AJZNx@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=christian.koenig@amd.com \
    --cc=daniel.vetter@intel.com \
    --cc=daniel@fooishbar.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jason@jlekstrand.net \
    /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).