From 35d284d08e3402bb6dabb885fddcf8fc28e73ca5 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sun, 11 Sep 2016 21:49:24 +0200 Subject: [PATCH] winsys/amdgpu: don't assume GTT if the VRAM flag isn't set MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Nicolai Hähnle --- src/gallium/winsys/amdgpu/drm/amdgpu_bo.c | 6 +++--- 1 file 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; } -- 2.30.2