Mesa (master): radeonsi: avoid querying gpu state if possible

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Apr 14 07:12:50 UTC 2021


Module: Mesa
Branch: master
Commit: a86450e00a224efe3999411064fcdd791411d434
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=a86450e00a224efe3999411064fcdd791411d434

Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Date:   Mon Apr 12 08:28:46 2021 +0200

radeonsi: avoid querying gpu state if possible

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 <marek.olsak at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10179>

---

 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;



More information about the mesa-commit mailing list