diff options
author | Marek Olšák <[email protected]> | 2015-08-02 22:01:25 +0200 |
---|---|---|
committer | Marek Olšák <[email protected]> | 2015-08-06 20:44:35 +0200 |
commit | c2a5d1dcb14acbd2db4a674453a8622d4b9a572a (patch) | |
tree | 8a64191d8d89c0fa6bebc8edaa14f04a14f5c5f8 /src/gallium/winsys/radeon | |
parent | cc59c78b0aa202f1a76a8708ec318e19a8502c9c (diff) |
winsys/radeon: loosen up the requirements for how much memory IBs can use
Reviewed-by: Michel Dänzer <[email protected]>
Diffstat (limited to 'src/gallium/winsys/radeon')
-rw-r--r-- | src/gallium/winsys/radeon/drm/radeon_drm_cs.c | 13 |
1 files 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) |