All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: "Christian König" <deathsimple@vodafone.de>
Cc: dri-devel <dri-devel@lists.freedesktop.org>,
	"Michel Dänzer" <michel@daenzer.net>,
	"amd-gfx list" <amd-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915: Before pageflip, also wait for shared dmabuf fences.
Date: Thu, 22 Sep 2016 14:26:46 +0200	[thread overview]
Message-ID: <CAKMK7uF13M7d8qRRwKs_8M-QHjnuB7k3jshTUDnccTTQf6unog@mail.gmail.com> (raw)
In-Reply-To: <b95726e7-6bf6-a1b8-2a63-0758b1b185e2@vodafone.de>

On Thu, Sep 22, 2016 at 12:55 PM, Christian König
<deathsimple@vodafone.de> wrote:
> Am 22.09.2016 um 08:36 schrieb Daniel Vetter:
>>
>> On Wed, Sep 21, 2016 at 06:23:35PM +0200, Christian König wrote:
>>>
>>> For a quick workaround I suggest to just serialize all accesses to BO
>>> shared
>>> with different drivers, but essentially I think it is a perfectly valid
>>> requirement to have multiple writers to one BO.
>>
>> It is, but it's not possible with implicit sync. If you want parallel
>> write access to the same shared buffer, you _must_ carry around some
>> explicit fences. Within amdgpu you can use driver-specific cookies, for
>> shared buffer we now have sync_file. But multiple writers with implicit
>> sync simply fundamentally doesn't work. Because you have no idea with
>> which
>> writer, touching the same subrange you want to touch.
>
>
> You don't need to separate the BO into subranges which are touched by
> different engines for allowing multiple writers.
>
> AMD hardware and I'm pretty sure others as well are perfectly capable of
> writing to the same memory from multiple engines and even multiple GPUs at
> the same time.
>
> For a good hint of what is possible see the public AMD ISA documentation
> about atomic operations, but that is only the start of it.
>
>
> The crux here is that we need to assume that we will have implicit and
> explicit sync mixed for backward compatibility.
>
> This implies that we need some mechanism like amdgpu uses in it's sync
> implementation where every fence is associated with an owner which denotes
> the domain in which implicit sync happens. If you leave this domain you will
> automatically run into explicit sync.
>
> Currently we define the borders of this domain in amdgpu on process boundary
> to keep things like DRI2/DRI3 working as expected.
>
> I really don't see how you want to solve this with a single explicit fence
> for each reservation object. As long as you have multiple concurrently
> running operations accessing the same buffer you need to keep one fence for
> each operation no matter what.

I can't make sense of what you're saying, and I suspect we put
different meaning to different words. So let me define here:

- implicit fencing: Userspace does not track read/writes to buffers,
but only the kernel does that. This is the assumption DRI2/3 has.
Since synchronization is by necessity on a per-buffer level you can
only have 1 writer. In the kernel the cross-driver interface for this
is struct reservation_object attached to dma-bufs. If you don't fill
out/wait for the exclusive fence in there, you're driver is _not_
doing (cross-device) implicit fencing.

- explicit fencing: Userspace passes around distinct fence objects for
any work going on on the gpu. The kernel doesn't insert any stall of
it's own (except for moving buffer objects around ofc). This is what
Android. This also seems to be what amdgpu is doing within one
process/owner.

Given that I'm not sure what you mean with "one explicit fence per
reservation_object", since explicit fencing should not attach anything
(at least not any exclusive fences) to a reservation_object. It does
sound a bit like you have the meaning the other way round (as in
explicit fencing = the kernel explicitly takes care of fencing, but
it's explicit as in explicit fences visible to userspace).
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-09-22 13:18 UTC|newest]

Thread overview: 46+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-08  0:14 [PATCH] drm/i915: Before pageflip, also wait for shared dmabuf fences Mario Kleiner
2016-09-08  6:30 ` Chris Wilson
2016-09-08 15:21   ` Mario Kleiner
2016-09-08 16:23     ` Chris Wilson
     [not found]       ` <20160908162346.GA5479-aII6DKEyn0pWYbfKqPwjAkR8Iwp7RQ6xAL8bYrjMMd8@public.gmane.org>
2016-09-09  1:15         ` Michel Dänzer
     [not found]           ` <abccc8ac-10c6-ab22-c59d-f43ee48ba78d-otUistvHUpPR7s880joybQ@public.gmane.org>
2016-09-13  8:44             ` Christian König
2016-09-13  9:39               ` Chris Wilson
     [not found]                 ` <20160913093945.GA25204-aII6DKEyn0pWYbfKqPwjAkR8Iwp7RQ6xAL8bYrjMMd8@public.gmane.org>
2016-09-13 12:52                   ` Christian König
2016-09-21  9:56                     ` Michel Dänzer
     [not found]                       ` <7aafce92-8bcf-1c5c-45de-9e8ecda85239-otUistvHUpPR7s880joybQ@public.gmane.org>
