summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-01-05 21:39:24 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-01-05 23:44:13 +0000
commitd4dad6e3723d70d78247f29f86079862af175266 (patch)
tree73d3b7e1eb86124cc4ad5c4d440993df7b3ac7c2
parent352f0a3ffb8ae8503bb2fab779ea84f4e6d76317 (diff)
sna: Check that the GTT is no longer mapped before ensuring the shadow pointer
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 9bf21fb6..598e0ce8 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1968,6 +1968,11 @@ sna_put_zpixmap_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region,
kgem_bo_sync__cpu(&sna->kgem, priv->cpu_bo);
}
+ if (priv->mapped) {
+ pixmap->devPrivate.ptr = NULL;
+ priv->mapped = 0;
+ }
+
if (pixmap->devPrivate.ptr == NULL &&
!sna_pixmap_alloc_cpu(sna, pixmap, priv, false))
return true;
@@ -9560,6 +9565,11 @@ sna_pixmap_free_gpu(struct sna *sna, struct sna_pixmap *priv)
assert (!priv->flush);
+ if (priv->mapped) {
+ pixmap->devPrivate.ptr = NULL;
+ priv->mapped = 0;
+ }
+
if (pixmap->devPrivate.ptr == NULL &&
!sna_pixmap_alloc_cpu(sna, pixmap, priv, priv->gpu_damage != NULL))
return false;