exa/mixed: fix gnome-panel corruption
- A mapped pixmap can't be used for acceleration, any decent memory manager will refuse this. - Source pixmaps migrated with a bounding region are incomplete (from the gpu point of view), so do the upload unconditionally, instead of just for deferred destination pixmaps. - Fixes fd.o bug #26076. Signed-off-by: Maarten Maathuis <madman2003@gmail.com> Acked-by: Michel Dänzer <michel@daenzer.net> Signed-off-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
parent
5b9a52be7e
commit
9623daad7c
|
@ -165,8 +165,20 @@ void
|
||||||
exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg)
|
exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg)
|
||||||
{
|
{
|
||||||
ExaPixmapPriv(pPixmap);
|
ExaPixmapPriv(pPixmap);
|
||||||
|
Bool success;
|
||||||
|
|
||||||
if (!ExaDoPrepareAccess(pPixmap, index)) {
|
if ((success = ExaDoPrepareAccess(pPixmap, index)) &&
|
||||||
|
pExaPixmap->pDamage && exaPixmapHasGpuCopy(pPixmap)) {
|
||||||
|
/* You cannot do accelerated operations while a buffer is mapped. */
|
||||||
|
exaFinishAccess(&pPixmap->drawable, index);
|
||||||
|
/* Update the gpu view of both deferred destination pixmaps and of
|
||||||
|
* source pixmaps that were migrated with a bounding region.
|
||||||
|
*/
|
||||||
|
exaMoveInPixmap_mixed(pPixmap);
|
||||||
|
success = ExaDoPrepareAccess(pPixmap, index);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!success) {
|
||||||
Bool has_gpu_copy = exaPixmapHasGpuCopy(pPixmap);
|
Bool has_gpu_copy = exaPixmapHasGpuCopy(pPixmap);
|
||||||
ExaMigrationRec pixmaps[1];
|
ExaMigrationRec pixmaps[1];
|
||||||
|
|
||||||
|
@ -231,13 +243,6 @@ exaPrepareAccessReg_mixed(PixmapPtr pPixmap, int index, RegionPtr pReg)
|
||||||
/* We have a gpu pixmap that can be accessed, we don't need the cpu copy
|
/* We have a gpu pixmap that can be accessed, we don't need the cpu copy
|
||||||
* anymore. Drivers that prefer DFS, should fail prepare access. */
|
* anymore. Drivers that prefer DFS, should fail prepare access. */
|
||||||
} else if (pExaPixmap->pDamage && exaPixmapHasGpuCopy(pPixmap)) {
|
} else if (pExaPixmap->pDamage && exaPixmapHasGpuCopy(pPixmap)) {
|
||||||
ExaScreenPriv(pPixmap->drawable.pScreen);
|
|
||||||
|
|
||||||
/* Copy back any deferred content if needed. */
|
|
||||||
if (pExaScr->deferred_mixed_pixmap &&
|
|
||||||
pExaScr->deferred_mixed_pixmap == pPixmap)
|
|
||||||
exaMoveInPixmap_mixed(pPixmap);
|
|
||||||
|
|
||||||
DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage);
|
DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage);
|
||||||
DamageDestroy(pExaPixmap->pDamage);
|
DamageDestroy(pExaPixmap->pDamage);
|
||||||
pExaPixmap->pDamage = NULL;
|
pExaPixmap->pDamage = NULL;
|
||||||
|
|
Loading…
Reference in New Issue