summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-03-13 20:01:53 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-03-13 20:01:53 +0000
commit06b28d541bdf2607edc2eb476919b28e747885d8 (patch)
tree567dcca96fdb73a41919a20fa3a913344ae78a1d
parent015db20287ec90f81ddb7eb2e7ce23b90aacfb2b (diff)
sna: Destroy the cached upload buffer if before copying into it
As we discard the buffer after the next batch, we will lose the contents of the pixmap. Instead discard the cache, and treat it as a normal shadow again. References: https://bugs.freedesktop.org/show_bug.cgi?id=42426 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index d5420a33..c9016a19 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -3402,7 +3402,10 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
dst_priv->clear = false;
}
- assert(dst_priv->gpu_bo == NULL || dst_priv->gpu_bo->proxy == NULL);
+ if (dst_priv->gpu_bo && dst_priv->gpu_bo->proxy) {
+ kgem_bo_destroy(&sna->kgem, dst_priv->gpu_bo);
+ dst_priv->gpu_bo = NULL;
+ }
/* Try to maintain the data on the GPU */
if (dst_priv->gpu_bo == NULL &&