diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-03-12 15:12:59 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-03-12 15:12:59 +0000 |
commit | 09862a85eba243babde9ca721ca6521566f5c082 (patch) | |
tree | c2d44c03ee2c169bbfe9be0a79ba42a43cfb6745 /src/sna | |
parent | 4f8fba31d7317248e0d4710ef5553dc1f9593314 (diff) |
sna: Mark redirect proxies with a unique id
This helps gen3 in particular as it uses the unique_id field of a bo to
detect changes in render target.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna')
-rw-r--r-- | src/sna/gen3_render.c | 2 | ||||
-rw-r--r-- | src/sna/kgem.c | 2 | ||||
-rw-r--r-- | src/sna/kgem.h | 2 | ||||
-rw-r--r-- | src/sna/sna_render.c | 1 |
4 files changed, 6 insertions, 1 deletions
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c index 3313e3e2..28b950fe 100644 --- a/src/sna/gen3_render.c +++ b/src/sna/gen3_render.c @@ -3215,6 +3215,8 @@ gen3_composite_set_target(struct sna *sna, if (op->dst.bo == NULL) return false; + assert(op->dst.bo->unique_id); + /* For single-stream mode there should be no minimum alignment * required, except that the width must be at least 2 elements. */ diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 20326798..8d3e9df7 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -1198,7 +1198,7 @@ void kgem_init(struct kgem *kgem, int fd, struct pci_device *dev, unsigned gen) } /* XXX hopefully a good approximation */ -static uint32_t kgem_get_unique_id(struct kgem *kgem) +uint32_t kgem_get_unique_id(struct kgem *kgem) { uint32_t id; id = ++kgem->unique_id; diff --git a/src/sna/kgem.h b/src/sna/kgem.h index d6940afe..82f9b522 100644 --- a/src/sna/kgem.h +++ b/src/sna/kgem.h @@ -249,6 +249,8 @@ unsigned kgem_can_create_2d(struct kgem *kgem, int width, int height, int depth) #define KGEM_CAN_CREATE_LARGE 0x4 #define KGEM_CAN_CREATE_GTT 0x8 +uint32_t kgem_get_unique_id(struct kgem *kgem); + struct kgem_bo * kgem_replace_bo(struct kgem *kgem, struct kgem_bo *src, diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c index 4bfd9391..a9297508 100644 --- a/src/sna/sna_render.c +++ b/src/sna/sna_render.c @@ -1970,6 +1970,7 @@ sna_render_composite_redirect(struct sna *sna, } assert(op->dst.bo != t->real_bo); + op->dst.bo->unique_id = kgem_unique_id(&sna->kgem); op->dst.bo->pitch = t->real_bo->pitch; op->dst.x -= box.x1; |