summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2018-11-12 14:21:45 -0800
committerChia-I Wu <[email protected]>2019-03-11 10:01:33 -0700
commiteb16ec715f12d2f1723e5a0677664b8cc55a26b3 (patch)
tree2a23a10341662a0036eb46b02a6109c78ff0a236
parent1372c95ad26da146454108b7fc44488f28fe91bb (diff)
turnip: Use vk_errorf() for initialization error messages
This small cleanup better prepares turnip for VK_EXT_debug_report.
-rw-r--r--src/freedreno/vulkan/tu_device.c29
1 files changed, 8 insertions, 21 deletions
diff --git a/src/freedreno/vulkan/tu_device.c b/src/freedreno/vulkan/tu_device.c
index f32868e9c81..ae54011e50b 100644
--- a/src/freedreno/vulkan/tu_device.c
+++ b/src/freedreno/vulkan/tu_device.c
@@ -81,10 +81,8 @@ tu_physical_device_init(struct tu_physical_device *device,
fd = open(path, O_RDWR | O_CLOEXEC);
if (fd < 0) {
- if (instance->debug_flags & TU_DEBUG_STARTUP)
- tu_logi("Could not open device '%s'", path);
-
- return vk_error(instance, VK_ERROR_INCOMPATIBLE_DRIVER);
+ return vk_errorf(instance, VK_ERROR_INCOMPATIBLE_DRIVER,
+ "failed to open device %s", path);
}
/* Version 1.3 added MSM_INFO_IOVA. */
@@ -94,14 +92,8 @@ tu_physical_device_init(struct tu_physical_device *device,
version = drmGetVersion(fd);
if (!version) {
close(fd);
-
- if (instance->debug_flags & TU_DEBUG_STARTUP)
- tu_logi("Could not get the kernel driver version for device '%s'",
- path);
-
- return vk_errorf(instance,
- VK_ERROR_INCOMPATIBLE_DRIVER,
- "failed to get version %s: %m",
+ return vk_errorf(instance, VK_ERROR_INCOMPATIBLE_DRIVER,
+ "failed to query kernel driver version for device %s",
path);
}
@@ -110,11 +102,8 @@ tu_physical_device_init(struct tu_physical_device *device,
if (master_fd != -1)
close(master_fd);
close(fd);
-
- if (instance->debug_flags & TU_DEBUG_STARTUP)
- tu_logi("Device '%s' is not using the msm kernel driver.", path);
-
- return VK_ERROR_INCOMPATIBLE_DRIVER;
+ return vk_errorf(instance, VK_ERROR_INCOMPATIBLE_DRIVER,
+ "device %s does not use the msm kernel driver", path);
}
if (version->version_major != 1 || version->version_minor < 3) {
@@ -187,10 +176,8 @@ tu_physical_device_init(struct tu_physical_device *device,
case 530:
break;
default:
- if (instance->debug_flags & TU_DEBUG_STARTUP)
- tu_logi("Device '%s' is not supported.", device->name);
- result = vk_errorf(
- instance, VK_ERROR_INITIALIZATION_FAILED, "unsupported device");
+ result = vk_errorf(instance, VK_ERROR_INITIALIZATION_FAILED,
+ "device %s is unsupported", device->name);
goto fail;
}
if (tu_device_get_cache_uuid(device->gpu_id, device->cache_uuid)) {