diff options
author | Samuel Pitoiset <[email protected]> | 2020-04-29 13:23:22 +0200 |
---|---|---|
committer | Dylan Baker <[email protected]> | 2020-05-07 10:08:37 -0700 |
commit | 7bb2d35b381938ea28219e9f06a00aa054b13e0a (patch) | |
tree | 61424470ac772c66109cd7c41921c8da89f2b41f | |
parent | 5f3ab97cb88a5aa926b87116a0ef79882258bd42 (diff) |
radv: don't report error with other vendor DRM devices
Enumeration should just skip unsupported DRM devices.
Cc: <[email protected]>
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4806>
(cherry picked from commit 8d993c9d2c23d70d48248c9a8f8bc2855e12b18f)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/amd/vulkan/radv_device.c | 24 |
2 files changed, 16 insertions, 10 deletions
diff --git a/.pick_status.json b/.pick_status.json index fbbf814a8cd..5150e5e3144 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -346,7 +346,7 @@ "description": "radv: don't report error with other vendor DRM devices", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "master_sha": null, "because_sha": null }, diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 901a0f71824..80c4d2c7e14 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -800,7 +800,7 @@ radv_enumerate_devices(struct radv_instance *instance) { /* TODO: Check for more devices ? */ drmDevicePtr devices[8]; - VkResult result = VK_ERROR_INCOMPATIBLE_DRIVER; + VkResult result = VK_SUCCESS; int max_devices; instance->physicalDeviceCount = 0; @@ -811,7 +811,7 @@ radv_enumerate_devices(struct radv_instance *instance) 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 && @@ -822,14 +822,22 @@ radv_enumerate_devices(struct radv_instance *instance) 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; } @@ -843,8 +851,7 @@ VkResult radv_EnumeratePhysicalDevices( if (instance->physicalDeviceCount < 0) { result = radv_enumerate_devices(instance); - if (result != VK_SUCCESS && - result != VK_ERROR_INCOMPATIBLE_DRIVER) + if (result != VK_SUCCESS) return result; } @@ -870,8 +877,7 @@ VkResult radv_EnumeratePhysicalDeviceGroups( if (instance->physicalDeviceCount < 0) { result = radv_enumerate_devices(instance); - if (result != VK_SUCCESS && - result != VK_ERROR_INCOMPATIBLE_DRIVER) + if (result != VK_SUCCESS) return result; } |