summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/amdgpu/drm
diff options
context:
space:
mode:
authorMarek Olšák <marek.olsak@amd.com>2016-09-04 14:21:41 +0200
committerMarek Olšák <marek.olsak@amd.com>2016-09-07 11:13:13 +0200
commit53d74e055e3596a05b9a306ea867dac0d4591f95 (patch)
tree81933bf7b5b1d63fc98d51a1f3d57ba591625e54 /src/gallium/winsys/amdgpu/drm
parent8c8874eafbe5f7cbb5d413ae1be660c9f001ced5 (diff)
gallium/radeon/winsyses: fix counting mapped memory
Not all buffers are unmapped explicitly. Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Diffstat (limited to 'src/gallium/winsys/amdgpu/drm')
-rw-r--r--src/gallium/winsys/amdgpu/drm/amdgpu_bo.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
index a4bc474634b..32df0be3a53 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
@@ -151,6 +151,14 @@ void amdgpu_bo_destroy(struct pb_buffer *_buf)
bo->ws->allocated_vram -= align64(bo->base.size, bo->ws->info.gart_page_size);
else if (bo->initial_domain & RADEON_DOMAIN_GTT)
bo->ws->allocated_gtt -= align64(bo->base.size, bo->ws->info.gart_page_size);
+
+ if (bo->map_count >= 1) {
+ if (bo->initial_domain & RADEON_DOMAIN_VRAM)
+ bo->ws->mapped_vram -= bo->base.size;
+ else
+ bo->ws->mapped_gtt -= bo->base.size;
+ }
+
FREE(bo);
}