From 06b28d541bdf2607edc2eb476919b28e747885d8 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Tue, 13 Mar 2012 20:01:53 +0000 Subject: [PATCH] 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 --- src/sna/sna_accel.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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 &&