[PATCH 1/6] exa: simplify exaPixmapIsOffscreen

Maarten Maathuis madman2003 at gmail.com
Sat Feb 28 16:36:30 PST 2009


- This includes properly handling the framebuffer.
---
 exa/exa.c |   19 ++++++++-----------
 1 files changed, 8 insertions(+), 11 deletions(-)

diff --git a/exa/exa.c b/exa/exa.c
index 994a67a..b0a26e9 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -424,6 +424,13 @@ exaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, int depth,
         if (devKind > 0)
             pExaPixmap->sys_pitch = devKind;
 
+	/* Is this the framebuffer (for classic exa)? */
+	if (pPixData && pPixData == pExaScr->info->memoryBase) {
+	    pExaPixmap->fb_ptr = pPixData;
+	    pExaPixmap->fb_pitch = devKind;
+	    pExaPixmap->offscreen = TRUE;
+	}
+
         if (width > 0 && height > 0 && bitsPerPixel > 0) {
             exaSetFbPitch(pExaScr, pExaPixmap,
                           width, height, bitsPerPixel);
@@ -471,22 +478,12 @@ exaPixmapIsOffscreen(PixmapPtr p)
     ScreenPtr	pScreen = p->drawable.pScreen;
     ExaScreenPriv(pScreen);
     ExaPixmapPriv(p);
-    void *save_ptr;
     Bool ret;
 
-    save_ptr = p->devPrivate.ptr;
-
-    if (!save_ptr && pExaPixmap && !(pExaScr->info->flags & EXA_HANDLES_PIXMAPS))
-	p->devPrivate.ptr = ExaGetPixmapAddress(p);
-
     if (pExaScr->info->PixmapIsOffscreen)
 	ret = pExaScr->info->PixmapIsOffscreen(p);
     else
-       ret = ((unsigned long) ((CARD8 *) p->devPrivate.ptr -
-			       (CARD8 *) pExaScr->info->memoryBase) <
-	      pExaScr->info->memorySize);
-
-    p->devPrivate.ptr = save_ptr;
+	ret = (pExaPixmap->offscreen && pExaPixmap->fb_ptr);
 
     return ret;
 }
-- 
1.6.1.3



More information about the xorg-devel mailing list