<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jun 11, 2018 at 9:32 PM, Keith Packard <span dir="ltr"><<a href="mailto:keithp@keithp.com" target="_blank">keithp@keithp.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="">Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> writes:<br>
<br>
> This seems a bit odd.  Why is the FD not stored in the display?  What if<br>
> you acquire multiple displays for two-player VR?  If the master FD passed<br>
> in is not -1, we could just create a VkDisplayKHR object containing<br>
> it.<br>
<br>
</span>You want to share the master_fd passed in at init_wsi time among all<br>
VkDisplayKHR objects, so you need to leave that FD in the global<br>
structure. However, you're right that when you use<br>
EXT_acquire_xlib_display, then you get a separate master_fd for each DRM<br>
output and need to have one per display.<br>
<br>
However, extending this code to support multiple master FDs looks tricky<br>
-- in the case where you have a single master_fd, then enumerating the<br>
DRM resources for that gives you all of the available<br>
connectors. However, if you have one DRM master per connector, then you<br>
need to enumerate each independently to get the complete set of<br>
available resources. For APIs which don't explicitly include a<br>
connector, I would have to go find a suitable master FD for each<br>
resource.<br>
<br>
How about I just disallow multiple leases for now? If you want multiple<br>
outputs, I think you'd want them on the same DRM master anyways, and we<br>
could get that by creating a new extension which had the application<br>
pass in a DRM master that had all of the resources you want to access.<br>
<br>
   /* XXX no support for multiple leases yet */<br>
<span class="">   if (wsi->fd >= 0)<br>
</span>      return VK_ERROR_OUT_OF_DATE_KHR;<span class="HOEnZb"><font color="#888888"><br></font></span></blockquote><div><br></div><div>That's fine with me.  As long as we do something sensible such as disallowing it instead of just falling over.</div><div><br></div><div>--Jason<br></div></div></div></div>