[Mesa-dev] [PATCH mesa] anv: only read the env once per process
Jason Ekstrand
jason at jlekstrand.net
Tue Oct 30 16:21:08 UTC 2018
NAK. There's really no reason to do this. If you're in the lost device
case, you've just done an ioctl (expensive) and got a GPU hang (5 second
watchdog timer). Also, it adds complexity to something that very badly
needs to "just work".
--Jason
On Tue, Oct 30, 2018 at 11:09 AM Eric Engestrom <eric.engestrom at intel.com>
wrote:
> Suggested-by: Emil Velikov <emil.l.velikov at gmail.com>
> Signed-off-by: Eric Engestrom <eric.engestrom at intel.com>
> ---
> src/intel/vulkan/anv_device.c | 8 +++++++-
> 1 file changed, 7 insertions(+), 1 deletion(-)
>
> diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
> index ee35e013329005671391..d0e83546b1197e362874 100644
> --- a/src/intel/vulkan/anv_device.c
> +++ b/src/intel/vulkan/anv_device.c
> @@ -2064,7 +2064,13 @@ _anv_device_set_lost(struct anv_device *device,
> VK_ERROR_DEVICE_LOST, file, line, msg, ap);
> va_end(ap);
>
> - if (env_var_as_boolean("ANV_ABORT_ON_DEVICE_LOSS", false))
> + static bool abort_on_device_loss, env_read;
> + if (!env_read) {
> + abort_on_device_loss =
> env_var_as_boolean("ANV_ABORT_ON_DEVICE_LOSS", false);
> + env_read = true;
> + }
> +
> + if (abort_on_device_loss)
> abort();
>
> return err;
> --
> Cheers,
> Eric
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20181030/ef1364f4/attachment.html>
More information about the mesa-dev
mailing list