summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-05-03 14:53:29 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-05-03 14:48:27 +0100
commita1f08b8850616952fb0babe2275eb36b13a380ec (patch)
tree93c8a423db18dc3ebce65d908ad658791cc3bfdd
parentfcccc5528b8696fb4f9b3f9f528673b95d98a907 (diff)
sna: Don't discard GPU buffer if we only want to read back for the operation
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index c84b23ec..30723456 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1315,9 +1315,11 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
pixmap->drawable.width,
pixmap->drawable.height)) {
sna_damage_destroy(&priv->gpu_damage);
- sna_pixmap_free_gpu(sna, priv);
priv->undamaged = false;
+ if (flags & MOVE_WRITE)
+ sna_pixmap_free_gpu(sna, priv);
+
if (pixmap->devPrivate.ptr == NULL &&
!sna_pixmap_alloc_cpu(sna, pixmap, priv, false))
return false;
@@ -1458,8 +1460,10 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
!sna_pixmap_alloc_cpu(sna, pixmap, priv, priv->gpu_damage != NULL))
return false;
- if (priv->gpu_bo == NULL)
+ if (priv->gpu_bo == NULL) {
+ assert(priv->gpu_damage == NULL);
goto done;
+ }
assert(priv->gpu_bo->proxy == NULL);
if (priv->clear) {