[PATCH] Make EXA more robust in absense of Copy and Solid hooks

Bernardo Innocenti bernie at codewiz.org
Sun May 27 19:17:04 PDT 2007


In a few places, the generic EXA layer assumed that the
driver provides acceleration callbacks for the Copy and
Solid operations.  I ran into this by disabling the
hooks to debug a driver.

Signed-off-by: Bernardo Innocenti <bernie at codewiz.org>
---
 exa/exa_accel.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/exa/exa_accel.c b/exa/exa_accel.c
index bf63f2c..1b9f6a6 100644
--- a/exa/exa_accel.c
+++ b/exa/exa_accel.c
@@ -410,6 +410,9 @@ exaCopyNtoN (DrawablePtr    pSrcDrawable,
 	exaDoMigration (pixmaps, 2, TRUE);
     }
 
+    if (!pExaScr->info->PrepareCopy)
+	fallback = TRUE;
+
     /* Mixed directions must be handled specially if the card is lame */
     if (!fallback && (pExaScr->info->flags & EXA_TWO_BITBLT_DIRECTIONS) &&
 	reverse != upsidedown) {
@@ -1092,8 +1095,9 @@ exaFillRegionSolid (DrawablePtr	pDrawable,
     pixmaps[0].as_dst = TRUE;
     pixmaps[0].as_src = FALSE;
     pixmaps[0].pPix = pPixmap = exaGetDrawablePixmap (pDrawable);
- 
-    if (pPixmap->drawable.width > pExaScr->info->maxX ||
+
+    if (!pExaScr->info->Solid ||
+	pPixmap->drawable.width  > pExaScr->info->maxX ||
 	pPixmap->drawable.height > pExaScr->info->maxY)
     {
 	goto fallback;
@@ -1186,6 +1190,9 @@ exaFillRegionTiled (DrawablePtr	pDrawable,
     if (!exaPixmapIsOffscreen(pTile))
 	goto fallback;
 
+    if (!pExaScr->info->PrepareCopy)
+	goto fallback;
+
     if ((*pExaScr->info->PrepareCopy) (exaGetOffscreenPixmap((DrawablePtr)pTile,
 							     &tileXoff, &tileYoff),
 				       pPixmap, 0, 0, alu, planemask))
-- 
1.5.0.6

-- 
   // Bernardo Innocenti
 \X/  http://www.codewiz.org/



More information about the xorg mailing list