summaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/winsys')
-rw-r--r--src/gallium/winsys/amdgpu/drm/amdgpu_bo.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
index a6d4aa4aaa2..5b099b09a63 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_bo.c
@@ -145,7 +145,7 @@ void amdgpu_bo_destroy(struct pb_buffer *_buf)
if (bo->map_count >= 1) {
if (bo->initial_domain & RADEON_DOMAIN_VRAM)
bo->ws->mapped_vram -= bo->base.size;
- else
+ else if (bo->initial_domain & RADEON_DOMAIN_GTT)
bo->ws->mapped_gtt -= bo->base.size;
}
@@ -261,7 +261,7 @@ static void *amdgpu_bo_map(struct pb_buffer *buf,
if (p_atomic_inc_return(&bo->map_count) == 1) {
if (bo->initial_domain & RADEON_DOMAIN_VRAM)
bo->ws->mapped_vram += bo->base.size;
- else
+ else if (bo->initial_domain & RADEON_DOMAIN_GTT)
bo->ws->mapped_gtt += bo->base.size;
}
return cpu;
@@ -277,7 +277,7 @@ static void amdgpu_bo_unmap(struct pb_buffer *buf)
if (p_atomic_dec_zero(&bo->map_count)) {
if (bo->initial_domain & RADEON_DOMAIN_VRAM)
bo->ws->mapped_vram -= bo->base.size;
- else
+ else if (bo->initial_domain & RADEON_DOMAIN_GTT)
bo->ws->mapped_gtt -= bo->base.size;
}