turnip: Use vk_startup_errorf() in more startup paths.

This does the logging for you.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11562>
This commit is contained in:
Emma Anholt 2021-06-21 15:37:36 -07:00 committed by Marge Bot
parent 31f8b70481
commit 55000408f9
2 changed files with 15 additions and 15 deletions

View File

@ -1438,17 +1438,23 @@ tu_CreateDevice(VkPhysicalDevice physicalDevice,
/* Initialize a condition variable for timeline semaphore */
pthread_condattr_t condattr;
if (pthread_condattr_init(&condattr) != 0) {
result = VK_ERROR_INITIALIZATION_FAILED;
result = vk_startup_errorf(physical_device->instance,
VK_ERROR_INITIALIZATION_FAILED,
"pthread condattr init");
goto fail_timeline_cond;
}
if (pthread_condattr_setclock(&condattr, CLOCK_MONOTONIC) != 0) {
pthread_condattr_destroy(&condattr);
result = VK_ERROR_INITIALIZATION_FAILED;
result = vk_startup_errorf(physical_device->instance,
VK_ERROR_INITIALIZATION_FAILED,
"pthread condattr clock setup");
goto fail_timeline_cond;
}
if (pthread_cond_init(&device->timeline_cond, &condattr) != 0) {
pthread_condattr_destroy(&condattr);
result = VK_ERROR_INITIALIZATION_FAILED;
result = vk_startup_errorf(physical_device->instance,
VK_ERROR_INITIALIZATION_FAILED,
"pthread cond init");
goto fail_timeline_cond;
}
pthread_condattr_destroy(&condattr);

View File

@ -446,26 +446,20 @@ tu_drm_device_init(struct tu_physical_device *device,
device->local_fd = fd;
if (tu_drm_get_gpu_id(device, &device->gpu_id)) {
if (instance->debug_flags & TU_DEBUG_STARTUP)
mesa_logi("Could not query the GPU ID");
result = vk_errorf(instance, VK_ERROR_INITIALIZATION_FAILED,
"could not get GPU ID");
result = vk_startup_errorf(instance, VK_ERROR_INITIALIZATION_FAILED,
"could not get GPU ID");
goto fail;
}
if (tu_drm_get_gmem_size(device, &device->gmem_size)) {
if (instance->debug_flags & TU_DEBUG_STARTUP)
mesa_logi("Could not query the GMEM size");
result = vk_errorf(instance, VK_ERROR_INITIALIZATION_FAILED,
"could not get GMEM size");
result = vk_startup_errorf(instance, VK_ERROR_INITIALIZATION_FAILED,
"could not get GMEM size");
goto fail;
}
if (tu_drm_get_gmem_base(device, &device->gmem_base)) {
if (instance->debug_flags & TU_DEBUG_STARTUP)
mesa_logi("Could not query the GMEM size");
result = vk_errorf(instance, VK_ERROR_INITIALIZATION_FAILED,
"could not get GMEM size");
result = vk_startup_errorf(instance, VK_ERROR_INITIALIZATION_FAILED,
"could not get GMEM size");
goto fail;
}