Mesa (main): turnip: Use vk_startup_errorf() in more startup paths.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Jun 24 17:50:44 UTC 2021


Module: Mesa
Branch: main
Commit: 55000408f9ff7d3fb82e0746c0182e69d27139db
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=55000408f9ff7d3fb82e0746c0182e69d27139db

Author: Emma Anholt <emma at anholt.net>
Date:   Mon Jun 21 15:37:36 2021 -0700

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>

---

 src/freedreno/vulkan/tu_device.c | 12 +++++++++---
 src/freedreno/vulkan/tu_drm.c    | 18 ++++++------------
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/src/freedreno/vulkan/tu_device.c b/src/freedreno/vulkan/tu_device.c
index 2feb05f3262..5d4ae2bb192 100644
--- a/src/freedreno/vulkan/tu_device.c
+++ b/src/freedreno/vulkan/tu_device.c
@@ -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);
diff --git a/src/freedreno/vulkan/tu_drm.c b/src/freedreno/vulkan/tu_drm.c
index 14bced0e2fa..0c6454e796f 100644
--- a/src/freedreno/vulkan/tu_drm.c
+++ b/src/freedreno/vulkan/tu_drm.c
@@ -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;
    }
 



More information about the mesa-commit mailing list