diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-08-28 20:49:20 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-08-28 22:03:53 +0100 |
commit | 9e0305a3928f253ded6c8e141a4dd42be3952eb9 (patch) | |
tree | a04d0e452a5577ab5f3eb4761c1b7420675fe232 /src | |
parent | f3e122554e88da0351bfb9a7a722f0715553689b (diff) |
sna: Discard inplace flag if we create a CPU map for the upload buffer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/sna/kgem.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c index ba8b0b94..e51bbc0d 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -4300,6 +4300,7 @@ struct kgem_bo *kgem_create_buffer(struct kgem *kgem, assert(bo->base.refcnt >= 1); assert(bo->mmapped); assert(!bo->base.snoop); + assert(!IS_CPU_MAP(bo->base.map) || kgem->has_llc); if ((bo->write & ~flags) & KGEM_BUFFER_INPLACE) { DBG(("%s: skip write %x buffer, need %x\n", @@ -4435,9 +4436,11 @@ struct kgem_bo *kgem_create_buffer(struct kgem *kgem, assert(bo->mmapped); assert(bo->base.refcnt == 1); - bo->mem = kgem_bo_map__gtt(kgem, &bo->base); + bo->mem = kgem_bo_map(kgem, &bo->base); if (bo->mem) { alloc = num_pages(&bo->base); + if (IS_CPU_MAP(bo->base.map)) + flags &= ~KGEM_BUFFER_INPLACE; goto init; } else { bo->base.refcnt = 0; |