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

Eric Engestrom eric.engestrom at intel.com
Fri Oct 26 12:05:54 UTC 2018


On Thursday, 2018-10-25 11:46:57 -0500, 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();
> -

You can now drop `#include "util/debug.h"` from this file :)

Agreed with Lionel's comment on patch 2, you're duplicating all the
error messages.

Series is:
Reviewed-by: Eric Engestrom <eric.engestrom at intel.com>

>     return error;
>  }
> -- 
> 2.19.1
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list