mesa/0001-zink-don-t-pick-a-cpu-device-ever.patch

46 lines
1.6 KiB
Diff

From dff56769b504ceb6e45d87201587201249d1d808 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
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 gpu device, when
we merge the CI patch we should add a forcing env var in here.
---
src/gallium/drivers/zink/zink_screen.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/zink/zink_screen.c b/src/gallium/drivers/zink/zink_screen.c
index e190a7af672..918749b90b1 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,7 +717,6 @@ 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);
@@ -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,
--
2.26.2