Mesa (master): gallium/util: add helper util_wait_for_idle

Marek Olšák mareko at kemper.freedesktop.org
Sun Mar 11 17:14:46 UTC 2018


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

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Sat Mar 10 19:23:45 2018 -0500

gallium/util: add helper util_wait_for_idle

This is an old patch that I had.

---

 src/gallium/auxiliary/util/u_helpers.c | 12 ++++++++++++
 src/gallium/auxiliary/util/u_helpers.h |  3 +++
 2 files changed, 15 insertions(+)

diff --git a/src/gallium/auxiliary/util/u_helpers.c b/src/gallium/auxiliary/util/u_helpers.c
index e0feade3ac..365238631a 100644
--- a/src/gallium/auxiliary/util/u_helpers.c
+++ b/src/gallium/auxiliary/util/u_helpers.c
@@ -118,6 +118,7 @@ util_upload_index_buffer(struct pipe_context *pipe,
    return *out_buffer != NULL;
 }
 
+/* This is a helper for hardware bring-up. Don't remove. */
 struct pipe_query *
 util_begin_pipestat_query(struct pipe_context *ctx)
 {
@@ -130,6 +131,7 @@ util_begin_pipestat_query(struct pipe_context *ctx)
    return q;
 }
 
+/* This is a helper for hardware bring-up. Don't remove. */
 void
 util_end_pipestat_query(struct pipe_context *ctx, struct pipe_query *q,
                         FILE *f)
@@ -167,3 +169,13 @@ util_end_pipestat_query(struct pipe_context *ctx, struct pipe_query *q,
            stats.ds_invocations,
            stats.cs_invocations);
 }
+
+/* This is a helper for hardware bring-up. Don't remove. */
+void
+util_wait_for_idle(struct pipe_context *ctx)
+{
+   struct pipe_fence_handle *fence = NULL;
+
+   ctx->flush(ctx, &fence, 0);
+   ctx->screen->fence_finish(ctx->screen, NULL, fence, PIPE_TIMEOUT_INFINITE);
+}
diff --git a/src/gallium/auxiliary/util/u_helpers.h b/src/gallium/auxiliary/util/u_helpers.h
index ab970d791b..1e57e32959 100644
--- a/src/gallium/auxiliary/util/u_helpers.h
+++ b/src/gallium/auxiliary/util/u_helpers.h
@@ -57,6 +57,9 @@ void
 util_end_pipestat_query(struct pipe_context *ctx, struct pipe_query *q,
                         FILE *f);
 
+void
+util_wait_for_idle(struct pipe_context *ctx);
+
 #ifdef __cplusplus
 }
 #endif




More information about the mesa-commit mailing list