aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2016-04-28 16:33:54 +0200
committerMarek Olšák <[email protected]>2016-05-02 22:49:25 +0200
commitf98ba4123cc044593897eddfb13546ef24dec395 (patch)
tree535e8840b7fe85f519075be77efcbe4bfd703050 /src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
parent9ec00c23c2c6fbe58b0d18f860ff8018a7b711ae (diff)
winsys/amdgpu: loosen up requirements for how much memory IBs can use
ported from winsys/radeon. Reviewed-by: Michel Dänzer <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
Diffstat (limited to 'src/gallium/winsys/amdgpu/drm/amdgpu_cs.c')
-rw-r--r--src/gallium/winsys/amdgpu/drm/amdgpu_cs.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
index 8f50f358751..1536829b363 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.c
@@ -549,11 +549,17 @@ static boolean amdgpu_cs_validate(struct radeon_winsys_cs *rcs)
static boolean amdgpu_cs_memory_below_limit(struct radeon_winsys_cs *rcs, uint64_t vram, uint64_t gtt)
{
struct amdgpu_cs *cs = amdgpu_cs(rcs);
- boolean status =
- (cs->used_gart + gtt) < cs->ctx->ws->info.gart_size * 0.7 &&
- (cs->used_vram + vram) < cs->ctx->ws->info.vram_size * 0.7;
+ struct amdgpu_winsys *ws = cs->ctx->ws;
+
+ vram += cs->used_vram;
+ gtt += cs->used_gart;
+
+ /* Anything that goes above the VRAM size should go to GTT. */
+ if (vram > ws->info.vram_size)
+ gtt += vram - ws->info.vram_size;
- return status;
+ /* Now we just need to check if we have enough GTT. */
+ return gtt < ws->info.gart_size * 0.7;
}
static unsigned amdgpu_cs_get_buffer_list(struct radeon_winsys_cs *rcs,