Mesa (main): crocus/query: don't loop on ready status after gpu hang.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Oct 5 02:33:41 UTC 2021


Module: Mesa
Branch: main
Commit: 0a592db57360a7847ca9c57e47f6200a2992f2e9
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=0a592db57360a7847ca9c57e47f6200a2992f2e9

Author: Dave Airlie <airlied at redhat.com>
Date:   Tue Oct  5 12:11:26 2021 +1000

crocus/query: don't loop on ready status after gpu hang.

When a GPU hang occurs, the syncobj will eventually timeout,
if this is a wait, just set ready, so things will continue.

This matches 965 behaviour better.

Fixes: c282a082bef0 ("crocus/query: poll the syncobj in the no wait situation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13188>

---

 src/gallium/drivers/crocus/crocus_query.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/src/gallium/drivers/crocus/crocus_query.c b/src/gallium/drivers/crocus/crocus_query.c
index e31f2ef668b..152fd4fa289 100644
--- a/src/gallium/drivers/crocus/crocus_query.c
+++ b/src/gallium/drivers/crocus/crocus_query.c
@@ -678,8 +678,12 @@ crocus_get_query_result(struct pipe_context *ctx,
       }
       assert(READ_ONCE(q->map->snapshots_landed));
 #else
-      if (crocus_wait_syncobj(ctx->screen, q->syncobj, wait ? INT64_MAX : 0))
+      if (crocus_wait_syncobj(ctx->screen, q->syncobj, wait ? INT64_MAX : 0)) {
+         /* if we've waited and timedout, just set the query to ready to avoid infinite loop */
+         if (wait)
+            q->ready = true;
          return false;
+      }
 #endif
       calculate_result_on_cpu(devinfo, q);
    }



More information about the mesa-commit mailing list