{
/* TODO: Check for more devices ? */
drmDevicePtr devices[8];
- VkResult result = VK_ERROR_INCOMPATIBLE_DRIVER;
+ VkResult result = VK_SUCCESS;
int max_devices;
instance->physicalDeviceCount = 0;
radv_logi("Found %d drm nodes", max_devices);
if (max_devices < 1)
- return vk_error(instance, VK_ERROR_INCOMPATIBLE_DRIVER);
+ return vk_error(instance, VK_SUCCESS);
for (unsigned i = 0; i < (unsigned)max_devices; i++) {
if (devices[i]->available_nodes & 1 << DRM_NODE_RENDER &&
instance->physicalDeviceCount,
instance,
devices[i]);
- if (result == VK_SUCCESS)
- ++instance->physicalDeviceCount;
- else if (result != VK_ERROR_INCOMPATIBLE_DRIVER)
+ /* Incompatible DRM device, skip. */
+ if (result == VK_ERROR_INCOMPATIBLE_DRIVER) {
+ result = VK_SUCCESS;
+ continue;
+ }
+
+ /* Error creating the physical device, report the error. */
+ if (result != VK_SUCCESS)
break;
+
+ ++instance->physicalDeviceCount;
}
}
drmFreeDevices(devices, max_devices);
+ /* If we successfully enumerated any devices, call it success */
return result;
}
if (instance->physicalDeviceCount < 0) {
result = radv_enumerate_physical_devices(instance);
- if (result != VK_SUCCESS &&
- result != VK_ERROR_INCOMPATIBLE_DRIVER)
+ if (result != VK_SUCCESS)
return result;
}
if (instance->physicalDeviceCount < 0) {
result = radv_enumerate_physical_devices(instance);
- if (result != VK_SUCCESS &&
- result != VK_ERROR_INCOMPATIBLE_DRIVER)
+ if (result != VK_SUCCESS)
return result;
}