gallium/radeon/winsyses: fix counting mapped memory

Not all buffers are unmapped explicitly.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
Marek Olšák 2016-09-04 14:21:41 +02:00
parent 8c8874eafb
commit 53d74e055e
2 changed files with 16 additions and 0 deletions

View File

@ -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);
}

View File

@ -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);
}