summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-05-18 20:09:41 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-05-18 21:08:24 +0100
commitf91dcc44dcc15850f82666b1bcdd27182400e7dc (patch)
tree5a4d0d74bc61e01090a84c47469eedb9d082eafd
parentee073d613bba38f90951405d5ecddfcf3ac5e043 (diff)
sna: Give the proxy a unique name
So that if we cache the current destination bo (for example, gen3) then a new proxy (or even just a new batchbuffer) will indeed cause the destination buffer to be updated. Reported-and-tested-by: Clemens Eisserer <linuxhippy@gmail.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48636 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/kgem.c6
-rw-r--r--src/sna/kgem.h3
-rw-r--r--src/sna/sna_gradient.c11
-rw-r--r--src/sna/sna_render.c6
4 files changed, 16 insertions, 10 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index df69b903..470dd243 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -3499,7 +3499,8 @@ void kgem_clear_dirty(struct kgem *kgem)
}
}
-struct kgem_bo *kgem_create_proxy(struct kgem_bo *target,
+struct kgem_bo *kgem_create_proxy(struct kgem *kgem,
+ struct kgem_bo *target,
int offset, int length)
{
struct kgem_bo *bo;
@@ -3512,6 +3513,7 @@ struct kgem_bo *kgem_create_proxy(struct kgem_bo *target,
if (bo == NULL)
return NULL;
+ bo->unique_id = kgem_get_unique_id(kgem);
bo->reusable = false;
bo->size.bytes = length;
@@ -3903,7 +3905,7 @@ done:
bo->used = ALIGN(bo->used, 64);
assert(bo->mem);
*ret = (char *)bo->mem + offset;
- return kgem_create_proxy(&bo->base, offset, size);
+ return kgem_create_proxy(kgem, &bo->base, offset, size);
}
bool kgem_buffer_is_inplace(struct kgem_bo *_bo)
diff --git a/src/sna/kgem.h b/src/sna/kgem.h
index 0c266300..0a95da74 100644
--- a/src/sna/kgem.h
+++ b/src/sna/kgem.h
@@ -195,7 +195,8 @@ struct kgem_bo *kgem_create_map(struct kgem *kgem,
struct kgem_bo *kgem_create_for_name(struct kgem *kgem, uint32_t name);
struct kgem_bo *kgem_create_linear(struct kgem *kgem, int size, unsigned flags);
-struct kgem_bo *kgem_create_proxy(struct kgem_bo *target,
+struct kgem_bo *kgem_create_proxy(struct kgem *kgem,
+ struct kgem_bo *target,
int offset, int length);
struct kgem_bo *kgem_upload_source_image(struct kgem *kgem,
diff --git a/src/sna/sna_gradient.c b/src/sna/sna_gradient.c
index 32d26c8d..a52cfb51 100644
--- a/src/sna/sna_gradient.c
+++ b/src/sna/sna_gradient.c
@@ -258,7 +258,8 @@ sna_render_finish_solid(struct sna *sna, bool force)
DBG(("sna_render_finish_solid reset\n"));
cache->cache_bo = kgem_create_linear(&sna->kgem, sizeof(cache->color), 0);
- cache->bo[0] = kgem_create_proxy(cache->cache_bo, 0, sizeof(uint32_t));
+ cache->bo[0] = kgem_create_proxy(&sna->kgem, cache->cache_bo,
+ 0, sizeof(uint32_t));
cache->bo[0]->pitch = 4;
if (force)
cache->size = 1;
@@ -308,7 +309,7 @@ sna_render_get_solid(struct sna *sna, uint32_t color)
DBG(("sna_render_get_solid(%d) = %x (new)\n", i, color));
create:
- cache->bo[i] = kgem_create_proxy(cache->cache_bo,
+ cache->bo[i] = kgem_create_proxy(&sna->kgem, cache->cache_bo,
i*sizeof(uint32_t), sizeof(uint32_t));
cache->bo[i]->pitch = 4;
@@ -331,7 +332,8 @@ static Bool sna_alpha_cache_init(struct sna *sna)
for (i = 0; i < 256; i++) {
color[i] = i << 24;
- cache->bo[i] = kgem_create_proxy(cache->cache_bo,
+ cache->bo[i] = kgem_create_proxy(&sna->kgem,
+ cache->cache_bo,
sizeof(uint32_t)*i,
sizeof(uint32_t));
cache->bo[i]->pitch = 4;
@@ -356,7 +358,8 @@ static Bool sna_solid_cache_init(struct sna *sna)
* zeroth slot simplifies some of the checks.
*/
cache->color[0] = 0xffffffff;
- cache->bo[0] = kgem_create_proxy(cache->cache_bo, 0, sizeof(uint32_t));
+ cache->bo[0] = kgem_create_proxy(&sna->kgem, cache->cache_bo,
+ 0, sizeof(uint32_t));
cache->bo[0]->pitch = 4;
cache->dirty = 1;
cache->size = 1;
diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c
index 880e1734..7feaa24f 100644
--- a/src/sna/sna_render.c
+++ b/src/sna/sna_render.c
@@ -870,7 +870,7 @@ sna_render_pixmap_partial(struct sna *sna,
}
/* How many tiles across are we? */
- channel->bo = kgem_create_proxy(bo,
+ channel->bo = kgem_create_proxy(&sna->kgem, bo,
box.y1 * bo->pitch + offset,
h * bo->pitch);
if (channel->bo == NULL)
@@ -989,7 +989,7 @@ sna_render_picture_partial(struct sna *sna,
return 0;
/* How many tiles across are we? */
- channel->bo = kgem_create_proxy(bo,
+ channel->bo = kgem_create_proxy(&sna->kgem, bo,
box.y1 * bo->pitch + offset,
h * bo->pitch);
if (channel->bo == NULL)
@@ -1821,7 +1821,7 @@ sna_render_composite_redirect(struct sna *sna,
}
/* How many tiles across are we? */
- op->dst.bo = kgem_create_proxy(op->dst.bo,
+ op->dst.bo = kgem_create_proxy(&sna->kgem, op->dst.bo,
box.y1 * op->dst.bo->pitch + offset,
h * op->dst.bo->pitch);
if (!op->dst.bo) {