From: Marek Olšák Date: Thu, 4 Aug 2016 23:38:23 +0000 (+0200) Subject: gallium/radeon: add HUD queries for mapped VRAM/GTT X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=33a9b4e8a11f263e5ec43a461279ef00220dcd92;p=mesa.git gallium/radeon: add HUD queries for mapped VRAM/GTT mainly for monitoring visible VRAM congestion Reviewed-by: Nicolai Hähnle --- diff --git a/src/gallium/drivers/radeon/r600_query.c b/src/gallium/drivers/radeon/r600_query.c index f6a65a6c22c..87352032ad7 100644 --- a/src/gallium/drivers/radeon/r600_query.c +++ b/src/gallium/drivers/radeon/r600_query.c @@ -51,6 +51,8 @@ static enum radeon_value_id winsys_id_from_type(unsigned type) switch (type) { case R600_QUERY_REQUESTED_VRAM: return RADEON_REQUESTED_VRAM_MEMORY; case R600_QUERY_REQUESTED_GTT: return RADEON_REQUESTED_GTT_MEMORY; + case R600_QUERY_MAPPED_VRAM: return RADEON_MAPPED_VRAM; + case R600_QUERY_MAPPED_GTT: return RADEON_MAPPED_GTT; case R600_QUERY_BUFFER_WAIT_TIME: return RADEON_BUFFER_WAIT_TIME_NS; case R600_QUERY_NUM_CS_FLUSHES: return RADEON_NUM_CS_FLUSHES; case R600_QUERY_NUM_BYTES_MOVED: return RADEON_NUM_BYTES_MOVED; @@ -89,6 +91,8 @@ static bool r600_query_sw_begin(struct r600_common_context *rctx, break; case R600_QUERY_REQUESTED_VRAM: case R600_QUERY_REQUESTED_GTT: + case R600_QUERY_MAPPED_VRAM: + case R600_QUERY_MAPPED_GTT: case R600_QUERY_VRAM_USAGE: case R600_QUERY_GTT_USAGE: case R600_QUERY_GPU_TEMPERATURE: @@ -154,6 +158,8 @@ static bool r600_query_sw_end(struct r600_common_context *rctx, break; case R600_QUERY_REQUESTED_VRAM: case R600_QUERY_REQUESTED_GTT: + case R600_QUERY_MAPPED_VRAM: + case R600_QUERY_MAPPED_GTT: case R600_QUERY_VRAM_USAGE: case R600_QUERY_GTT_USAGE: case R600_QUERY_GPU_TEMPERATURE: @@ -1175,6 +1181,8 @@ static struct pipe_driver_query_info r600_driver_query_list[] = { X("dma-calls", DMA_CALLS, UINT64, AVERAGE), X("requested-VRAM", REQUESTED_VRAM, BYTES, AVERAGE), X("requested-GTT", REQUESTED_GTT, BYTES, AVERAGE), + X("mapped-VRAM", MAPPED_VRAM, BYTES, AVERAGE), + X("mapped-GTT", MAPPED_GTT, BYTES, AVERAGE), X("buffer-wait-time", BUFFER_WAIT_TIME, MICROSECONDS, CUMULATIVE), X("num-cs-flushes", NUM_CS_FLUSHES, UINT64, AVERAGE), X("num-bytes-moved", NUM_BYTES_MOVED, BYTES, CUMULATIVE), @@ -1237,10 +1245,12 @@ static int r600_get_driver_query_info(struct pipe_screen *screen, switch (info->query_type) { case R600_QUERY_REQUESTED_VRAM: case R600_QUERY_VRAM_USAGE: + case R600_QUERY_MAPPED_VRAM: info->max_value.u64 = rscreen->info.vram_size; break; case R600_QUERY_REQUESTED_GTT: case R600_QUERY_GTT_USAGE: + case R600_QUERY_MAPPED_GTT: info->max_value.u64 = rscreen->info.gart_size; break; case R600_QUERY_GPU_TEMPERATURE: diff --git a/src/gallium/drivers/radeon/r600_query.h b/src/gallium/drivers/radeon/r600_query.h index f3c03f59262..7aa684c4dad 100644 --- a/src/gallium/drivers/radeon/r600_query.h +++ b/src/gallium/drivers/radeon/r600_query.h @@ -48,6 +48,8 @@ enum { R600_QUERY_DMA_CALLS, R600_QUERY_REQUESTED_VRAM, R600_QUERY_REQUESTED_GTT, + R600_QUERY_MAPPED_VRAM, + R600_QUERY_MAPPED_GTT, R600_QUERY_BUFFER_WAIT_TIME, R600_QUERY_NUM_CS_FLUSHES, R600_QUERY_NUM_BYTES_MOVED,