mirror of
https://gitlab.freedesktop.org/monado/monado.git
synced 2024-12-29 11:06:18 +00:00
c/direct_mode: Check if NVIDIA path found any displays.
This helps failing earlier with an NVIDIA Optimus setup, which currently is not supported.
This commit is contained in:
parent
6158a23dd9
commit
7afb012544
|
@ -325,8 +325,7 @@ comp_window_direct_init_nvidia(struct comp_window *w)
|
|||
struct vk_bundle comp_vk = w->c->vk;
|
||||
|
||||
// find our display using nvidia whitelist, enumerate its modes, and
|
||||
// pick the best one
|
||||
// get a list of attached displays
|
||||
// pick the best one get a list of attached displays
|
||||
uint32_t display_count;
|
||||
if (comp_vk.vkGetPhysicalDeviceDisplayPropertiesKHR(
|
||||
comp_vk.physical_device, &display_count, NULL) != VK_SUCCESS) {
|
||||
|
@ -334,6 +333,11 @@ comp_window_direct_init_nvidia(struct comp_window *w)
|
|||
return false;
|
||||
}
|
||||
|
||||
if (display_count == 0) {
|
||||
COMP_ERROR(w->c, "NVIDIA: No Vulkan displays found.");
|
||||
return false;
|
||||
}
|
||||
|
||||
struct VkDisplayPropertiesKHR *display_props =
|
||||
U_TYPED_ARRAY_CALLOC(VkDisplayPropertiesKHR, display_count);
|
||||
|
||||
|
|
Loading…
Reference in a new issue