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
This commit is contained in:
Jason Ekstrand
2016-05-24 12:06:35 -07:00
parent e023c104f7
commit b93b5935a7

View File

@@ -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); device->chipset_id = anv_gem_get_param(fd, I915_PARAM_CHIPSET_ID);
if (!device->chipset_id) { if (!device->chipset_id) {
result = vk_errorf(VK_ERROR_INITIALIZATION_FAILED, result = VK_ERROR_INITIALIZATION_FAILED;
"failed to get chipset id: %m");
goto fail; goto fail;
} }
@@ -314,8 +313,15 @@ VkResult anv_EnumeratePhysicalDevices(
VkResult result; VkResult result;
if (instance->physicalDeviceCount < 0) { if (instance->physicalDeviceCount < 0) {
result = anv_physical_device_init(&instance->physicalDevice, char path[20];
instance, "/dev/dri/renderD128"); 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) { if (result == VK_ERROR_INCOMPATIBLE_DRIVER) {
instance->physicalDeviceCount = 0; instance->physicalDeviceCount = 0;
} else if (result == VK_SUCCESS) { } else if (result == VK_SUCCESS) {