From: Marek Olšák <marek.ol...@amd.com>

---
 src/gallium/drivers/radeon/r600_pipe_common.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/radeon/r600_pipe_common.c 
b/src/gallium/drivers/radeon/r600_pipe_common.c
index b1da22f..32486c8 100644
--- a/src/gallium/drivers/radeon/r600_pipe_common.c
+++ b/src/gallium/drivers/radeon/r600_pipe_common.c
@@ -1055,22 +1055,27 @@ static void r600_query_memory_info(struct pipe_screen 
*screen,
 
        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;
-       /* Just return the number of evicted 64KB pages. */
-       info->nr_device_memory_evictions = info->device_memory_evicted / 64;
+
+       if (rscreen->info.drm_major == 3 && rscreen->info.drm_minor >= 4)
+               info->nr_device_memory_evictions =
+                       ws->query_value(ws, RADEON_NUM_EVICTIONS);
+       else
+               /* Just return the number of evicted 64KB pages. */
+               info->nr_device_memory_evictions = info->device_memory_evicted 
/ 64;
 }
 
 struct pipe_resource *r600_resource_create_common(struct pipe_screen *screen,
                                                  const struct pipe_resource 
*templ)
 {
        struct r600_common_screen *rscreen = (struct r600_common_screen*)screen;
 
        if (templ->target == PIPE_BUFFER) {
                return r600_buffer_create(screen, templ,
                                          rscreen->info.gart_page_size);
-- 
2.7.4

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to