[PATCH xserver] EXA/mixed: Update sys_pitch in MPH even when there's no system memory copy.

Michel Dänzer michel at daenzer.net
Tue Aug 9 02:34:26 PDT 2011


From: Michel Dänzer <michel.daenzer at amd.com>

Otherwise sys_pitch will be stale when a system memory copy is allocated.

Fixes a crash when unlocking the screen with xscreensaver, reported by Janne
Huttunen.

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
Tested-by: Janne Huttunen <jahuttun at gmail.com>
Signed-off-by: Michel Dänzer <michel at daenzer.net>
---
 exa/exa_mixed.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/exa/exa_mixed.c b/exa/exa_mixed.c
index fd1afb2..ff9f30e 100644
--- a/exa/exa_mixed.c
+++ b/exa/exa_mixed.c
@@ -185,11 +185,12 @@ exaModifyPixmapHeader_mixed(PixmapPtr pPixmap, int width, int height, int depth,
             RegionEmpty(&pExaPixmap->validFB);
         }
 
+	pExaPixmap->sys_pitch = PixmapBytePad(width, 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;
-- 
1.7.5.4



More information about the xorg-devel mailing list