From ec794f7594ae5e2c223b7f7255ff8979d9fb06c1 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 23 Jan 2012 22:14:15 +0000 Subject: [PATCH] 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 --- src/sna/kgem.c | 1 + src/sna/kgem.h | 4 ---- 2 files changed, 1 insertion(+), 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; }