From 6938aa7534ae805b18fcdd66374b3586ad21bce9 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Fri, 9 Apr 2021 18:15:23 +0200 Subject: [PATCH] radeonsi: only recreate the aux_context when soft recovery failed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When a GPU hang is detected in the kernel, it can uses 2 different mechanism to recovery: a soft recovery or a hard reset. Soft recovery doesn't lose the vram content so contexts are still valid. In this case we don't need to recreate the aux context. Reviewed-by: Marek Olšák Part-of: --- src/gallium/drivers/radeonsi/si_pipe.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/radeonsi/si_pipe.c b/src/gallium/drivers/radeonsi/si_pipe.c index 13f41b2d630..6c141d94b57 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.c +++ b/src/gallium/drivers/radeonsi/si_pipe.c @@ -355,7 +355,7 @@ static enum pipe_reset_status si_get_reset_status(struct pipe_context *ctx) bool needs_reset; enum pipe_reset_status status = sctx->ws->ctx_query_reset_status(sctx->ctx, &needs_reset); - if (status != PIPE_NO_RESET && !(sctx->context_flags & SI_CONTEXT_FLAG_AUX)) { + if (status != PIPE_NO_RESET && needs_reset && !(sctx->context_flags & SI_CONTEXT_FLAG_AUX)) { /* Call the gallium frontend to set a no-op API dispatch. */ if (sctx->device_reset_callback.reset) { sctx->device_reset_callback.reset(sctx->device_reset_callback.data, status);