sna: Ensure we restore the shadow pixels before uploading CPU data

Reported-by: Joe Nahmias <joe@nahmias.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46425
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2012-02-22 09:15:25 +00:00
parent be5df7b5ab
commit b02f866d67
1 changed files with 9 additions and 2 deletions

View File

@ -1618,8 +1618,12 @@ sna_pixmap_move_area_to_gpu(PixmapPtr pixmap, BoxPtr box, unsigned int flags)
if (sna_damage_is_all(&priv->gpu_damage,
pixmap->drawable.width,
pixmap->drawable.height))
pixmap->drawable.height)) {
sna_damage_destroy(&priv->cpu_damage);
priv->undamaged = false;
list_del(&priv->list);
goto done;
}
if (priv->gpu_bo == NULL) {
unsigned flags;
@ -1659,10 +1663,13 @@ sna_pixmap_move_area_to_gpu(PixmapPtr pixmap, BoxPtr box, unsigned int flags)
}
if (priv->mapped) {
pixmap->devPrivate.ptr = NULL;
priv->mapped = false;
}
if (pixmap->devPrivate.ptr == NULL) {
assert(priv->stride);
pixmap->devPrivate.ptr = priv->ptr;
pixmap->devKind = priv->stride;
priv->mapped = false;
}
assert(pixmap->devPrivate.ptr != NULL);