summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-01-24 19:58:29 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-01-24 20:01:27 +0000
commitaae19cbc5d0ddcf247451d06e063b2550a7ff16f (patch)
tree66bc3cd9895d8acdc2818d9d588f77c1eb730012
parent5312ee90ad80eda1c6ff72fbef60f77f03094972 (diff)
sna: Only reset devPrivate.ptr if owned by the CPU bo when freeing
If the pixmap is mapped to the GPU bo, we should continue to use the current mapping rather than revoke it. Otherwise if we write to the GPU bo inplace, thereby discarding the CPU bo, we set the pointer we are about to copy to, to NULL. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 6247fa64..46016e0c 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -296,8 +296,9 @@ static void sna_pixmap_free_cpu(struct sna *sna, struct sna_pixmap *priv)
} else
free(priv->ptr);
- priv->pixmap->devPrivate.ptr = priv->ptr = NULL;
- priv->mapped = false;
+ priv->ptr = NULL;
+ if (!priv->mapped)
+ priv->pixmap->devPrivate.ptr = NULL;
}
static Bool sna_destroy_private(PixmapPtr pixmap, struct sna_pixmap *priv)