summaryrefslogtreecommitdiff
path: root/src/sna
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-02-06 16:17:36 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-02-06 17:23:51 +0000
commitdaba1ae3e7f0532cc53d9a5178778dbaec203052 (patch)
tree0f08fe834d21e4adc2e27cd78abd13ffd48b58c7 /src/sna
parent0adb0b5e1ebcf3ddfeddae99d96912ec4c090832 (diff)
sna: Correctly handle failure to CPU map a new allocation
If we fail to CPU map, we want to fallback to just using pwrite with normal memory. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna')
-rw-r--r--src/sna/kgem.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 4fbabbaa..ae7ca10e 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -5290,9 +5290,10 @@ struct kgem_bo *kgem_create_buffer(struct kgem *kgem,
if (flags & KGEM_BUFFER_WRITE) {
bo->mem = kgem_bo_map__cpu(kgem, &bo->base);
- if (bo->mem != NULL)
+ if (bo->mem != NULL) {
kgem_bo_sync__cpu(kgem, &bo->base);
- goto init;
+ goto init;
+ }
}
DBG(("%s: failing back to new pwrite buffer\n", __FUNCTION__));