rpms/xorg-x11-server/OLPC-2 exa-firstpixel-tweak.patch,NONE,1.1

Adam Jackson (ajax) fedora-extras-commits at redhat.com
Wed Jul 11 17:55:39 UTC 2007


Author: ajax

Update of /cvs/pkgs/rpms/xorg-x11-server/OLPC-2
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv6992

Added Files:
	exa-firstpixel-tweak.patch 
Log Message:
* Wed Jul 11 2007 Adam Jackson <ajax at redhat.com> 1.3.0.0-13.1
- Test of exa-firstpixel-tweak.patch


exa-firstpixel-tweak.patch:

--- NEW FILE exa-firstpixel-tweak.patch ---
diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c
index 708d1ea..9a991e7 100644
--- a/exa/exa_unaccel.c
+++ b/exa/exa_unaccel.c
@@ -374,26 +374,41 @@ CARD32
 exaGetPixmapFirstPixel (PixmapPtr pPixmap)
 {
     CARD32 pixel;
+    void *fb;
+    Bool need_finish = FALSE;
+    BoxRec box;
     ExaMigrationRec pixmaps[1];
+    ExaPixmapPriv (pPixmap);
+
+    /* 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);
+	}
+    }
 
-    pixmaps[0].as_dst = FALSE;
-    pixmaps[0].as_src = TRUE;
-    pixmaps[0].pPix = pPixmap;
-    exaDoMigration (pixmaps, 1, FALSE);
-
-    exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC);
     switch (pPixmap->drawable.bitsPerPixel) {
     case 32:
-	pixel = *(CARD32 *)(pPixmap->devPrivate.ptr);
+	pixel = *(CARD32 *)fb;
 	break;
     case 16:
-	pixel = *(CARD16 *)(pPixmap->devPrivate.ptr);
+	pixel = *(CARD16 *)fb;
 	break;
     default:
-	pixel = *(CARD8 *)(pPixmap->devPrivate.ptr);
+	pixel = *(CARD8 *)fb;
 	break;
     }
-    exaFinishAccess(&pPixmap->drawable, EXA_PREPARE_SRC);
+
+    if (need_finish)
+	exaFinishAccess(&pPixmap->drawable, EXA_PREPARE_SRC);
 
     return pixel;
 }




More information about the scm-commits mailing list