diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-01-30 11:40:02 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-01-30 12:05:51 +0000 |
commit | 95f3734dd69b82e007095a599cc21f4c63d6ec00 (patch) | |
tree | 6c2491ad5e0a1996cf594e3bd483c595554a0cb8 | |
parent | 488937edb67a60389380b405f8f8a548f51e64c7 (diff) |
sna: Allow creation of proxies to proxies
Just update the offset of the new bo by the offset of the existing
proxy.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/kgem.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 64f729ba..30c46fb7 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -3105,20 +3105,25 @@ struct kgem_bo *kgem_create_proxy(struct kgem_bo *target, DBG(("%s: target handle=%d, offset=%d, length=%d, io=%d\n", __FUNCTION__, target->handle, offset, length, target->io)); - assert(target->proxy == NULL); bo = __kgem_bo_alloc(target->handle, length); if (bo == NULL) return NULL; + bo->reusable = false; bo->size.bytes = length; + bo->io = target->io; bo->dirty = target->dirty; bo->tiling = target->tiling; bo->pitch = target->pitch; + + if (target->proxy) { + offset += target->delta; + target = target->proxy; + } bo->proxy = kgem_bo_reference(target); bo->delta = offset; - bo->reusable = false; return bo; } |