summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/sna/sna_accel.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index aab85d85..c8fcc75b 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1215,8 +1215,17 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
if (sna_damage_is_all(&priv->cpu_damage,
pixmap->drawable.width,
- pixmap->drawable.height))
+ pixmap->drawable.height)) {
+ sna_damage_destroy(&priv->gpu_damage);
+ sna_pixmap_free_gpu(sna, priv);
+ priv->undamaged = false;
+
+ if (pixmap->devPrivate.ptr == NULL &&
+ !sna_pixmap_alloc_cpu(sna, pixmap, priv, false))
+ return false;
+
goto out;
+ }
if (priv->clear)
return _sna_pixmap_move_to_cpu(pixmap, flags);