[PATCH 1/9] exa: Remove one of the many calls directly into the fb layer.

Maarten Maathuis madman2003 at gmail.com
Tue Feb 3 15:25:25 PST 2009


---
 exa/exa_accel.c |   32 ++++++--------------------------
 1 files changed, 6 insertions(+), 26 deletions(-)

diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index f72a08a..b70222a 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -149,6 +149,7 @@ exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
     int xoff, yoff;
     int bpp = pDrawable->bitsPerPixel;
     Bool access_prepared = FALSE;
+    Bool ret = TRUE;
 
     if (pExaPixmap->accel_blocked)
 	return FALSE;
@@ -210,33 +211,12 @@ exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
 	src = bits + (y1 - y) * src_stride + (x1 - x) * (bpp / 8);
 	ok = pExaScr->info->UploadToScreen(pPix, x1 + xoff, y1 + yoff,
 					   x2 - x1, y2 - y1, src, src_stride);
-	/* If we fail to accelerate the upload, fall back to using unaccelerated
-	 * fb calls.
+	/* We have to fall back completely, and ignore what has already been completed.
+	 * Messing with the fb layer directly like we used to is completely unacceptable.
 	 */
 	if (!ok) {
-	    FbStip *dst;
-	    FbStride dst_stride;
-	    int	dstBpp;
-	    int	dstXoff, dstYoff;
-
-	    if (!access_prepared) {
-		ExaDoPrepareAccess(pDrawable, EXA_PREPARE_DEST);
-
-		access_prepared = TRUE;
-	    }
-
-	    fbGetStipDrawable(pDrawable, dst, dst_stride, dstBpp,
-			      dstXoff, dstYoff);
-
-	    fbBltStip((FbStip *)bits + (y1 - y) * (src_stride / sizeof(FbStip)),
-		      src_stride / sizeof(FbStip),
-		      (x1 - x) * dstBpp,
-		      dst + (y1 + dstYoff) * dst_stride,
-		      dst_stride,
-		      (x1 + dstXoff) * dstBpp,
-		      (x2 - x1) * dstBpp,
-		      y2 - y1,
-		      GXcopy, FB_ALLONES, dstBpp);
+	    ret = FALSE;
+	    break;
 	}
     }
 
@@ -245,7 +225,7 @@ exaDoPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth, int x, int y,
     else
 	exaMarkSync(pDrawable->pScreen);
 
-    return TRUE;
+    return ret;
 }
 
 static void
-- 
1.6.1.1




More information about the xorg mailing list