From 3e3c43418edb5465e459335dd10b275782025d04 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Thu, 28 Apr 2016 17:30:16 +0200 Subject: [PATCH] winsys/amdgpu: count buffer size only once MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Michel Dänzer Reviewed-by: Nicolai Hähnle --- src/gallium/winsys/amdgpu/drm/amdgpu_cs.c | 4 ++-- 1 file 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; } -- 2.30.2