summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-08-21 00:28:40 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-08-21 00:39:46 +0100
commit4ee2e227ddf61c87f08f55d4922d2562b563ca87 (patch)
treec9922ae35225a394d030e6db6723c2ff5fc33404
parenteee181e9d71273d94fe735805ed84e8f7b7b2180 (diff)
sna: Mark all levels of a proxy as dirty
So that if we write to a surface through one view, we make sure that the sample cache is invalidated for all future views. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/kgem.c17
-rw-r--r--src/sna/kgem.h16
2 files changed, 20 insertions, 13 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 49e27d07..7498e739 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1789,10 +1789,11 @@ static void kgem_commit(struct kgem *kgem)
bo->dirty = false;
if (bo->proxy) {
+ assert(bo->exec == &_kgem_dummy_exec);
/* proxies are not used for domain tracking */
list_del(&bo->request);
bo->rq = NULL;
- bo->exec = &_kgem_dummy_exec;
+ bo->exec = NULL;
}
}
@@ -3546,14 +3547,18 @@ uint32_t kgem_add_reloc(struct kgem *kgem,
delta += bo->delta;
assert(bo->handle == bo->proxy->handle);
/* need to release the cache upon batch submit */
- list_move_tail(&bo->request,
- &kgem->next_request->buffers);
- bo->exec = &_kgem_dummy_exec;
+ if (bo->exec == NULL) {
+ list_move_tail(&bo->request,
+ &kgem->next_request->buffers);
+ bo->rq = kgem->next_request;
+ bo->exec = &_kgem_dummy_exec;
+ }
+
bo = bo->proxy;
+ assert(bo->refcnt);
+ assert(!bo->purged);
}
- assert(!bo->purged);
-
if (bo->exec == NULL)
_kgem_add_bo(kgem, bo);
assert(bo->rq == kgem->next_request);
diff --git a/src/sna/kgem.h b/src/sna/kgem.h
index cf7cf70f..583bafca 100644
--- a/src/sna/kgem.h
+++ b/src/sna/kgem.h
@@ -536,15 +536,17 @@ static inline bool kgem_bo_is_dirty(struct kgem_bo *bo)
static inline void kgem_bo_mark_dirty(struct kgem_bo *bo)
{
- if (bo->dirty)
- return;
+ do {
+ if (bo->dirty)
+ return;
- DBG(("%s: handle=%d\n", __FUNCTION__, bo->handle));
+ DBG(("%s: handle=%d\n", __FUNCTION__, bo->handle));
+ assert(bo->exec);
+ assert(bo->rq);
- assert(bo->exec);
- assert(bo->rq);
- bo->needs_flush = bo->dirty = true;
- list_move(&bo->request, &bo->rq->buffers);
+ bo->needs_flush = bo->dirty = true;
+ list_move(&bo->request, &bo->rq->buffers);
+ } while ((bo = bo->proxy));
}
#define KGEM_BUFFER_WRITE 0x1