anv: Handle the device loss abort in anv_device_set_lost
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 13 Mar 2018 19:26:20 +0000 (12:26 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 26 Oct 2018 13:40:23 +0000 (08:40 -0500)
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
src/intel/vulkan/anv_device.c
src/intel/vulkan/anv_util.c

index b4034145a555d445a917cc10aa8382131c399789..70fc51ff306bafec169eaed8d3f407e8b533ac7e 100644 (file)
@@ -2052,6 +2052,17 @@ void
 anv_device_set_lost(struct anv_device *device, const char *msg, ...)
 {
    device->_lost = true;
+
+   if (env_var_as_boolean("ANV_ABORT_ON_DEVICE_LOSS", false)) {
+      intel_loge("Device lost!");
+
+      va_list ap;
+      va_start(ap, msg);
+      intel_loge_v(msg, ap);
+      va_end(ap);
+
+      abort();
+   }
 }
 
 VkResult
index 9082707624c648577824e38d0550d3c40f511494..8ccb61b35c10ff3a31746a1acec840e26cbb9dcd 100644 (file)
@@ -30,7 +30,6 @@
 
 #include "anv_private.h"
 #include "vk_enum_to_str.h"
-#include "util/debug.h"
 
 /** Log an error message.  */
 void anv_printflike(1, 2)
@@ -112,9 +111,5 @@ __vk_errorf(struct anv_instance *instance, const void *object,
 
    intel_loge("%s", report);
 
-   if (error == VK_ERROR_DEVICE_LOST &&
-       env_var_as_boolean("ANV_ABORT_ON_DEVICE_LOSS", false))
-      abort();
-
    return error;
 }