From: Marek Olšák Date: Thu, 28 Apr 2016 15:30:24 +0000 (+0200) Subject: winsys/radeon: count buffer size only once X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=77af6bcc26a7be938e05b784da2abf8740466618;p=mesa.git winsys/radeon: count buffer size only once Reviewed-by: Michel Dänzer Reviewed-by: Nicolai Hähnle --- diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c index 11ea9bbe80b..7a901a175f8 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c @@ -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; }