From: Marek Olšák Date: Thu, 28 Apr 2016 15:30:16 +0000 (+0200) Subject: winsys/amdgpu: count buffer size only once X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3e3c43418edb5465e459335dd10b275782025d04;p=mesa.git winsys/amdgpu: count buffer size only once Reviewed-by: Michel Dänzer Reviewed-by: Nicolai Hähnle --- 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; }