xf86-video-intel: src/sna/kgem.c src/sna/kgem.h
Chris Wilson
ickle at kemper.freedesktop.org
Mon Aug 20 16:41:09 PDT 2012
src/sna/kgem.c | 17 +++++++++++------
src/sna/kgem.h | 16 +++++++++-------
2 files changed, 20 insertions(+), 13 deletions(-)
New commits:
commit 4ee2e227ddf61c87f08f55d4922d2562b563ca87
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Tue Aug 21 00:28:40 2012 +0100
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 at chris-wilson.co.uk>
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 49e27d0..7498e73 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 cf7cf70..583bafc 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
More information about the xorg-commit
mailing list