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>
This commit is contained in:
Chris Wilson 2012-03-13 20:01:53 +00:00
parent 015db20287
commit 06b28d541b
1 changed files with 4 additions and 1 deletions

View File

@ -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 &&