aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_bo.c13
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_winsys.c4
-rw-r--r--src/gallium/winsys/radeon/drm/radeon_drm_winsys.h2
3 files changed, 18 insertions, 1 deletions
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
index 897b5367092..56aab489540 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c
@@ -375,8 +375,13 @@ void *radeon_bo_do_map(struct radeon_bo *bo)
}
bo->ptr = ptr;
bo->map_count = 1;
- pipe_mutex_unlock(bo->map_mutex);
+ if (bo->initial_domain & RADEON_DOMAIN_VRAM)
+ bo->rws->mapped_vram += bo->base.size;
+ else
+ bo->rws->mapped_gtt += bo->base.size;
+
+ pipe_mutex_unlock(bo->map_mutex);
return bo->ptr;
}
@@ -479,6 +484,12 @@ static void radeon_bo_unmap(struct pb_buffer *_buf)
os_munmap(bo->ptr, bo->base.size);
bo->ptr = NULL;
+
+ if (bo->initial_domain & RADEON_DOMAIN_VRAM)
+ bo->rws->mapped_vram -= bo->base.size;
+ else
+ bo->rws->mapped_gtt -= bo->base.size;
+
pipe_mutex_unlock(bo->map_mutex);
}
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
index 1b32c377452..b1cc3d50fd8 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c
@@ -603,6 +603,10 @@ static uint64_t radeon_query_value(struct radeon_winsys *rws,
return ws->allocated_vram;
case RADEON_REQUESTED_GTT_MEMORY:
return ws->allocated_gtt;
+ case RADEON_MAPPED_VRAM:
+ return ws->mapped_vram;
+ case RADEON_MAPPED_GTT:
+ return ws->mapped_gtt;
case RADEON_BUFFER_WAIT_TIME_NS:
return ws->buffer_wait_time;
case RADEON_TIMESTAMP:
diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.h b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.h
index fdbaebe67b5..27fbe906f6a 100644
--- a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.h
+++ b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.h
@@ -71,6 +71,8 @@ struct radeon_drm_winsys {
int num_cs; /* The number of command streams created. */
uint64_t allocated_vram;
uint64_t allocated_gtt;
+ uint64_t mapped_vram;
+ uint64_t mapped_gtt;
uint64_t buffer_wait_time; /* time spent in buffer_wait in ns */
uint64_t num_cs_flushes;