summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeon/r600_query.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-01-25 16:56:46 +0100
committerSamuel Pitoiset <[email protected]>2017-01-26 19:40:52 +0100
commiteca96ea308dfba41c6bce9c90c79ad8d393e6bbc (patch)
treec53e1864044eb61df7e62b357ed9b9fd3456157f /src/gallium/drivers/radeon/r600_query.c
parent9f087e1c7cc869fcb9839282194560d289b7df59 (diff)
gallium/radeon: add VRAM-vis-usage HUD query
This new query returns the current visible usage of VRAM accessed by the CPU. It will return 0 on radeon because it's unimplemented. Signed-off-by: Samuel Pitoiset <[email protected]> Tested-by: Edmondo Tommasina <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeon/r600_query.c')
-rw-r--r--src/gallium/drivers/radeon/r600_query.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeon/r600_query.c b/src/gallium/drivers/radeon/r600_query.c
index 96157cd40e4..d4e41306a44 100644
--- a/src/gallium/drivers/radeon/r600_query.c
+++ b/src/gallium/drivers/radeon/r600_query.c
@@ -71,6 +71,7 @@ static enum radeon_value_id winsys_id_from_type(unsigned type)
case R600_QUERY_NUM_BYTES_MOVED: return RADEON_NUM_BYTES_MOVED;
case R600_QUERY_NUM_EVICTIONS: return RADEON_NUM_EVICTIONS;
case R600_QUERY_VRAM_USAGE: return RADEON_VRAM_USAGE;
+ case R600_QUERY_VRAM_VIS_USAGE: return RADEON_VRAM_VIS_USAGE;
case R600_QUERY_GTT_USAGE: return RADEON_GTT_USAGE;
case R600_QUERY_GPU_TEMPERATURE: return RADEON_GPU_TEMPERATURE;
case R600_QUERY_CURRENT_GPU_SCLK: return RADEON_CURRENT_SCLK;
@@ -129,6 +130,7 @@ static bool r600_query_sw_begin(struct r600_common_context *rctx,
case R600_QUERY_MAPPED_VRAM:
case R600_QUERY_MAPPED_GTT:
case R600_QUERY_VRAM_USAGE:
+ case R600_QUERY_VRAM_VIS_USAGE:
case R600_QUERY_GTT_USAGE:
case R600_QUERY_GPU_TEMPERATURE:
case R600_QUERY_CURRENT_GPU_SCLK:
@@ -238,6 +240,7 @@ static bool r600_query_sw_end(struct r600_common_context *rctx,
case R600_QUERY_MAPPED_VRAM:
case R600_QUERY_MAPPED_GTT:
case R600_QUERY_VRAM_USAGE:
+ case R600_QUERY_VRAM_VIS_USAGE:
case R600_QUERY_GTT_USAGE:
case R600_QUERY_GPU_TEMPERATURE:
case R600_QUERY_CURRENT_GPU_SCLK:
@@ -1731,6 +1734,7 @@ static struct pipe_driver_query_info r600_driver_query_list[] = {
X("num-bytes-moved", NUM_BYTES_MOVED, BYTES, CUMULATIVE),
X("num-evictions", NUM_EVICTIONS, UINT64, CUMULATIVE),
X("VRAM-usage", VRAM_USAGE, BYTES, AVERAGE),
+ X("VRAM-vis-usage", VRAM_VIS_USAGE, BYTES, AVERAGE),
X("GTT-usage", GTT_USAGE, BYTES, AVERAGE),
X("back-buffer-ps-draw-ratio", BACK_BUFFER_PS_DRAW_RATIO, UINT64, AVERAGE),
@@ -1814,6 +1818,9 @@ static int r600_get_driver_query_info(struct pipe_screen *screen,
case R600_QUERY_GPU_TEMPERATURE:
info->max_value.u64 = 125;
break;
+ case R600_QUERY_VRAM_VIS_USAGE:
+ info->max_value.u64 = rscreen->info.vram_vis_size;
+ break;
}
if (info->group_id != ~(unsigned)0 && rscreen->perfcounters)