mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-27 14:50:10 +01:00
vk/runtime: Allow enumerate and try_create_for_drm to coexist
For drivers that can support both drm and non-drm kernel mode drivers it is useful to be able to provide both entrypoints. Signed-off-by: Rob Clark <robdclark@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21394>
This commit is contained in:
parent
08ba87481b
commit
73dfcbf7e8
2 changed files with 6 additions and 3 deletions
|
|
@ -239,7 +239,7 @@ tu_enumerate_devices(struct vk_instance *vk_instance)
|
|||
fd = open(path, O_RDWR | O_CLOEXEC);
|
||||
if (fd < 0) {
|
||||
if (errno == ENOENT)
|
||||
return VK_SUCCESS;
|
||||
return VK_ERROR_INCOMPATIBLE_DRIVER;
|
||||
|
||||
return vk_errorf(instance, VK_ERROR_INITIALIZATION_FAILED,
|
||||
"failed to open device %s", path);
|
||||
|
|
|
|||
|
|
@ -396,8 +396,11 @@ enumerate_drm_physical_devices_locked(struct vk_instance *instance)
|
|||
static VkResult
|
||||
enumerate_physical_devices_locked(struct vk_instance *instance)
|
||||
{
|
||||
if (instance->physical_devices.enumerate)
|
||||
return instance->physical_devices.enumerate(instance);
|
||||
if (instance->physical_devices.enumerate) {
|
||||
VkResult result = instance->physical_devices.enumerate(instance);
|
||||
if (result != VK_ERROR_INCOMPATIBLE_DRIVER)
|
||||
return result;
|
||||
}
|
||||
|
||||
VkResult result = VK_SUCCESS;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue