xserver: Branch 'master'

Fredrik Höglund fredrik at kemper.freedesktop.org
Sat Aug 18 10:18:55 PDT 2007


 exa/exa_unaccel.c |   24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

New commits:
diff-tree 3c448b0eb67337b56641e09a6d168aad6745e3ef (from 23fbd5292d356067e85e1eec4eb4f743532b0503)
Author: Fredrik Höglund <fredrik at kde.org>
Date:   Sat Aug 18 19:02:18 2007 +0200

    EXA: Fix a couple of logic errors in exaGetPixmapFirstPixel.
    
    The fb pointer would be left uninitialized when exaPixmapIsOffscreen
    returned false. When it returned true and the pixmap was damaged,
    fb would be initialized from the pixmap's devPrivate.ptr before the
    exaDoMigration and exaPrepareAccess calls, at which point
    devPrivate.ptr would still be pointing at offscreen memory.

diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c
index b67ea63..a94648b 100644
--- a/exa/exa_unaccel.c
+++ b/exa/exa_unaccel.c
@@ -382,19 +382,19 @@ exaGetPixmapFirstPixel (PixmapPtr pPixma
     ExaMigrationRec pixmaps[1];
     ExaPixmapPriv (pPixmap);
 
+    fb = pExaPixmap->sys_ptr;
+
     /* Try to avoid framebuffer readbacks */
-    if (exaPixmapIsOffscreen(pPixmap)) {
-	if (!miPointInRegion(DamageRegion(pExaPixmap->pDamage), 0, 0,  &box)) {
-	    fb = pExaPixmap->sys_ptr;
-	} else {
-	    need_finish = TRUE;
-	    fb = pPixmap->devPrivate.ptr;
-	    pixmaps[0].as_dst = FALSE;
-	    pixmaps[0].as_src = TRUE;
-	    pixmaps[0].pPix = pPixmap;
-	    exaDoMigration (pixmaps, 1, FALSE);
-	    exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC);
-	}
+    if (exaPixmapIsOffscreen(pPixmap) &&
+        miPointInRegion(DamageRegion(pExaPixmap->pDamage), 0, 0,  &box))
+    {
+	need_finish = TRUE;
+	pixmaps[0].as_dst = FALSE;
+	pixmaps[0].as_src = TRUE;
+	pixmaps[0].pPix = pPixmap;
+	exaDoMigration (pixmaps, 1, FALSE);
+	exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC);
+	fb = pPixmap->devPrivate.ptr;
     }
 
     switch (pPixmap->drawable.bitsPerPixel) {


More information about the xorg-commit mailing list