2016-09-21 10:30                         ` Christian König
2016-09-21 11:04                           ` Daniel Vetter
     [not found]                             ` <CAKMK7uG3j54NzwjxmWuSmP787r+QN-Cu5T8R-naX6S9RvvKemw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-09-21 11:19                               ` Christian König
2016-09-21 12:56                                 ` Daniel Vetter
     [not found]                                   ` <CAKMK7uH6N2Kgwkf-11iwdqDAUrFmreYKLLeTGXmEh+N0DQ4tJg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-09-21 15:07                                     ` Michel Dänzer
     [not found]                                       ` <9d1f4872-cabd-bd1b-7f10-6e4230a1f58c-otUistvHUpPR7s880joybQ@public.gmane.org>
2016-09-21 15:15                                         ` Christian König
     [not found]                                           ` <5c2048ff-0e20-ddf3-2d73-9a3acb38e7ff-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2016-09-21 15:29                                             ` Michel Dänzer
2016-09-21 16:23                                               ` Christian König
2016-09-22  6:36                                                 ` Daniel Vetter
     [not found]                                                   ` <20160922063625.GD22164-XQyZGdhdUcTMwUGJfOwWj/ooFf0ArEBIu+b9c/7xato@public.gmane.org>
2016-09-22 10:55                                                     ` Christian König
2016-09-22 12:26                                                       ` Daniel Vetter [this message]
2016-09-22 12:44                                                         ` Christian König
2016-09-22 13:05                                                           ` Daniel Vetter
2016-09-22 13:22                                                             ` Christian König
     [not found]                                                               ` <d2430ff8-43bd-bff2-9b02-847cabfd56c0-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2016-09-23 10:00                                                                 ` Michel Dänzer
2016-09-23 12:09                                                                   ` Daniel Vetter
2016-09-26  0:48                                                                     ` Michel Dänzer
2016-09-26  8:04                                                                       ` Daniel Vetter
     [not found]                                                                         ` <20160926080419.GV20761-dv86pmgwkMBes7Z6vYuT8azUEOm+Xw19@public.gmane.org>
2016-10-07 12:34                                                                           ` Mike Lothian
     [not found]                                                                             ` <CAHbf0-HZ6EotqwgvkxRTdRF97xB3qBA=DRKAzaAXguV_PR_P8w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-10-11  3:58                                                                               ` Michel Dänzer
     [not found]                                                                                 ` <d74d34a7-5221-d282-d9d1-b0e1007fc0c7-otUistvHUpPR7s880joybQ@public.gmane.org>
2016-10-11 12:04                                                                                   ` Christian König
     [not found]                                                                                     ` <c77a2cb9-1f0e-f1a3-aedd-a111cd6ba8e8-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2016-10-12  0:40                                                                                       ` Michel Dänzer
2016-10-27 13:33                                                                                         ` Mike Lothian
     [not found]                                                                                           ` <CAHbf0-GGMWZrhB+PKpc-QbD__6fqB4pQVFfN+gzLWNhi+DuG3Q-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-10-28  1:34                                                                                             ` Michel Dänzer
2016-10-28 17:37                                                                                               ` Mario Kleiner
     [not found]                                                                                                 ` <7eb19a73-a558-d2e6-bd8d-34fe95045dfd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2016-10-28 17:48                                                                                                   ` Christian König
2016-11-05  1:17                                                                                                     ` Mario Kleiner
2016-10-31  6:41                                                                                                   ` Michel Dänzer
2016-10-28 18:37                                                                                                 ` Mike Lothian
2016-10-29 13:58                                                                                                   ` Mike Lothian
     [not found]                                                                                                     ` <CAHbf0-EY2OM_HgxTjmMi4-f5TQ8fkqf5XYBxHZtJVsnSpxPyyA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2016-10-31  6:44                                                                                                       ` Michel Dänzer
     [not found]                                                                                                         ` <c45e2f4c-c075-47b6-7e02-3bd98748c83a-otUistvHUpPR7s880joybQ@public.gmane.org>
2016-10-31  8:00                                                                                                           ` Christian König
2016-10-31  8:06                                                                                                             ` Michel Dänzer
2016-09-22  6:33                                         ` Daniel Vetter
2016-09-21 15:13                           ` Michel Dänzer
     [not found]                             ` <f0e034f9-db22-6577-97c7-dd8d3e851226-otUistvHUpPR7s880joybQ@public.gmane.org>
2016-09-21 15:21                               ` Christian König
2016-09-21 15:28                                 ` Michel Dänzer

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=CAKMK7uF13M7d8qRRwKs_8M-QHjnuB7k3jshTUDnccTTQf6unog@mail.gmail.com \
    --to=daniel@ffwll.ch \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=deathsimple@vodafone.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=michel@daenzer.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 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.