summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-04-19 10:34:23 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-04-19 10:34:23 +0100
commitcb6a3dc2edf3cd612f833bc9a4656166735ee856 (patch)
tree5f1d24f85ea4cc43ce16fee2415b5ad30d328e21
parent4cf74d409ca63c6a479c1ee2187908c04f3b830b (diff)
sna: Discard proxy upload buffer if we choose to render to it
Even if we try to avoid treating an upload buffer as a real GPU target, we may still choose to migrate the buffer to the GPU in order to keep other buffers on the GPU. In that case, we do want to create a real GPU bo. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 1c43fb76..06bd2c00 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -2288,6 +2288,13 @@ sna_pixmap_move_to_gpu(PixmapPtr pixmap, unsigned flags)
goto active;
}
+ if (flags & MOVE_WRITE && priv->gpu_bo && priv->gpu_bo->proxy) {
+ DBG(("%s: discarding cached upload buffer\n", __FUNCTION__));
+ assert(priv->gpu_bo->proxy->rq);
+ kgem_bo_destroy(&sna->kgem, priv->gpu_bo);
+ priv->gpu_bo = NULL;
+ }
+
if ((flags & MOVE_READ) == 0)
sna_damage_destroy(&priv->cpu_damage);