From: "Christian König" <christian.koenig@amd.com>
To: Daniel Vetter <daniel@ffwll.ch>, Daniel Stone <daniel@fooishbar.org>
Cc: Daniel Vetter <daniel.vetter@intel.com>,
dri-devel <dri-devel@lists.freedesktop.org>,
Jason Ekstrand <jason@jlekstrand.net>
Subject: Re: [PATCH 4/4] RFC: dma-buf: Add an API for importing sync files (v6)
Date: Thu, 27 May 2021 09:21:17 +0200 [thread overview]
Message-ID: <f5874edb-a5d4-29b1-041b-fe0fd4c2a2ac@amd.com> (raw)
In-Reply-To: <CAKMK7uH9CLw5=-AYRjtMdFA0etjSMEng3UhoACunBq0Uqq+v6Q@mail.gmail.com>
Am 26.05.21 um 18:52 schrieb Daniel Vetter:
> [SNIP]
>> I can make the relatively simple usecases work, but it really feels
>> like in practice we'll end up with massive oversync in some fairly
>> complex usecases, and we'll regret not having had it from the start,
>> plus people will just rely on implicit sync for longer because it has
>> better (more parallel) semantics in some usecases.
> Things fall apart in implicit sync if you have more than one logical
> writer into the same buffer. Trivial example is two images in one
> buffer, but you could also do funky stuff like interleaved/tiled
> rendering with _indepedent_ consumers. If the consumers are not
> independent, then you can again just stuff the two writer fences into
> the exclusive slot with the new ioctl (they'll get merged without
> additional overhead into one fence array fence).
>
> And the fundamental thing is: This is just not possible with implicit
> sync. There's only one fence slot (even if that resolves to an array
> of fences for all the producers), so anytime you do multiple
> independent things in the same buffer you either:
> - must split the buffers so there's again a clear&unique handoff at
> each stage of the pipeline
> - or use explicit sync
Well exactly that is the problem we had with amdgpu and why we came up
with the special handling there.
And you don't even need two images in one buffer, just special hardware
which handles multiple writers gracefully is sufficient. The simplest
example is a depth buffer, but we also have things like ordered append
for ring buffers.
> So in your example, options are
> - per-client buffers, which you then blend into a composite buffer to
> handle the N implicit fences from N buffers into a single implicit
> fence for libva conversion. This single buffer then also allows you to
> again fan out to M libva encoders, or whatever it is that you fancy
> - explicit fencing and clients render into a single buffer with no
> copying, and libva encodes from that single buffer (but again needs
> explicit fences or it all comes crashing down)
>
> There's really no option C where you somehow do multiple implicitly
> fenced things into a single buffer and expect it to work out in
> parallel.
You could also fallback to a dummy submission, e.g. compose the image
with multiple engines in parallel and then make a single dummy
submission to collect all the shared fences into the single exclusive fence.
But this needs an extra IOCTL and unfortunately the stack above also
needs to know when to make that dummy submission.
Christian.
> -Daniel
next prev parent reply other threads:[~2021-05-27 7:21 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
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 [this message]
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=f5874edb-a5d4-29b1-041b-fe0fd4c2a2ac@amd.com \
--to=christian.koenig@amd.com \
--cc=daniel.vetter@intel.com \
--cc=daniel@ffwll.ch \
--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