Bug 104039

Summary: anv: Don't fail vkEnumeratePhysicalDevices due to non-requested winsys
Product: Mesa Reporter: Chad Versace <chadversary>
Component: Drivers/Vulkan/intelAssignee: Intel 3D Bugs Mailing List <intel-3d-bugs>
Status: RESOLVED NOTABUG QA Contact: Intel 3D Bugs Mailing List <intel-3d-bugs>
Severity: normal    
Priority: medium CC: airlied, bas, chadversary, jason
Version: git   
Hardware: Other   
OS: All   
See Also: https://bugs.freedesktop.org/show_bug.cgi?id=104038
Whiteboard:
i915 platform: i915 features:

Description Chad Versace 2017-12-02 16:01:12 UTC
If either wsi_wl_init_wsi() or wsi_x11_init_wsi() fail during anv_EnumeratePhysicalDevices(), then anv_EnumeratePhysicalDevices() fails, even if the user did no ask for either winsys at vkCreateInstance. In particular, if the user asked for no winsys at all, then anv_EnumeratePhysicalDevices() still fails if winsys initialization fails.

A user requests winsys support by requesting instance extensions VK_KHR_{wayland,xlib,xcb}_surface at time of vkCreateInstance.

We should wait until jekstrand's big vulkan/wsi series lands before fixing this.

(I observed this bug during code review, by reading code but not running code. So maybe this is NOTABUG.)
Comment 1 Chad Versace 2017-12-02 16:02:44 UTC
This probably affects radv too.

See https://bugs.freedesktop.org/show_bug.cgi?id=104038.
Comment 2 Jason Ekstrand 2017-12-02 16:28:49 UTC
Failing winsys init just means that we failed to allocate some memory to deal with the winsys.  It never actually opens any connections.  If you're failing memory allocations on driver startup, you have bigger problems.
Comment 3 Chad Versace 2017-12-04 16:40:40 UTC
My mistake. I assumed the winsys init code did something non-trivial, something other than allocation.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.