A few thoughts (from the anv perspective) that I put on IRC but may be better in a mail. In no particular order:
1. Having the fd exported from a syncobj be a valid sync_file seems like a fairly pointless feature to me. If we can make things more sane by throwing that out, I'm all for it. 2. As far as sync_file interactions go, I think the far more useful thing would be for you to be able to export a sync_file from a syncobj which would create a sync_file that waits on the last submitted signal operation on the syncobj and then have a way of creating a temporary syncobj that has the fence from a sync_file. Not sure how this would interact with future fences. If we can't figure it out, let's just forget it and not have any defined interaction.
--Jason
On Tue, Apr 18, 2017 at 1:30 PM, Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> wrote:
On Wed, Apr 19, 2017 at 05:34:52AM +1000, Dave Airlie wrote:
> On 14 April 2017 at 19:45, Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> wrote:
> > On Tue, Apr 11, 2017 at 01:22:12PM +1000, Dave Airlie wrote:
> >> This set of sync object patches should address most of the issues
> >> raised in review.
> >>
> >> The major changes:
> >> Race on destroy should be gone,
> >> Documentation fixups
> >> amdgpu internal use p instead of adev fixups
> >>
> >> My plans are to write some igt tests this week, and try
> >> to get some more review on what the API should allow (should
> >> I lock it down to drm syncobj is just semaphores for now).
> >
> > Having an idr of handles is much, much nicer than fd and I want the same
> > for fences :)
>
> Okay, but what form do you want the API to take for fences?
>
> because I've just ported all this to using sem_file as the backend, instead
> of sync_file which seems to oppose the goal of using it for fences.
>
> For fences do you want upfront creation, then passing created fences object
> into command submission that attach the internal fence?
Yes. My understanding is that fences differ from semaphores by allowing
use prior to execution. And that userspace (Vk) wants to be able to
create a fence, pass it to a listener (maybe different process) and then
attach it to an out-fence from a CS.
I looked at using a shared idr for fences/semaphores and the issue I hit
first was having to create a proxy dma-fence to initialise the syncobj
with, so that I could attach listeners before I was able to hook the
fence upto an execbuf.
> Or do you want command submission to have out fence handles that it creates,
> so we don't have any explicit syncobj create for fences?
>
> Do you want those fences to be shareable across processes using sync_file
> semantics?
Yes. In the same vein as the semaphore syncobjs, an idr for cheap
creation/reuse within a process and export/import via sync_file fds.
Where these fd differ from sema is that they do support host CPU access
(these will work just like regular sync_files in that regard).
> I kinda feel like I'm going around in circles here and I'm going to just merge
> something instead.
Sure. It was just from the perspective of extending the i915 execbuffer2
that adding an array for semaphore in/out could be neatly generalised to
cover fences as well (and that the api for syncobj is a substantial
improvement over sync_merge and passing one fence in/out).
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel