From: Marek Olšák Date: Sun, 11 Mar 2018 00:23:45 +0000 (-0500) Subject: gallium/util: add helper util_wait_for_idle X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=163a29099ab62c8b60ccc02d592066e005ec52de;p=mesa.git gallium/util: add helper util_wait_for_idle This is an old patch that I had. --- 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