summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeon/r600_query.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-01-15 23:59:00 +0100
committerMarek Olšák <[email protected]>2017-01-16 15:35:30 +0100
commit0d9a4efce9c7503544fb828b225ea32a11bc799b (patch)
treeb7769b78d39f42bc08e425988a79ae9150c9cf40 /src/gallium/drivers/radeon/r600_query.c
parentaa0de724c7744d91e259ed6911ab8d1580d2f7da (diff)
gallium/radeon: add GPU-shaders-busy HUD query
It should be close to the GPU load, but it can be much lower if something is stalling shader execution (e.g. CP DMA). Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeon/r600_query.c')
-rw-r--r--src/gallium/drivers/radeon/r600_query.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeon/r600_query.c b/src/gallium/drivers/radeon/r600_query.c
index b7fbd373b42..5712cbe63fb 100644
--- a/src/gallium/drivers/radeon/r600_query.c
+++ b/src/gallium/drivers/radeon/r600_query.c
@@ -147,6 +147,9 @@ static bool r600_query_sw_begin(struct r600_common_context *rctx,
case R600_QUERY_GPU_LOAD:
query->begin_result = r600_begin_counter_gui(rctx->screen);
break;
+ case R600_QUERY_GPU_SHADERS_BUSY:
+ query->begin_result = r600_begin_counter_spi(rctx->screen);
+ break;
case R600_QUERY_NUM_COMPILATIONS:
query->begin_result = p_atomic_read(&rctx->screen->num_compilations);
break;
@@ -240,6 +243,11 @@ static bool r600_query_sw_end(struct r600_common_context *rctx,
query->begin_result);
query->begin_result = 0;
break;
+ case R600_QUERY_GPU_SHADERS_BUSY:
+ query->end_result = r600_end_counter_spi(rctx->screen,
+ query->begin_result);
+ query->begin_result = 0;
+ break;
case R600_QUERY_NUM_COMPILATIONS:
query->end_result = p_atomic_read(&rctx->screen->num_compilations);
break;
@@ -1716,6 +1724,7 @@ static struct pipe_driver_query_info r600_driver_query_list[] = {
/* The following queries must be at the end of the list because their
* availability is adjusted dynamically based on the DRM version. */
X("GPU-load", GPU_LOAD, UINT64, AVERAGE),
+ X("GPU-shaders-busy", GPU_SHADERS_BUSY, UINT64, AVERAGE),
X("temperature", GPU_TEMPERATURE, UINT64, AVERAGE),
X("shader-clock", CURRENT_GPU_SCLK, HZ, AVERAGE),
X("memory-clock", CURRENT_GPU_MCLK, HZ, AVERAGE),
@@ -1732,7 +1741,7 @@ static unsigned r600_get_num_queries(struct r600_common_screen *rscreen)
else if (rscreen->info.drm_major == 3)
return ARRAY_SIZE(r600_driver_query_list) - 3;
else
- return ARRAY_SIZE(r600_driver_query_list) - 4;
+ return ARRAY_SIZE(r600_driver_query_list) - 5;
}
static int r600_get_driver_query_info(struct pipe_screen *screen,