diff options
author | Lionel Landwerlin <[email protected]> | 2020-01-21 18:19:18 +0200 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-01-21 18:36:26 +0000 |
commit | e618951322e4bf27991c1a31c5933bd0d0f580a1 (patch) | |
tree | f09c145703f4a8e7168da28efe317da6d5956fe5 /src/intel | |
parent | fb6fca003757478a06fb1f6781ad769e84b335ff (diff) |
anv: don't report error with other vendor DRM devices
Enumeration should just skip unsupported DRM devices.
Signed-off-by: Lionel Landwerlin <[email protected]>
Fixes: 34c8621c3b37 ("anv: Allow enumerating multiple physical devices")
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2386
Reviewed-by: Jason Ekstrand <[email protected]>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3481>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3481>
Diffstat (limited to 'src/intel')
-rw-r--r-- | src/intel/vulkan/anv_device.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 50b0a01debf..5599f35304e 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -817,13 +817,13 @@ anv_enumerate_physical_devices(struct anv_instance *instance) /* TODO: Check for more devices ? */ drmDevicePtr devices[8]; - VkResult result = VK_ERROR_INCOMPATIBLE_DRIVER; int max_devices; max_devices = drmGetDevices2(0, devices, ARRAY_SIZE(devices)); if (max_devices < 1) - return VK_ERROR_INCOMPATIBLE_DRIVER; + return VK_SUCCESS; + VkResult result = VK_SUCCESS; for (unsigned i = 0; i < (unsigned)max_devices; i++) { if (devices[i]->available_nodes & 1 << DRM_NODE_RENDER && devices[i]->bustype == DRM_BUS_PCI && @@ -832,8 +832,15 @@ anv_enumerate_physical_devices(struct anv_instance *instance) struct anv_physical_device *pdevice; result = anv_physical_device_try_create(instance, devices[i], &pdevice); - if (result != VK_SUCCESS) + /* 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; list_addtail(&pdevice->link, &instance->physical_devices); } @@ -841,7 +848,7 @@ anv_enumerate_physical_devices(struct anv_instance *instance) drmFreeDevices(devices, max_devices); /* If we successfully enumerated any devices, call it success */ - return !list_is_empty(&instance->physical_devices) ? VK_SUCCESS : result; + return result; } VkResult anv_EnumeratePhysicalDevices( |