From a86450e00a224efe3999411064fcdd791411d434 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Mon, 12 Apr 2021 08:28:46 +0200 Subject: [PATCH] radeonsi: avoid querying gpu state if possible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit No-op dispatch should only be setup for full reset, not soft-recovery resets. The same trick cannot be used in si_get_reset_status because EGL expects us to return GL_***_CONTEXT_RESET even if it has been fixed by a soft recovery. Reviewed-by: Marek Olšák Part-of: --- src/gallium/drivers/radeonsi/si_gfx_cs.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_gfx_cs.c b/src/gallium/drivers/radeonsi/si_gfx_cs.c index f9aef3c0242..24c830ab7dc 100644 --- a/src/gallium/drivers/radeonsi/si_gfx_cs.c +++ b/src/gallium/drivers/radeonsi/si_gfx_cs.c @@ -96,13 +96,15 @@ void si_flush_gfx_cs(struct si_context *ctx, unsigned flags, struct pipe_fence_h !(flags & RADEON_FLUSH_TOGGLE_SECURE_SUBMISSION)) return; - /* Calling get_device_reset_status is useful to re-create the - * aux context if needed. - * This cs will be submitted even if a reset is detected; in this - * case it'll treated as a no-op. This ensures that all states - * are properly reset. - */ - ctx->b.get_device_reset_status(&ctx->b); + /* Non-aux contexts must set up no-op API dispatch on GPU resets. This is + * similar to si_get_reset_status but here we can ignore soft-recoveries, + * while si_get_reset_status can't. */ + if (!(ctx->context_flags & SI_CONTEXT_FLAG_AUX) && + ctx->device_reset_callback.reset) { + enum pipe_reset_status status = ctx->ws->ctx_query_reset_status(ctx->ctx, true, NULL); + if (status != PIPE_NO_RESET) + ctx->device_reset_callback.reset(ctx->device_reset_callback.data, status); + } if (sscreen->debug_flags & DBG(CHECK_VM)) flags &= ~PIPE_FLUSH_ASYNC;