summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_device.c
diff options
context:
space:
mode:
authorJason Ekstrand <jason.ekstrand@intel.com>2016-05-24 12:06:35 -0700
committerJason Ekstrand <jason.ekstrand@intel.com>2016-05-27 17:18:33 -0700
commitb93b5935a71279a4b9dc58b01eab8a49e91b815b (patch)
treec30ed5c946c858161d54d4abf13a5be7303c7d35 /src/intel/vulkan/anv_device.c
parente023c104f738d030c21a519e805705961e4ccf46 (diff)
downloadexternal_mesa3d-b93b5935a71279a4b9dc58b01eab8a49e91b815b.zip
external_mesa3d-b93b5935a71279a4b9dc58b01eab8a49e91b815b.tar.gz
external_mesa3d-b93b5935a71279a4b9dc58b01eab8a49e91b815b.tar.bz2
anv: Try the first 8 render nodes instead of just renderD128
This way, if you have other cards installed, the Vulkan driver will still work. No guarantees about WSI working correctly but offscreen should at least work. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95537
Diffstat (limited to 'src/intel/vulkan/anv_device.c')
-rw-r--r--src/intel/vulkan/anv_device.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 1ab6c74..da7a394 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -73,8 +73,7 @@ anv_physical_device_init(struct anv_physical_device *device,
device->chipset_id = anv_gem_get_param(fd, I915_PARAM_CHIPSET_ID);
if (!device->chipset_id) {
- result = vk_errorf(VK_ERROR_INITIALIZATION_FAILED,
- "failed to get chipset id: %m");
+ result = VK_ERROR_INITIALIZATION_FAILED;
goto fail;
}
@@ -314,8 +313,15 @@ VkResult anv_EnumeratePhysicalDevices(
VkResult result;
if (instance->physicalDeviceCount < 0) {
- result = anv_physical_device_init(&instance->physicalDevice,
- instance, "/dev/dri/renderD128");
+ char path[20];
+ for (unsigned i = 0; i < 8; i++) {
+ snprintf(path, sizeof(path), "/dev/dri/renderD%d", 128 + i);
+ result = anv_physical_device_init(&instance->physicalDevice,
+ instance, path);
+ if (result == VK_SUCCESS)
+ break;
+ }
+
if (result == VK_ERROR_INCOMPATIBLE_DRIVER) {
instance->physicalDeviceCount = 0;
} else if (result == VK_SUCCESS) {