summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-01-05 21:33:26 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-01-05 23:44:13 +0000
commit352f0a3ffb8ae8503bb2fab779ea84f4e6d76317 (patch)
tree89c200cc8f922745450d390d097106376df08417
parent3061382f98c0b284c250c1a36f7a4fee22046664 (diff)
sna: Only mark the pixmap as GTT mapped if the private owns the pixels
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_accel.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 77288ff0..9bf21fb6 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1914,11 +1914,13 @@ sna_put_zpixmap_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region,
}
/* And mark as having a valid GTT mapping for future uploads */
- pixmap->devPrivate.ptr =
- kgem_bo_map(&sna->kgem, priv->gpu_bo, PROT_WRITE);
- if (pixmap->devPrivate.ptr) {
- priv->mapped = 1;
- pixmap->devKind = priv->gpu_bo->pitch;
+ if (priv->stride) {
+ pixmap->devPrivate.ptr =
+ kgem_bo_map(&sna->kgem, priv->gpu_bo, PROT_WRITE);
+ if (pixmap->devPrivate.ptr) {
+ priv->mapped = 1;
+ pixmap->devKind = priv->gpu_bo->pitch;
+ }
}
return true;