summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-01-23 22:14:15 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-01-24 01:29:31 +0000
commitec794f7594ae5e2c223b7f7255ff8979d9fb06c1 (patch)
treef320e5d4450a77c22eb2a31286561d8d37cbc732
parent2574a04c940e032fdcf1cd39a0950515e8652471 (diff)
sna: Track a proxy's dirty status upon itself rather than the target
As proxy's are short-lived and are not used outside of the operation for which they are created, dirtied or flushed, we can safely copy the dirty status onto the proxy object itself. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/kgem.c1
-rw-r--r--src/sna/kgem.h4
2 files changed, 1 insertions, 4 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index c0c97bc1..d8a30174 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -2900,6 +2900,7 @@ struct kgem_bo *kgem_create_proxy(struct kgem_bo *target,
return NULL;
bo->io = target->io;
+ bo->dirty = target->dirty;
bo->reusable = false;
bo->proxy = kgem_bo_reference(target);
bo->delta = offset;
diff --git a/src/sna/kgem.h b/src/sna/kgem.h
index 8a861718..652c2d74 100644
--- a/src/sna/kgem.h
+++ b/src/sna/kgem.h
@@ -414,16 +414,12 @@ static inline bool kgem_bo_is_dirty(struct kgem_bo *bo)
if (bo == NULL)
return FALSE;
- if (bo->proxy)
- bo = bo->proxy;
return bo->dirty;
}
static inline void kgem_bo_mark_dirty(struct kgem_bo *bo)
{
DBG_HDR(("%s: handle=%d\n", __FUNCTION__, bo->handle));
- if (bo->proxy)
- bo = bo->proxy;
bo->dirty = true;
}