EXA/mixed: Update sys_pitch in MPH even when there's no system memory copy.
Otherwise sys_pitch will be stale when a system memory copy is allocated. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=38322 and a crash when unlocking the screen with xscreensaver, reported by Janne Huttunen. Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Tested-by: Janne Huttunen <jahuttun@gmail.com> Tested-by: Jan Kriho <Erbureth@gmail.com> Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
a1dec7cd6a
commit
4020cab88f
|
@ -186,17 +186,20 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Need to re-create system copy if there's also a GPU copy */
|
/* Need to re-create system copy if there's also a GPU copy */
|
||||||
if (has_gpu_copy && pExaPixmap->sys_ptr) {
|
if (has_gpu_copy) {
|
||||||
free(pExaPixmap->sys_ptr);
|
if (pExaPixmap->sys_ptr) {
|
||||||
pExaPixmap->sys_ptr = NULL;
|
free(pExaPixmap->sys_ptr);
|
||||||
pExaPixmap->sys_pitch = PixmapBytePad(width, depth);
|
pExaPixmap->sys_ptr = NULL;
|
||||||
DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage);
|
DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage);
|
||||||
DamageDestroy(pExaPixmap->pDamage);
|
DamageDestroy(pExaPixmap->pDamage);
|
||||||
pExaPixmap->pDamage = NULL;
|
pExaPixmap->pDamage = NULL;
|
||||||
RegionEmpty(&pExaPixmap->validSys);
|
RegionEmpty(&pExaPixmap->validSys);
|
||||||
|
|
||||||
if (pExaScr->deferred_mixed_pixmap == pPixmap)
|
if (pExaScr->deferred_mixed_pixmap == pPixmap)
|
||||||
pExaScr->deferred_mixed_pixmap = NULL;
|
pExaScr->deferred_mixed_pixmap = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
pExaPixmap->sys_pitch = PixmapBytePad(width, depth);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user