zink: add env var to abort on device-lost if no reset callback is set

the alternative here is to just spin aimlessly until the process ooms,
which causes problems when trying to detect failures in cts caselists

a separate env var is used so that it can be exported without affecting
ZINK_DEBUG

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17525>
This commit is contained in:
Mike Blumenkrantz
2022-07-12 09:17:25 -04:00
committed by Marge Bot
parent fe5c7f1418
commit 2ea0d735d4
4 changed files with 18 additions and 0 deletions

View File

@@ -332,6 +332,9 @@ post_submit(void *data, void *gdata, int thread_index)
if (bs->is_device_lost) {
if (bs->ctx->reset.reset)
bs->ctx->reset.reset(bs->ctx->reset.data, PIPE_GUILTY_CONTEXT_RESET);
else if (screen->abort_on_hang && !screen->robust_ctx_count)
/* if nothing can save us, abort */
abort();
screen->device_lost = true;
} else if (bs->ctx->batch_states_count > 5000) {
zink_screen_timeline_wait(screen, bs->fence.batch_id - 2500, PIPE_TIMEOUT_INFINITE);