dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Jason Ekstrand <jason@jlekstrand.net>
To: "Christian König" <deathsimple@vodafone.de>
Cc: dri-devel <dri-devel@lists.freedesktop.org>,
	amd-gfx mailing list <amd-gfx@lists.freedesktop.org>
Subject: Re: [rfc] drm sync objects (search for spock)
Date: Tue, 9 May 2017 15:23:02 -0700	[thread overview]
Message-ID: <CAOFGe958OKg847Ls+zuiVuZn4zR9SCckdbJA3SB92YskN_8bCg@mail.gmail.com> (raw)
In-Reply-To: <d5a06d12-7829-ddf6-6021-a5a0117036d9@vodafone.de>


[-- Attachment #1.1: Type: text/plain, Size: 3346 bytes --]

On Wed, Apr 26, 2017 at 7:57 AM, Christian König <deathsimple@vodafone.de>
wrote:

> Am 26.04.2017 um 11:57 schrieb Dave Airlie:
>
>> On 26 April 2017 at 18:45, Christian König <deathsimple@vodafone.de>
>> wrote:
>>
>>> Am 26.04.2017 um 05:28 schrieb Dave Airlie:
>>>
>>>> Okay I've gone around the sun with these a few times, and
>>>> pretty much implemented what I said last week.
>>>>
>>>> This is pretty much a complete revamp.
>>>>
>>>> 1. sync objects are self contained drm objects, they
>>>> have a file reference so can be passed between processes.
>>>>
>>>> 2. Added a sync object wait interface modelled on the vulkan
>>>> fence waiting API.
>>>>
>>>> 3. sync_file interaction is explicitly different than
>>>> opaque fd passing, you import a sync file state into an
>>>> existing syncobj, or create a new sync_file from an
>>>> existing syncobj. This means no touching the sync file code
>>>> at all. \o/
>>>>
>>>
I've done a quick scan over the patches and I like the API.  It almost
looks as if Santa read my wish list. :-)

That said, it was a "quick scan" so don't take this as any sort of actual
code review.  It'll probably be a little while before I get a chance to sit
down and look at i915 again but things seem reasonable.


> Doesn't that break the Vulkan requirement that if a sync_obj is exported to
>>> an fd and imported on the other side we get the same sync_obj again?
>>>
>>> In other words the fd is exported and imported only once and the
>>> expectation
>>> is that we fence containing it will change on each signaling operation.
>>>
>>> As far as I can see with the current implementation you get two
>>> sync_objects
>>> on in the exporting process and one in the importing one.
>>>
>> Are you talking about using sync_file interop for vulkan, then yes
>> that would be wrong.
>>
>> But that isn't how this works, see 1. above the sync obj has a 1:1
>> mapping with an
>> opaque fd (non-sync_file) that is only used for interprocess passing
>> of the syncobj.
>>
>
> Ah, ok that makes some more sense.
>
> You can interoperate with sync_files by importing/exporting the
>> syncobj fence into
>> and out of them but that aren't meant for passing the fds around, more
>> for where you
>> get a sync_file fd from somewhere else and you want to use it and
>> vice-versa.
>>
>
> I would prefer dealing only with one type of fd in userspace, but that
> approach should work as well.
>
> I'd like to move any drm APIs away from sync_file to avoid the fd wastages,
>>
>
> That sounds like it make sense, but I would still rather vote for
> extending the sync_file interface than deprecating it with another one.
>
> I'd also like to move the driver specific fences to syncobj where I can.
>>
>
> I'm pretty sure that is not a good idea.
>
> Beating the sequence based fence values we currently use for CPU sync in
> performance would be pretty hard. E.g. at least on amdgpu we can even check
> those by doing a simple 64bit read from a memory address, without IOCTL or
> any other overhead involved.
>
> Regards,
> Christian.
>
>
>
>> Dave.
>>
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
>

[-- Attachment #1.2: Type: text/html, Size: 5480 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-05-09 22:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-26  3:28 [rfc] drm sync objects (search for spock) Dave Airlie
     [not found] ` <20170426032833.1455-1-airlied-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-04-26  3:28   ` [PATCH 1/5] drm: introduce sync objects Dave Airlie
     [not found]     ` <20170426032833.1455-2-airlied-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-04-26  6:35       ` zhoucm1
2017-04-26  6:36       ` zhoucm1
2017-05-04  8:16       ` Chris Wilson
     [not found]         ` <20170504081633.GC17961-aII6DKEyn0pWYbfKqPwjAkR8Iwp7RQ6xAL8bYrjMMd8@public.gmane.org>
2017-05-09  2:26           ` Dave Airlie
     [not found]             ` <CAPM=9tzzn69_89nRpp3L3Y_qzd6AWg_aZ4PFF3twJg0gV0K8Fg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-05-09  9:17               ` Chris Wilson
2017-05-09 22:06               ` Jason Ekstrand
2017-05-09 14:56       ` Sean Paul
2017-04-26  3:28   ` [PATCH 2/5] drm/syncobj: add sync obj wait interface Dave Airlie
     [not found]     ` <20170426032833.1455-3-airlied-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-05-04  8:22       ` Chris Wilson
2017-04-26  3:28   ` [PATCH 3/5] drm/syncobj: add sync_file interaction Dave Airlie
2017-04-26  3:28   ` [PATCH 4/5] amdgpu/cs: split out fence dependency checking Dave Airlie
     [not found]     ` <20170426032833.1455-5-airlied-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-04-26  6:53       ` zhoucm1
2017-04-26  8:45   ` [rfc] drm sync objects (search for spock) Christian König
     [not found]     ` <373f3919-2f52-44c0-89b9-0c10b7b7bed4-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-04-26  9:57       ` Dave Airlie
     [not found]         ` <CAPM=9tz_S1Y87PxFTw_+SM2f+g9hUvFviKtb9xR=2xLpSCjEAA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-04-26 14:57           ` Christian König
2017-05-09 22:23             ` Jason Ekstrand [this message]
2017-04-26  3:28 ` [PATCH 5/5] amdgpu: use drm sync objects for shared semaphores (v4) Dave Airlie

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=CAOFGe958OKg847Ls+zuiVuZn4zR9SCckdbJA3SB92YskN_8bCg@mail.gmail.com \
    --to=jason@jlekstrand.net \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=deathsimple@vodafone.de \
    --cc=dri-devel@lists.freedesktop.org \
    /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).