diff --git a/src/gallium/drivers/freedreno/freedreno_batch_cache.c b/src/gallium/drivers/freedreno/freedreno_batch_cache.c index e6fe83ff35c..278d5871be5 100644 --- a/src/gallium/drivers/freedreno/freedreno_batch_cache.c +++ b/src/gallium/drivers/freedreno/freedreno_batch_cache.c @@ -141,8 +141,9 @@ fd_bc_fini(struct fd_batch_cache *cache) _mesa_hash_table_destroy(cache->ht, NULL); } -static void -bc_flush(struct fd_context *ctx, bool deferred) assert_dt +/* Flushes all batches in the batch cache. Used at glFlush() and similar times. */ +void +fd_bc_flush(struct fd_context *ctx, bool deferred) assert_dt { struct fd_batch_cache *cache = &ctx->screen->batch_cache; @@ -162,6 +163,11 @@ bc_flush(struct fd_context *ctx, bool deferred) assert_dt } } + /* deferred flush doesn't actually flush, but it marks every other + * batch associated with the context as dependent on the current + * batch. So when the current batch gets flushed, all other batches + * that came before also get flushed. + */ if (deferred) { struct fd_batch *current_batch = fd_context_batch(ctx); @@ -188,23 +194,6 @@ bc_flush(struct fd_context *ctx, bool deferred) assert_dt } } -void -fd_bc_flush(struct fd_context *ctx) -{ - bc_flush(ctx, false); -} - -/* deferred flush doesn't actually flush, but it marks every other - * batch associated with the context as dependent on the current - * batch. So when the current batch gets flushed, all other batches - * that came before also get flushed. - */ -void -fd_bc_flush_deferred(struct fd_context *ctx) -{ - bc_flush(ctx, true); -} - void fd_bc_dump(struct fd_context *ctx, const char *fmt, ...) { diff --git a/src/gallium/drivers/freedreno/freedreno_batch_cache.h b/src/gallium/drivers/freedreno/freedreno_batch_cache.h index 277616cf677..c85a6976583 100644 --- a/src/gallium/drivers/freedreno/freedreno_batch_cache.h +++ b/src/gallium/drivers/freedreno/freedreno_batch_cache.h @@ -66,8 +66,7 @@ struct fd_batch_cache { void fd_bc_init(struct fd_batch_cache *cache); void fd_bc_fini(struct fd_batch_cache *cache); -void fd_bc_flush(struct fd_context *ctx) assert_dt; -void fd_bc_flush_deferred(struct fd_context *ctx) assert_dt; +void fd_bc_flush(struct fd_context *ctx, bool deferred) assert_dt; void fd_bc_dump(struct fd_context *ctx, const char *fmt, ...) _util_printf_format(2, 3); diff --git a/src/gallium/drivers/freedreno/freedreno_context.c b/src/gallium/drivers/freedreno/freedreno_context.c index 70d0558cecd..618df948732 100644 --- a/src/gallium/drivers/freedreno/freedreno_context.c +++ b/src/gallium/drivers/freedreno/freedreno_context.c @@ -129,10 +129,8 @@ fd_context_flush(struct pipe_context *pctx, struct pipe_fence_handle **fencep, if (!ctx->screen->reorder) { fd_batch_flush(batch); - } else if (flags & PIPE_FLUSH_DEFERRED) { - fd_bc_flush_deferred(ctx); } else { - fd_bc_flush(ctx); + fd_bc_flush(ctx, flags & PIPE_FLUSH_DEFERRED); } fd_bc_dump(ctx, "%p: remaining:\n", ctx);