From 163a29099ab62c8b60ccc02d592066e005ec52de Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 10 Mar 2018 19:23:45 -0500 Subject: 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(+) (limited to 'src/gallium') diff --git a/src/gallium/auxiliary/util/u_helpers.c b/src/gallium/auxiliary/util/u_helpers.c index e0feade3acd..365238631a2 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 ab970d791b1..1e57e32959b 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 -- cgit v1.2.3