radv: don't report error with other vendor DRM devices
Enumeration should just skip unsupported DRM devices. Cc: <mesa-stable@lists.freedesktop.org> Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4806>
This commit is contained in:
parent
f03abd5041
commit
8d993c9d2c
|
@ -746,7 +746,7 @@ radv_enumerate_physical_devices(struct radv_instance *instance)
|
||||||
{
|
{
|
||||||
/* TODO: Check for more devices ? */
|
/* TODO: Check for more devices ? */
|
||||||
drmDevicePtr devices[8];
|
drmDevicePtr devices[8];
|
||||||
VkResult result = VK_ERROR_INCOMPATIBLE_DRIVER;
|
VkResult result = VK_SUCCESS;
|
||||||
int max_devices;
|
int max_devices;
|
||||||
|
|
||||||
instance->physicalDeviceCount = 0;
|
instance->physicalDeviceCount = 0;
|
||||||
|
@ -770,7 +770,7 @@ radv_enumerate_physical_devices(struct radv_instance *instance)
|
||||||
radv_logi("Found %d drm nodes", max_devices);
|
radv_logi("Found %d drm nodes", max_devices);
|
||||||
|
|
||||||
if (max_devices < 1)
|
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++) {
|
for (unsigned i = 0; i < (unsigned)max_devices; i++) {
|
||||||
if (devices[i]->available_nodes & 1 << DRM_NODE_RENDER &&
|
if (devices[i]->available_nodes & 1 << DRM_NODE_RENDER &&
|
||||||
|
@ -781,14 +781,22 @@ radv_enumerate_physical_devices(struct radv_instance *instance)
|
||||||
instance->physicalDeviceCount,
|
instance->physicalDeviceCount,
|
||||||
instance,
|
instance,
|
||||||
devices[i]);
|
devices[i]);
|
||||||
if (result == VK_SUCCESS)
|
/* Incompatible DRM device, skip. */
|
||||||
++instance->physicalDeviceCount;
|
if (result == VK_ERROR_INCOMPATIBLE_DRIVER) {
|
||||||
else if (result != VK_ERROR_INCOMPATIBLE_DRIVER)
|
result = VK_SUCCESS;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Error creating the physical device, report the error. */
|
||||||
|
if (result != VK_SUCCESS)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
++instance->physicalDeviceCount;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
drmFreeDevices(devices, max_devices);
|
drmFreeDevices(devices, max_devices);
|
||||||
|
|
||||||
|
/* If we successfully enumerated any devices, call it success */
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -802,8 +810,7 @@ VkResult radv_EnumeratePhysicalDevices(
|
||||||
|
|
||||||
if (instance->physicalDeviceCount < 0) {
|
if (instance->physicalDeviceCount < 0) {
|
||||||
result = radv_enumerate_physical_devices(instance);
|
result = radv_enumerate_physical_devices(instance);
|
||||||
if (result != VK_SUCCESS &&
|
if (result != VK_SUCCESS)
|
||||||
result != VK_ERROR_INCOMPATIBLE_DRIVER)
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -829,8 +836,7 @@ VkResult radv_EnumeratePhysicalDeviceGroups(
|
||||||
|
|
||||||
if (instance->physicalDeviceCount < 0) {
|
if (instance->physicalDeviceCount < 0) {
|
||||||
result = radv_enumerate_physical_devices(instance);
|
result = radv_enumerate_physical_devices(instance);
|
||||||
if (result != VK_SUCCESS &&
|
if (result != VK_SUCCESS)
|
||||||
result != VK_ERROR_INCOMPATIBLE_DRIVER)
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue