diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-02-06 17:02:27 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-02-06 17:23:51 +0000 |
commit | 974b6a97d78dadf09be8a2c4f61020f15d80d558 (patch) | |
tree | 289a8aea28b52cceab87d75fce070c1b603dae6a | |
parent | 5c8084ef04cb0a7da064fb1e13c8ef7dae528b1b (diff) |
sna: Fallback to non-LLC paths after an allocation failure for an LLC buffer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/kgem.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c index a02eb39b..d2be8629 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -5113,7 +5113,7 @@ struct kgem_bo *kgem_create_buffer(struct kgem *kgem, if (kgem->has_llc) { bo = buffer_alloc(); if (bo == NULL) - return NULL; + goto skip_llc; old = NULL; if ((flags & KGEM_BUFFER_WRITE) == 0) @@ -5131,7 +5131,7 @@ struct kgem_bo *kgem_create_buffer(struct kgem *kgem, uint32_t handle = gem_create(kgem->fd, alloc); if (handle == 0) { free(bo); - return NULL; + goto skip_llc; } __kgem_bo_init(&bo->base, handle, alloc); DBG(("%s: created LLC handle=%d for buffer\n", @@ -5153,6 +5153,7 @@ struct kgem_bo *kgem_create_buffer(struct kgem *kgem, kgem_bo_free(kgem, &bo->base); } } +skip_llc: if (PAGE_SIZE * alloc > kgem->aperture_mappable / 4) flags &= ~KGEM_BUFFER_INPLACE; |