summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-04-28 17:30:16 +0200
committerMarek Olšák <[email protected]>2016-05-02 22:49:25 +0200
commit3e3c43418edb5465e459335dd10b275782025d04 (patch)
treeb2c6c7509c3ecb27b05325f893608e92bf6578c7 /src
parentf98ba4123cc044593897eddfb13546ef24dec395 (diff)
winsys/amdgpu: count buffer size only once
Reviewed-by: Michel Dänzer <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/winsys/amdgpu/drm/amdgpu_cs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
index 1536829b363..03e45a95920 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
@@ -525,10 +525,10 @@ static unsigned amdgpu_cs_add_buffer(struct radeon_winsys_cs *rcs,
unsigned index = amdgpu_add_buffer(cs, bo, usage, bo->initial_domain,
priority, &added_domains);
- if (added_domains & RADEON_DOMAIN_GTT)
- cs->used_gart += bo->base.size;
if (added_domains & RADEON_DOMAIN_VRAM)
cs->used_vram += bo->base.size;
+ else if (added_domains & RADEON_DOMAIN_GTT)
+ cs->used_gart += bo->base.size;
return index;
}