summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-01-10 17:13:38 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-01-10 17:13:38 +0000
commitca2a07adc45273dc1abeb4b3ba7f88461aaf9c00 (patch)
tree9883407a55f588539a941043d46eff316f62dc0c
parent8dd913fd3a093b54fc024fea2b31a3db2518db8d (diff)
sna: Release the stale GTT mapping after recreating the bo with new tiling
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 6200dd32..fc13dfdb 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -371,10 +371,16 @@ struct kgem_bo *sna_pixmap_change_tiling(PixmapPtr pixmap, uint32_t tiling)
&box, 1)) {
DBG(("%s: copy failed\n", __FUNCTION__));
kgem_bo_destroy(&sna->kgem, bo);
- return false;
+ return NULL;
}
kgem_bo_destroy(&sna->kgem, priv->gpu_bo);
+
+ if (priv->mapped) {
+ pixmap->devPrivate.ptr = NULL;
+ priv->mapped = 0;
+ }
+
return priv->gpu_bo = bo;
}