sna: Only mark the pixmap as GTT mapped if the private owns the pixels

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-01-05 21:33:26 +00:00
parent 3061382f98
commit 352f0a3ffb
1 changed files with 7 additions and 5 deletions

View File

@ -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;