From 315eb0acb48a30f9a8defa73a78055e441b5ee6c Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Fri, 28 Oct 2016 01:55:17 +0200 Subject: radeonsi: add a driver query for counting CP DMA calls MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CP DMA calls are synchronous with regard to shaders, but can be made asynchronous if needed. Reviewed-by: Nicolai Hähnle --- src/gallium/drivers/radeon/r600_pipe_common.h | 1 + src/gallium/drivers/radeon/r600_query.c | 7 +++++++ src/gallium/drivers/radeon/r600_query.h | 1 + 3 files changed, 9 insertions(+) (limited to 'src/gallium/drivers/radeon') diff --git a/src/gallium/drivers/radeon/r600_pipe_common.h b/src/gallium/drivers/radeon/r600_pipe_common.h index 9356274791a..a33e290fabb 100644 --- a/src/gallium/drivers/radeon/r600_pipe_common.h +++ b/src/gallium/drivers/radeon/r600_pipe_common.h @@ -570,6 +570,7 @@ struct r600_common_context { unsigned num_compute_calls; unsigned num_spill_compute_calls; unsigned num_dma_calls; + unsigned num_cp_dma_calls; unsigned num_vs_flushes; unsigned num_ps_flushes; unsigned num_cs_flushes; diff --git a/src/gallium/drivers/radeon/r600_query.c b/src/gallium/drivers/radeon/r600_query.c index 9c9694a1cf4..0e4270a58cf 100644 --- a/src/gallium/drivers/radeon/r600_query.c +++ b/src/gallium/drivers/radeon/r600_query.c @@ -101,6 +101,9 @@ static bool r600_query_sw_begin(struct r600_common_context *rctx, case R600_QUERY_DMA_CALLS: query->begin_result = rctx->num_dma_calls; break; + case R600_QUERY_CP_DMA_CALLS: + query->begin_result = rctx->num_cp_dma_calls; + break; case R600_QUERY_NUM_VS_FLUSHES: query->begin_result = rctx->num_vs_flushes; break; @@ -182,6 +185,9 @@ static bool r600_query_sw_end(struct r600_common_context *rctx, case R600_QUERY_DMA_CALLS: query->end_result = rctx->num_dma_calls; break; + case R600_QUERY_CP_DMA_CALLS: + query->end_result = rctx->num_cp_dma_calls; + break; case R600_QUERY_NUM_VS_FLUSHES: query->end_result = rctx->num_vs_flushes; break; @@ -1655,6 +1661,7 @@ static struct pipe_driver_query_info r600_driver_query_list[] = { X("compute-calls", COMPUTE_CALLS, UINT64, AVERAGE), X("spill-compute-calls", SPILL_COMPUTE_CALLS, UINT64, AVERAGE), X("dma-calls", DMA_CALLS, UINT64, AVERAGE), + X("cp-dma-calls", CP_DMA_CALLS, UINT64, AVERAGE), X("num-vs-flushes", NUM_VS_FLUSHES, UINT64, AVERAGE), X("num-ps-flushes", NUM_PS_FLUSHES, UINT64, AVERAGE), X("num-cs-flushes", NUM_CS_FLUSHES, UINT64, AVERAGE), diff --git a/src/gallium/drivers/radeon/r600_query.h b/src/gallium/drivers/radeon/r600_query.h index 0e14753754c..2ff586ac11d 100644 --- a/src/gallium/drivers/radeon/r600_query.h +++ b/src/gallium/drivers/radeon/r600_query.h @@ -48,6 +48,7 @@ enum { R600_QUERY_COMPUTE_CALLS, R600_QUERY_SPILL_COMPUTE_CALLS, R600_QUERY_DMA_CALLS, + R600_QUERY_CP_DMA_CALLS, R600_QUERY_NUM_VS_FLUSHES, R600_QUERY_NUM_PS_FLUSHES, R600_QUERY_NUM_CS_FLUSHES, -- cgit v1.2.3