From c2a5d1dcb14acbd2db4a674453a8622d4b9a572a Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sun, 2 Aug 2015 22:01:25 +0200 Subject: [PATCH] winsys/radeon: loosen up the requirements for how much memory IBs can use MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reviewed-by: Michel Dänzer --- src/gallium/winsys/radeon/drm/radeon_drm_cs.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c index 45eef294369..7e5fff4c1ba 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c @@ -379,11 +379,16 @@ static boolean radeon_drm_cs_validate(struct radeon_winsys_cs *rcs) static boolean radeon_drm_cs_memory_below_limit(struct radeon_winsys_cs *rcs, uint64_t vram, uint64_t gtt) { struct radeon_drm_cs *cs = radeon_drm_cs(rcs); - boolean status = - (cs->csc->used_gart + gtt) < cs->ws->info.gart_size * 0.7 && - (cs->csc->used_vram + vram) < cs->ws->info.vram_size * 0.7; - return status; + vram += cs->csc->used_vram; + gtt += cs->csc->used_gart; + + /* Anything that goes above the VRAM size should go to GTT. */ + if (vram > cs->ws->info.vram_size) + gtt += vram - cs->ws->info.vram_size; + + /* Now we just need to check if we have enough GTT. */ + return gtt < cs->ws->info.gart_size * 0.7; } void radeon_drm_cs_emit_ioctl_oneshot(struct radeon_drm_cs *cs, struct radeon_cs_context *csc) -- 2.30.2