summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-07-06 13:02:53 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2011-07-06 13:06:17 +0100
commit0be47f459ba576ed3f93367de18732fb2367357a (patch)
tree6e227070bcabe0a5e331a820663d7b0e0afc188f
parentf6573fe7577e00a1d2706dbc39179ab658c021d2 (diff)
sna: Check against an execbuffer reference before discarding partials
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/kgem.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 4ae50bf7..dfac9763 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -983,7 +983,7 @@ static void kgem_expire_partial(struct kgem *kgem)
struct kgem_partial_bo *bo, *next;
list_for_each_entry_safe(bo, next, &kgem->partial, base.list) {
- if (bo->base.refcnt > 1)
+ if (bo->base.refcnt > 1 || bo->base.exec)
continue;
DBG(("%s: discarding unused partial array: %d/%d\n",
@@ -1785,7 +1785,7 @@ struct kgem_bo *kgem_create_buffer(struct kgem *kgem,
if (bo->write != write)
continue;
- if (bo->base.refcnt == 1)
+ if (bo->base.refcnt == 1 && bo->base.exec == NULL)
/* no users, so reset */
bo->used = 0;