summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-03-01 11:10:03 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-03-01 15:17:49 +0000
commit272f5d9f8407d8084846b429c1722bddb3e861e9 (patch)
treecb157a79e5016cdf86362d6eb66940c8f762b7e9
parent43b1a717bae047c7ebbf99e6fa4c03b7a67896b8 (diff)
sna: Discard use of inplace GTT uploads on LLC architectures
As the buffer is cache-coherent, we can read as well as write to any partial buffer so the distinction is irrelevant. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/kgem.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index ee81c1b5..3ba2ec35 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1171,7 +1171,6 @@ static void kgem_retire_partials(struct kgem *kgem)
DBG(("%s: handle=%d, used %d/%d\n", __FUNCTION__,
bo->base.handle, bo->used, bytes(&bo->base)));
- assert(bo->write & KGEM_BUFFER_WRITE_INPLACE);
assert(kgem->has_llc || !IS_CPU_MAP(bo->base.map));
bo->base.dirty = false;
bo->base.needs_flush = false;
@@ -1377,7 +1376,6 @@ static void kgem_finish_partials(struct kgem *kgem)
continue;
if (bo->mmapped) {
- assert(bo->write & KGEM_BUFFER_WRITE_INPLACE);
assert(!bo->need_io);
if (kgem->has_llc || !IS_CPU_MAP(bo->base.map)) {
DBG(("%s: retaining partial upload buffer (%d/%d)\n",
@@ -3242,10 +3240,14 @@ struct kgem_bo *kgem_create_buffer(struct kgem *kgem,
/* we should never be asked to create anything TOO large */
assert(size <= kgem->max_cpu_size);
+ if (kgem->has_llc)
+ flags &= ~KGEM_BUFFER_WRITE_INPLACE;
+
list_for_each_entry(bo, &kgem->partial, base.list) {
/* We can reuse any write buffer which we can fit */
if (flags == KGEM_BUFFER_LAST &&
- bo->write == KGEM_BUFFER_WRITE && bo->base.exec &&
+ bo->write == KGEM_BUFFER_WRITE &&
+ bo->base.exec && !bo->mmapped &&
size <= bytes(&bo->base)) {
assert(bo->base.refcnt == 1);
DBG(("%s: reusing write buffer for read of %d bytes? used=%d, total=%d\n",