[Mesa-dev] [PATCH 3/4] winsys/amdgpu: count buffer size only once

Marek Olšák maraeo at gmail.com
Sun May 1 13:35:28 UTC 2016


From: Marek Olšák <marek.olsak at amd.com>

---
 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 1536829..03e45a9 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.7.4



More information about the mesa-dev mailing list