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>
This commit is contained in:
parent
2574a04c94
commit
ec794f7594
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue