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

Author: Sergei Chernyadyev 
<[email protected]>
Date:   Mon Oct 17 20:29:39 2022 +0300

radv: fix setting results for initialization failures in thread trace and trap 
handler

Reviewed-by: Tatsuyuki Ishi <[email protected]>
Reviewed-by: Samuel Pitoiset <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19083>

---

 src/amd/vulkan/radv_device.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index cb4e754d512..d897360650f 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -3667,8 +3667,10 @@ radv_CreateDevice(VkPhysicalDevice physicalDevice, const 
VkDeviceCreateInfo *pCr
        */
       keep_shader_info = true;
 
-      if (!radv_init_trace(device))
+      if (!radv_init_trace(device)) {
+         result = VK_ERROR_INITIALIZATION_FAILED;
          goto fail;
+      }
 
       fprintf(stderr,
               
"*****************************************************************************\n");
@@ -3694,8 +3696,10 @@ radv_CreateDevice(VkPhysicalDevice physicalDevice, const 
VkDeviceCreateInfo *pCr
          abort();
       }
 
-      if (!radv_thread_trace_init(device))
+      if (!radv_thread_trace_init(device)) {
+         result = VK_ERROR_INITIALIZATION_FAILED;
          goto fail;
+      }
 
       fprintf(stderr, "radv: Thread trace support is enabled (initial buffer 
size: %u MiB, "
                       "instruction timing: %s, cache counters: %s).\n",
@@ -3705,8 +3709,10 @@ radv_CreateDevice(VkPhysicalDevice physicalDevice, const 
VkDeviceCreateInfo *pCr
 
       if (radv_spm_trace_enabled()) {
          if (device->physical_device->rad_info.gfx_level >= GFX10) {
-            if (!radv_spm_init(device))
+            if (!radv_spm_init(device)) {
+               result = VK_ERROR_INITIALIZATION_FAILED;
                goto fail;
+            }
          } else {
             fprintf(stderr, "radv: SPM isn't supported for this GPU (%s)!\n",
                     device->physical_device->name);
@@ -3727,8 +3733,10 @@ radv_CreateDevice(VkPhysicalDevice physicalDevice, const 
VkDeviceCreateInfo *pCr
        */
       keep_shader_info = true;
 
-      if (!radv_trap_handler_init(device))
+      if (!radv_trap_handler_init(device)) {
+         result = VK_ERROR_INITIALIZATION_FAILED;
          goto fail;
+      }
    }
 
    if (device->physical_device->rad_info.gfx_level >= GFX10_3) {

Reply via email to