dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: James Jones <jajones@nvidia.com>
To: "Christian König" <deathsimple@vodafone.de>,
	"Dave Airlie" <airlied@gmail.com>,
	amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [rfc repost] drm sync objects - a new beginning (make ickle happier?)
Date: Wed, 19 Apr 2017 10:14:09 -0700	[thread overview]
Message-ID: <a3aa948f-7ef8-809e-5b0e-17544a581387@nvidia.com> (raw)
In-Reply-To: <0734833f-e6f2-b5f3-9687-f21f82fd8599@vodafone.de>

On 04/19/2017 05:07 AM, Christian König wrote:
> Am 13.04.2017 um 03:41 schrieb Dave Airlie:
>> Okay I've taken Chris's suggestions to heart and reworked things
>> around a sem_file to see how they might look.
>>
>> This means the drm_syncobj are currently only useful for semaphores,
>> the flags field could be used in future to use it for other things,
>> and we can reintroduce some of the API then if needed.
>>
>> This refactors sync_file first to add some basic rcu wrappers
>> about the fence pointer, as this point never updates this should
>> all be fine unlocked.
>>
>> It then creates the sem_file with a mutex, and uses that to
>> track the semaphores with reduced fops and the replace and
>> get APIs.
>>
>> Then it reworks the drm stuff on top, and fixes amdgpu bug
>> with old_fence.
>>
>> Let's see if anyone prefers one approach over the other.
>
> Yeah, I clearly prefer keeping only one object type for synchronization
> in the kernel.
>
> As I wrote in the other mail the argument of using the sync file for
> semaphores was to be able to use it as in fence with the atomic mode
> setting as well.

This may introduce incompatibilities in userspace though, as the 
response to Dave's original series' pointed out.  For example, the 
Vulkan extensions that allow importing sync files expect them to behave 
as sync files currently do, not as these new objects do.  Introducing 
the new behavior would invalidate language in those specifications, 
causing problems with the very use case I suspect these changes are 
trying to address.  Those specs are not finalized, so it could be fixed, 
but I think that highlights the general concern.

> That a wait consumes a previous signal should be a specific behavior of
> the operation and not the property of the object.
>
> In other words I'm fine with using the sync_file in a 1:1 fashion with
> Vulkan, but for the atomic API we probably want 1:N to be able to flip a
> rendering result on multiple CRTCs at the same time.

Agreed, this usage seems valuable too.  Sem files still have a fence in 
them, and that doesn't seem like an implementation detail that needs to 
be hidden from userspace.  Vulkan solved this very issue by letting 
applications directly extract the sync_file fd from a Vulkan semaphore 
so they could use it with native operations that specifically require a 
sync file, via the experimental external semaphore extensions.  Perhaps 
there could be a sem file -> sync file conversion operation with 
semantics similar to a Vulkan semaphore -> sync file export operation? 
Note the Vulkan semantics for this are in churn, so it might be worth 
holding off a bit on adding that interface if this is the path you use, 
but it shouldn't need to block this series from my high-level read.

Thanks,
-James

> Regards,
> Christian.
>
>>
>> Dave.
>> _______________________________________________
>> amd-gfx mailing list
>> amd-gfx@lists.freedesktop.org
>> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
>
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2017-04-19 17:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-13  1:41 [rfc repost] drm sync objects - a new beginning (make ickle happier?) Dave Airlie
     [not found] ` <20170413014144.637-1-airlied-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-04-13  1:41   ` [PATCH 1/7] sync_file: get rid of internal reference count Dave Airlie
     [not found]     ` <20170413014144.637-2-airlied-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-04-17 13:13       ` Gustavo Padovan
2017-04-17 15:14         ` Sumit Semwal
     [not found]           ` <CAO_48GHYX7oDv3MtD5XhoQOSyYZOF_byP+niV0YC7f1ZhHvL1A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-04-18 14:38             ` Gustavo Padovan
2017-04-13  1:41   ` [PATCH 3/7] sync_file: split out fence_file base class from sync_file Dave Airlie
2017-04-19 12:02     ` Christian König
2017-04-13  1:41   ` [PATCH 4/7] sync_file: add support for sem_file Dave Airlie
     [not found]     ` <20170413014144.637-5-airlied-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2017-04-13  2:52       ` Chris Wilson
2017-04-19 12:07   ` [rfc repost] drm sync objects - a new beginning (make ickle happier?) Christian König
2017-04-19 17:14     ` James Jones [this message]
     [not found]     ` <0734833f-e6f2-b5f3-9687-f21f82fd8599-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org>
2017-04-19 18:42       ` Dave Airlie
2017-04-19 19:14         ` Dave Airlie
2017-04-20  8:36           ` Christian König
2017-04-13  1:41 ` [PATCH 2/7] sync_file: mark the fence pointer as rcu Dave Airlie
2017-04-13  1:41 ` [PATCH 5/7] drm: introduce sync objects as wrappers for sem files Dave Airlie
2017-04-13  1:41 ` [PATCH 6/7] amdgpu/cs: split out fence dependency checking Dave Airlie
2017-04-13  1:41 ` [PATCH 7/7] amdgpu: use sync file for shared semaphores (v3) 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=a3aa948f-7ef8-809e-5b0e-17544a581387@nvidia.com \
    --to=jajones@nvidia.com \
    --cc=airlied@gmail.com \
    --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