From 16d568d91166f800dc694510b7c455798bb3b1c0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 15 Jul 2016 23:16:08 +0200 Subject: [PATCH] gallium/radeon: count gfx IB flushes MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This will be used as a counter for whether fence_finish needs to flush the IB. Reviewed-by: Nicolai Hähnle --- src/gallium/drivers/r600/r600_hw_context.c | 1 + src/gallium/drivers/radeon/r600_pipe_common.h | 1 + src/gallium/drivers/radeonsi/si_hw_context.c | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/r600/r600_hw_context.c b/src/gallium/drivers/r600/r600_hw_context.c index 113991ffbbe..444739315ed 100644 --- a/src/gallium/drivers/r600/r600_hw_context.c +++ b/src/gallium/drivers/r600/r600_hw_context.c @@ -286,6 +286,7 @@ void r600_context_gfx_flush(void *context, unsigned flags, ws->cs_flush(cs, flags, &ctx->b.last_gfx_fence); if (fence) ws->fence_reference(fence, ctx->b.last_gfx_fence); + ctx->b.num_gfx_cs_flushes++; r600_begin_new_cs(ctx); } diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h index 1f665d47dcf..91e3cb29928 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.h +++ b/src/gallium/drivers/radeon/r600_pipe_common.h @@ -514,6 +514,7 @@ struct r600_common_context { struct r600_ring dma; struct pipe_fence_handle *last_gfx_fence; struct pipe_fence_handle *last_sdma_fence; + unsigned num_gfx_cs_flushes; unsigned initial_gfx_cs_size; unsigned gpu_reset_counter; unsigned last_dirty_fb_counter; diff --git a/src/gallium/drivers/radeonsi/si_hw_context.c b/src/gallium/drivers/radeonsi/si_hw_context.c index 829dd166b44..49d1a35a618 100644 --- a/src/gallium/drivers/radeonsi/si_hw_context.c +++ b/src/gallium/drivers/radeonsi/si_hw_context.c @@ -137,9 +137,9 @@ void si_context_gfx_flush(void *context, unsigned flags, /* Flush the CS. */ ws->cs_flush(cs, flags, &ctx->b.last_gfx_fence); - if (fence) ws->fence_reference(fence, ctx->b.last_gfx_fence); + ctx->b.num_gfx_cs_flushes++; /* Check VM faults if needed. */ if (ctx->screen->b.debug_flags & DBG_CHECK_VM) { -- 2.30.2