summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2011-08-10 11:36:16 +0200
committerKeith Packard <keithp@keithp.com>2011-08-10 09:30:08 -0700
commit4020cab88f5cf3164fc83cf912f94f288aa5a45d (patch)
treea009f93811a3610e2d8eee5018a411c5490af4c5
parenta1dec7cd6adabaf8770dc3b21b0df30ce2f0bc8d (diff)
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>
-rw-r--r--exa/exa_mixed.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/exa/exa_mixed.c b/exa/exa_mixed.c
index 58645aea0..0b1a4a4a4 100644
--- a/exa/exa_mixed.c
+++ b/exa/exa_mixed.c
@@ -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 */
- if (has_gpu_copy && pExaPixmap->sys_ptr) {
- free(pExaPixmap->sys_ptr);
- pExaPixmap->sys_ptr = NULL;
- pExaPixmap->sys_pitch = PixmapBytePad(width, depth);
- DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage);
- DamageDestroy(pExaPixmap->pDamage);
- pExaPixmap->pDamage = NULL;
- RegionEmpty(&pExaPixmap->validSys);
+ if (has_gpu_copy) {
+ if (pExaPixmap->sys_ptr) {
+ free(pExaPixmap->sys_ptr);
+ pExaPixmap->sys_ptr = NULL;
+ DamageUnregister(&pPixmap->drawable, pExaPixmap->pDamage);
+ DamageDestroy(pExaPixmap->pDamage);
+ pExaPixmap->pDamage = NULL;
+ RegionEmpty(&pExaPixmap->validSys);
- if (pExaScr->deferred_mixed_pixmap == pPixmap)
- pExaScr->deferred_mixed_pixmap = NULL;
+ if (pExaScr->deferred_mixed_pixmap == pPixmap)
+ pExaScr->deferred_mixed_pixmap = NULL;
+ }
+
+ pExaPixmap->sys_pitch = PixmapBytePad(width, depth);
}
}