winsys/radeon: count buffer size only once
authorMarek Olšák <marek.olsak@amd.com>
Thu, 28 Apr 2016 15:30:24 +0000 (17:30 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Mon, 2 May 2016 20:49:25 +0000 (22:49 +0200)
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/gallium/winsys/radeon/drm/radeon_drm_cs.c

index 11ea9bbe80b476208e182a2dfb8b3a5e419760b9..7a901a175f87b0032b03978b7d89faef207f79c9 100644 (file)
@@ -331,10 +331,10 @@ static unsigned radeon_drm_cs_add_buffer(struct radeon_winsys_cs *rcs,
     unsigned index = radeon_add_buffer(cs, bo, usage, domains, priority,
                                        &added_domains);
 
-    if (added_domains & RADEON_DOMAIN_GTT)
-        cs->csc->used_gart += bo->base.size;
     if (added_domains & RADEON_DOMAIN_VRAM)
         cs->csc->used_vram += bo->base.size;
+    else if (added_domains & RADEON_DOMAIN_GTT)
+        cs->csc->used_gart += bo->base.size;
 
     return index;
 }