<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, May 8, 2017 at 7:26 PM, Dave Airlie <span dir="ltr"><<a href="mailto:airlied@gmail.com" target="_blank">airlied@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 4 May 2017 at 18:16, Chris Wilson <<a href="mailto:chris@chris-wilson.co.uk">chris@chris-wilson.co.uk</a>> wrote:<br>
> On Wed, Apr 26, 2017 at 01:28:29PM +1000, Dave Airlie wrote:<br>
>> +#include <drm/drmP.h><br>
><br>
> I wonder if Daniel has already split everything used here into its own<br>
> headers?<br>
<br>
</span>not sure, if drm_file is out there yet. I'll find out when I rebase<br>
this onto something newer I expect.<br>
<span class="">>> +<br>
>> +static struct drm_syncobj *drm_syncobj_get(struct drm_file *file_private,<br>
>> +                                        u32 handle)<br>
><br>
> I would like this exposed to the driver as well, so I can do handle to<br>
> syncobj conversion once. (drm_syncobj_find() if we go with kref_get style<br>
> naming.)<br>
<br>
</span>Where do you expect to need two lookups? At least for the semaphore APIs,<br>
you have a list of wait and list of signals, the lists should be different, I've<br>
no objections to exporting this later, but it would be easier to just do that<br>
with the first user.<br>
<span class=""><br>
><br>
>> +static struct drm_syncobj *drm_syncobj_fdget(int fd)<br>
><br>
> It will aslo be useful to export the fd -> syncobj function for drivers. In<br>
> the interface Jason has for execbuf, we can substitute the handle for an<br>
> fd + flag, which may be more convenient for the user.<br>
<br>
</span>Happy once we have a use case for it, I'd rather we didn't expose the syncobj<br>
fd to userspace for anything but sending a syncobj between processes, avoiding<br>
using fd's is one of the main points of this, I'd hate for an API to<br>
demand we use<br>
fd's.<span class=""><br></span></blockquote><div><br></div><div>I'm not sure how useful Chris' use-case is here.  From a userspace perspective, I don't want to burn any more FDs than I absolutely have to, so I'll do the FD -> syncobj conversion on import and use the handle from there on.  For sync_file, using the FD isn't a big deal as it's a one-shot and we close it as soon as execbuf() is completed.  Permanently exported/imported VkSemaphores, on the other hand, are re-usable long-lived objects and the ioctl on import is a smal</div></div><br></div></div>