turnip: fix kgsl tu_enumerate_devices return code
VK_ERROR_INCOMPATIBLE_DRIVER is not a valid return code in this function. Return VK_SUCCESS when /dev/kgsl-3d0 does not exist. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18622>
This commit is contained in:
@@ -223,13 +223,17 @@ tu_enumerate_devices(struct vk_instance *vk_instance)
|
||||
static const char path[] = "/dev/kgsl-3d0";
|
||||
int fd;
|
||||
|
||||
if (instance->vk.enabled_extensions.KHR_display)
|
||||
return vk_errorf(instance, VK_ERROR_INCOMPATIBLE_DRIVER,
|
||||
if (instance->vk.enabled_extensions.KHR_display) {
|
||||
return vk_errorf(instance, VK_ERROR_INITIALIZATION_FAILED,
|
||||
"I can't KHR_display");
|
||||
}
|
||||
|
||||
fd = open(path, O_RDWR | O_CLOEXEC);
|
||||
if (fd < 0) {
|
||||
return vk_errorf(instance, VK_ERROR_INCOMPATIBLE_DRIVER,
|
||||
if (errno == ENOENT)
|
||||
return VK_SUCCESS;
|
||||
|
||||
return vk_errorf(instance, VK_ERROR_INITIALIZATION_FAILED,
|
||||
"failed to open device %s", path);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user