From 53d74e055e3596a05b9a306ea867dac0d4591f95 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 4 Sep 2016 14:21:41 +0200 Subject: gallium/radeon/winsyses: fix counting mapped memory MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Not all buffers are unmapped explicitly. Reviewed-by: Nicolai Hähnle --- src/gallium/winsys/radeon/drm/radeon_drm_bo.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/gallium/winsys/radeon/drm') diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c index 56aab489540..5db20619b96 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c @@ -316,6 +316,14 @@ void radeon_bo_destroy(struct pb_buffer *_buf) rws->allocated_vram -= align(bo->base.size, rws->info.gart_page_size); else if (bo->initial_domain & RADEON_DOMAIN_GTT) rws->allocated_gtt -= align(bo->base.size, rws->info.gart_page_size); + + if (bo->map_count >= 1) { + if (bo->initial_domain & RADEON_DOMAIN_VRAM) + bo->rws->mapped_vram -= bo->base.size; + else + bo->rws->mapped_gtt -= bo->base.size; + } + FREE(bo); } -- cgit v1.2.3