[Mesa-dev] [PATCH 2/2] radeonsi: return real memory usage instead of per-process usage
Marek Olšák
maraeo at gmail.com
Wed Jun 13 01:20:08 UTC 2018
From: Marek Olšák <marek.olsak at amd.com>
---
src/gallium/drivers/radeonsi/si_get.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/radeonsi/si_get.c b/src/gallium/drivers/radeonsi/si_get.c
index 01050cf02b4..154fabebdcc 100644
--- a/src/gallium/drivers/radeonsi/si_get.c
+++ b/src/gallium/drivers/radeonsi/si_get.c
@@ -913,22 +913,22 @@ static void si_query_memory_info(struct pipe_screen *screen,
/* The real TTM memory usage is somewhat random, because:
*
* 1) TTM delays freeing memory, because it can only free it after
* fences expire.
*
* 2) The memory usage can be really low if big VRAM evictions are
* taking place, but the real usage is well above the size of VRAM.
*
* Instead, return statistics of this process.
*/
- vram_usage = ws->query_value(ws, RADEON_REQUESTED_VRAM_MEMORY) / 1024;
- gtt_usage = ws->query_value(ws, RADEON_REQUESTED_GTT_MEMORY) / 1024;
+ vram_usage = ws->query_value(ws, RADEON_VRAM_USAGE) / 1024;
+ gtt_usage = ws->query_value(ws, RADEON_GTT_USAGE) / 1024;
info->avail_device_memory =
vram_usage <= info->total_device_memory ?
info->total_device_memory - vram_usage : 0;
info->avail_staging_memory =
gtt_usage <= info->total_staging_memory ?
info->total_staging_memory - gtt_usage : 0;
info->device_memory_evicted =
ws->query_value(ws, RADEON_NUM_BYTES_MOVED) / 1024;
--
2.17.1
More information about the mesa-dev
mailing list