Mesa (master): anv: Handle the device loss abort in anv_device_set_lost
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Oct 26 16:45:59 UTC 2018
Module: Mesa
Branch: master
Commit: 292ebdbf985f09e9af3dec28af784247510e0904
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=292ebdbf985f09e9af3dec28af784247510e0904
Author: Jason Ekstrand <jason.ekstrand at intel.com>
Date: Tue Mar 13 12:26:20 2018 -0700
anv: Handle the device loss abort in anv_device_set_lost
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom at intel.com>
---
src/intel/vulkan/anv_device.c | 11 +++++++++++
src/intel/vulkan/anv_util.c | 5 -----
2 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index b4034145a5..70fc51ff30 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -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
diff --git a/src/intel/vulkan/anv_util.c b/src/intel/vulkan/anv_util.c
index 9082707624..8ccb61b35c 100644
--- a/src/intel/vulkan/anv_util.c
+++ b/src/intel/vulkan/anv_util.c
@@ -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;
}
More information about the mesa-commit
mailing list