[Mesa-dev] [PATCH 3/3] anv: Handle the device loss abort in anv_device_set_lost

Lionel Landwerlin lionel.g.landwerlin at intel.com
Thu Oct 25 17:13:34 UTC 2018


Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>

On 25/10/2018 17:46, Jason Ekstrand wrote:
> ---
>   src/intel/vulkan/anv_device.c | 11 +++++++++++
>   src/intel/vulkan/anv_util.c   |  4 ----
>   2 files changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
> index 79d3f052113..d62bdde078c 100644
> --- a/src/intel/vulkan/anv_device.c
> +++ b/src/intel/vulkan/anv_device.c
> @@ -2053,6 +2053,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 9082707624c..9963a15ace3 100644
> --- a/src/intel/vulkan/anv_util.c
> +++ b/src/intel/vulkan/anv_util.c
> @@ -112,9 +112,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-dev mailing list