From e41b0202c9af96d511546e2e9c78742e86fb981f Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 3 Feb 2021 14:17:46 +1000 Subject: [PATCH] zink: don't pick a cpu device ever. This goes down the list and picks the first non-cpu device, when we merge the CI patch we should add a forcing env var in here. Fixes: 8d46e35d1 ("zink: introduce opengl over vulkan") Reviewed-By: Mike Blumenkrantz Part-of: --- src/gallium/drivers/zink/zink_screen.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c index e190a7af672..a7b598b7c31 100644 --- a/src/gallium/drivers/zink/zink_screen.c +++ b/src/gallium/drivers/zink/zink_screen.c @@ -709,7 +709,7 @@ static VkPhysicalDevice choose_pdev(const VkInstance instance) { uint32_t i, pdev_count; - VkPhysicalDevice *pdevs, pdev; + VkPhysicalDevice *pdevs, pdev = NULL; vkEnumeratePhysicalDevices(instance, &pdev_count, NULL); assert(pdev_count > 0); @@ -717,11 +717,10 @@ choose_pdev(const VkInstance instance) vkEnumeratePhysicalDevices(instance, &pdev_count, pdevs); assert(pdev_count > 0); - pdev = pdevs[0]; for (i = 0; i < pdev_count; ++i) { VkPhysicalDeviceProperties props; vkGetPhysicalDeviceProperties(pdevs[i], &props); - if (props.deviceType == VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU) { + if (props.deviceType != VK_PHYSICAL_DEVICE_TYPE_CPU) { pdev = pdevs[i]; break; } @@ -1095,6 +1094,9 @@ zink_internal_create_screen(const struct pipe_screen_config *config) debug_printf("ZINK: failed to setup debug utils\n"); screen->pdev = choose_pdev(screen->instance); + if (!screen->pdev) + goto fail; + update_queue_props(screen); screen->have_X8_D24_UNORM_PACK32 = zink_is_depth_format_supported(screen,