xserver: Branch 'master' - 5 commits

Michel Dänzer daenzer at kemper.freedesktop.org
Fri Feb 27 07:46:13 PST 2009


 exa/Makefile.am            |    3 --
 exa/exa.c                  |   13 +++++++++
 exa/exa.h                  |   27 ++++++++++++--------
 exa/exa_glyphs.c           |    4 ++-
 exa/exa_offscreen.c        |   59 ++++++++++++++++++++++++++++++++++++++++-----
 exa/exa_priv.h             |    6 ++++
 exa/exa_render.c           |    1 
 exa/exa_unaccel.c          |   21 +++++++++-------
 hw/kdrive/ephyr/ephyr.h    |    1 
 hw/xfree86/exa/Makefile.am |    3 --
 10 files changed, 107 insertions(+), 31 deletions(-)

New commits:
commit 265d20068af5434489752b6dba0bf0065b3cc3ec
Author: Michel Dänzer <daenzer at vmware.com>
Date:   Fri Feb 27 16:41:39 2009 +0100

    EXA: Fix check for whether the glyph we're evicting from the cache is in use.
    
    Since commit f07f18231a921d3ae9dd9b75881c9e58e9e2e235 ('EXA: Allow using
    exaCompositeRects also when we can't use a mask in exaGlyphs.') we were
    checking the wrong set of coordinates in the buffer where glyphs to be rendered
    are accumulated when no mask is used in exaGlyphs.
    
    This fixes occasional glyph corruption which can be corrected with redraws, in
    particular with Qt4.
    
    Thanks to Maarten Maathuis for asking the right question: 'where do we protect
    against evicting glyphs that are still needed?'
    
    Signed-off-by: Michel Dänzer <daenzer at vmware.com>

diff --git a/exa/exa_glyphs.c b/exa/exa_glyphs.c
index 918fd85..d55839c 100644
--- a/exa/exa_glyphs.c
+++ b/exa/exa_glyphs.c
@@ -469,7 +469,9 @@ exaGlyphCacheBufferGlyph(ScreenPtr         pScreen,
 		y = CACHE_Y(pos);
 
 		for (i = 0; i < buffer->count; i++) {
-		    if (buffer->rects[i].xSrc == x && buffer->rects[i].ySrc == y) {
+		    if (pSrc ?
+			(buffer->rects[i].xMask == x && buffer->rects[i].yMask == y) :
+			(buffer->rects[i].xSrc == x && buffer->rects[i].ySrc == y)) {
 			DBG_GLYPH_CACHE(("  must flush buffer\n"));
 			return ExaGlyphNeedFlush;
 		    }
commit 9d5141f7bcfed36417873b47f850332506af83ac
Author: Michel Dänzer <daenzer at vmware.com>
Date:   Fri Feb 27 16:37:28 2009 +0100

    EXA: No longer use the driver UploadToScratch hook.
    
    See http://bugs.freedesktop.org/show_bug.cgi?id=20213 .
    
    Signed-off-by: Michel Dänzer <daenzer at vmware.com>

diff --git a/exa/exa.h b/exa/exa.h
index 12959e1..f3868b8 100644
--- a/exa/exa.h
+++ b/exa/exa.h
@@ -499,27 +499,8 @@ typedef struct _ExaDriver {
                                    int                  src_pitch);
 
     /**
-     * UploadToScratch() is used to upload a pixmap to a scratch area for
-     * acceleration.
-     *
-     * @param pSrc source pixmap in host memory
-     * @param pDst fake, scratch pixmap to be set up in offscreen memory.
-     *
-     * The UploadToScratch() call was added to support Xati before Xati had
-     * support for hostdata uploads and before exaGlyphs() was written.  It
-     * behaves incorrectly (uses an invalid pixmap as pDst),
-     * and UploadToScreen() should be implemented instead.
-     *
-     * Drivers implementing UploadToScratch() had to set up space (likely in a
-     * statically allocated area) in offscreen memory, copy pSrc to that
-     * scratch area, and adust pDst->devKind for the pitch and
-     * pDst->devPrivate.ptr for the pointer to that scratch area.  The driver
-     * was responsible for syncing (as it was implemented using memcpy() in
-     * Xati), and only the data from the last UploadToScratch() was guaranteed
-     * to be valid at any given time.
-     *
-     * UploadToScratch() should not be implemented by drivers, and will likely
-     * be removed in a future version of EXA.
+     * UploadToScratch() is no longer used and will be removed next time the EXA
+     * major version needs to be bumped.
      */
     Bool        (*UploadToScratch) (PixmapPtr           pSrc,
                                     PixmapPtr           pDst);
diff --git a/exa/exa_render.c b/exa/exa_render.c
index 1a5d0ef..a934497 100644
--- a/exa/exa_render.c
+++ b/exa/exa_render.c
@@ -343,7 +343,6 @@ exaTryDriverCompositeRects(CARD8	       op,
     int src_off_x, src_off_y, mask_off_x, mask_off_y, dst_off_x, dst_off_y;
     PixmapPtr pSrcPix, pMaskPix = NULL, pDstPix;
     ExaPixmapPrivPtr pSrcExaPix, pMaskExaPix = NULL, pDstExaPix;
-    struct _Pixmap scratch;
     ExaMigrationRec pixmaps[3];
 
     if (!pExaScr->info->PrepareComposite)
@@ -399,13 +398,6 @@ exaTryDriverCompositeRects(CARD8	       op,
     
     pSrcPix = exaGetOffscreenPixmap (pSrc->pDrawable, &src_off_x, &src_off_y);
 
-    if (!pSrcPix && pExaScr->info->UploadToScratch)
-    {
-	pSrcPix = exaGetDrawablePixmap (pSrc->pDrawable);
-	if ((*pExaScr->info->UploadToScratch) (pSrcPix, &scratch))
-	    pSrcPix = &scratch;
-    }
-
     if (!pSrcPix)
 	return 0;
 
@@ -623,7 +615,6 @@ exaTryDriverComposite(CARD8		op,
     int src_off_x, src_off_y, mask_off_x, mask_off_y, dst_off_x, dst_off_y;
     PixmapPtr pSrcPix, pMaskPix = NULL, pDstPix;
     ExaPixmapPrivPtr pSrcExaPix, pMaskExaPix = NULL, pDstExaPix;
-    struct _Pixmap scratch;
     ExaMigrationRec pixmaps[3];
 
     pSrcPix = exaGetDrawablePixmap(pSrc->pDrawable);
@@ -702,16 +693,6 @@ exaTryDriverComposite(CARD8		op,
 	return 0;
     }
 
-    if (!pSrcPix && (!pMask || pMaskPix) && pExaScr->info->UploadToScratch) {
-	pSrcPix = exaGetDrawablePixmap (pSrc->pDrawable);
-	if ((*pExaScr->info->UploadToScratch) (pSrcPix, &scratch))
-	    pSrcPix = &scratch;
-    } else if (pSrcPix && pMask && !pMaskPix && pExaScr->info->UploadToScratch) {
-	pMaskPix = exaGetDrawablePixmap (pMask->pDrawable);
-	if ((*pExaScr->info->UploadToScratch) (pMaskPix, &scratch))
-	    pMaskPix = &scratch;
-    }
-
     if (!pSrcPix || (pMask && !pMaskPix)) {
 	REGION_UNINIT(pDst->pDrawable->pScreen, &region);
 	return 0;
commit 4cfb36f6ad2df01215028fec48d99239a0e4496b
Author: Michel Dänzer <daenzer at vmware.com>
Date:   Fri Feb 27 16:37:28 2009 +0100

    EXA: Handle separate alpha maps properly in Composite fallback, take two.
    
    Preserve the EXA ABI by introducing a new driver flag EXA_SUPPORTS_PREPARE_AUX.
    If the driver doesn't set this flag, we have to assume any Prepare/FinishAccess
    driver hooks can't handle the EXA_PREPARE_AUX* indices, so we move out such
    pixmaps at PrepareAccess time.
    
    Fixes https://bugs.freedesktop.org/show_bug.cgi?id=18710 .
    
    Signed-off-by: Michel Dänzer <daenzer at vmware.com>

diff --git a/exa/exa.c b/exa/exa.c
index a647699..5425f90 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -538,6 +538,12 @@ ExaDoPrepareAccess(DrawablePtr pDrawable, int index)
     if (pExaScr->info->PrepareAccess == NULL)
 	return;
 
+    if (index >= EXA_PREPARE_AUX0 &&
+	!(pExaScr->info->flags & EXA_SUPPORTS_PREPARE_AUX)) {
+	exaMoveOutPixmap (pPixmap);
+	return;
+    }
+
     if (!(*pExaScr->info->PrepareAccess) (pPixmap, index)) {
 	ExaPixmapPriv (pPixmap);
 	if (pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED)
@@ -597,6 +603,13 @@ exaFinishAccess(DrawablePtr pDrawable, int index)
     if (!exaPixmapIsOffscreen (pPixmap))
 	return;
 
+    if (index >= EXA_PREPARE_AUX0 &&
+	!(pExaScr->info->flags & EXA_SUPPORTS_PREPARE_AUX)) {
+	ErrorF("EXA bug: Trying to call driver FinishAccess hook with "
+	       "unsupported index EXA_PREPARE_AUX*\n");
+	return;
+    }
+
     (*pExaScr->info->FinishAccess) (pPixmap, index);
 }
 
diff --git a/exa/exa.h b/exa/exa.h
index 21a0f1a..12959e1 100644
--- a/exa/exa.h
+++ b/exa/exa.h
@@ -672,6 +672,13 @@ typedef struct _ExaDriver {
 	 * from.
 	 */
 	#define EXA_PREPARE_MASK	2
+	/**
+	 * EXA_PREPARE_AUX* are additional indices for other purposes, e.g.
+	 * separate alpha maps with Composite operations.
+	 */
+	#define EXA_PREPARE_AUX0	3
+	#define EXA_PREPARE_AUX1	4
+	#define EXA_PREPARE_AUX2	5
 	/** @} */
 
     /**
@@ -742,6 +749,13 @@ typedef struct _ExaDriver {
  */
 #define EXA_HANDLES_PIXMAPS             (1 << 3)
 
+/**
+ * EXA_SUPPORTS_PREPARE_AUX indicates to EXA that the driver can handle the
+ * EXA_PREPARE_AUX* indices in the Prepare/FinishAccess hooks. If there are no
+ * such hooks, this flag has no effect.
+ */
+#define EXA_SUPPORTS_PREPARE_AUX        (1 << 4)
+
 /** @} */
 
 /* in exa.c */
diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c
index c821f0d..9a0b0e5 100644
--- a/exa/exa_unaccel.c
+++ b/exa/exa_unaccel.c
@@ -392,6 +392,15 @@ ExaCheckComposite (CARD8      op,
 
     REGION_NULL(pScreen, &region);
 
+    /* We need to prepare access to any separate alpha maps first, in case the
+     * driver doesn't support EXA_PREPARE_AUX*, in which case EXA_PREPARE_SRC
+     * may be used for moving them out.
+     */
+    if (pSrc->alphaMap && pSrc->alphaMap->pDrawable)
+	exaPrepareAccess(pSrc->alphaMap->pDrawable, EXA_PREPARE_AUX2);
+    if (pMask && pMask->alphaMap && pMask->alphaMap->pDrawable)
+	exaPrepareAccess(pMask->alphaMap->pDrawable, EXA_PREPARE_AUX1);
+
     if (!exaOpReadsDestination(op)) {
 	if (!miComputeCompositeRegion (&region, pSrc, pMask, pDst,
 				       xSrc, ySrc, xMask, yMask, xDst, yDst,
@@ -404,9 +413,17 @@ ExaCheckComposite (CARD8      op,
 
 	REGION_TRANSLATE(pScreen, &region, xoff, yoff);
 
+	if (pDst->alphaMap && pDst->alphaMap->pDrawable)
+	    exaPrepareAccessReg(pDst->alphaMap->pDrawable, EXA_PREPARE_AUX0,
+				&region);
+
 	exaPrepareAccessReg (pDst->pDrawable, EXA_PREPARE_DEST, &region);
-    } else
+    } else {
+	if (pDst->alphaMap && pDst->alphaMap->pDrawable)
+	    exaPrepareAccess(pDst->alphaMap->pDrawable, EXA_PREPARE_AUX0);
+
 	exaPrepareAccess (pDst->pDrawable, EXA_PREPARE_DEST);
+    }
 
     EXA_FALLBACK(("from picts %p/%p to pict %p\n",
 		 pSrc, pMask, pDst));
@@ -433,9 +450,15 @@ ExaCheckComposite (CARD8      op,
 #endif /* RENDER */
     if (pMask && pMask->pDrawable != NULL)
 	exaFinishAccess (pMask->pDrawable, EXA_PREPARE_MASK);
+    if (pMask && pMask->alphaMap && pMask->alphaMap->pDrawable)
+	exaFinishAccess(pMask->alphaMap->pDrawable, EXA_PREPARE_AUX1);
     if (pSrc->pDrawable != NULL)
 	exaFinishAccess (pSrc->pDrawable, EXA_PREPARE_SRC);
+    if (pSrc->alphaMap && pSrc->alphaMap->pDrawable)
+	exaFinishAccess(pSrc->alphaMap->pDrawable, EXA_PREPARE_AUX2);
     exaFinishAccess (pDst->pDrawable, EXA_PREPARE_DEST);
+    if (pDst->alphaMap && pDst->alphaMap->pDrawable)
+	exaFinishAccess(pDst->alphaMap->pDrawable, EXA_PREPARE_AUX0);
 
     REGION_UNINIT(pScreen, &region);
 }
commit 4bf707f01822abe99286909fd561da7e7a4211d6
Author: Michel Dänzer <daenzer at vmware.com>
Date:   Fri Feb 27 16:37:27 2009 +0100

    Revert "Fix up Xephyr build for recent EXA changes."
    
    This reverts commit 4e8d98b61e1f763c187e7994c683b543cca1a33c.

diff --git a/hw/kdrive/ephyr/ephyr.h b/hw/kdrive/ephyr/ephyr.h
index b727931..5d58a21 100644
--- a/hw/kdrive/ephyr/ephyr.h
+++ b/hw/kdrive/ephyr/ephyr.h
@@ -33,7 +33,6 @@
 #include "os.h"  		/* for OsSignal() */
 #include "kdrive.h"
 #include "hostx.h"
-#define EXA_DRIVER_KNOWN_MAJOR 3
 #include "exa.h"
 
 #ifdef RANDR
commit de022f8e634baf5a7acd186934b370647df58355
Author: Michel Dänzer <daenzer at vmware.com>
Date:   Fri Feb 27 16:37:27 2009 +0100

    Revert "EXA: Handle separate alpha maps properly in Composite fallback."
    
    This reverts commit 170cf1270dff38d3cce7f5ba5b940d1c0d70eff5.
    
    Conflicts:
    
    	exa/exa_render.c

diff --git a/exa/Makefile.am b/exa/Makefile.am
index 7065e19..2b3f1e4 100644
--- a/exa/Makefile.am
+++ b/exa/Makefile.am
@@ -12,8 +12,7 @@ INCLUDES = \
 	$(XORG_INCS) \
 	-I$(srcdir)/../miext/cw
 
-# Use an arbitrary high major version here to satisfy any driver checks in exa.h
-AM_CFLAGS = $(XORG_CFLAGS) $(DIX_CFLAGS) -DEXA_DRIVER_KNOWN_MAJOR=99
+AM_CFLAGS = $(XORG_CFLAGS) $(DIX_CFLAGS)
 
 libexa_la_SOURCES = \
 	exa.c \
diff --git a/exa/exa.h b/exa/exa.h
index b80d0d4..21a0f1a 100644
--- a/exa/exa.h
+++ b/exa/exa.h
@@ -38,17 +38,8 @@
 #include "picturestr.h"
 #include "fb.h"
 
-/* If the driver can't seem to handle this major version, abort compilation with
- * instructions how to fix it.
- */
-#if !defined(EXA_DRIVER_KNOWN_MAJOR) || EXA_DRIVER_KNOWN_MAJOR < 3
-#error Make sure this EXA driver either does not have Prepare/FinishAccess \
-    hooks or that they can handle EXA_PREPARE_AUX*, and	\
-    #define EXA_DRIVER_KNOWN_MAJOR 3 before including exa.h
-#endif
-
-#define EXA_VERSION_MAJOR   3
-#define EXA_VERSION_MINOR   0
+#define EXA_VERSION_MAJOR   2
+#define EXA_VERSION_MINOR   4
 #define EXA_VERSION_RELEASE 0
 
 typedef struct _ExaOffscreenArea ExaOffscreenArea;
@@ -508,6 +499,32 @@ typedef struct _ExaDriver {
                                    int                  src_pitch);
 
     /**
+     * UploadToScratch() is used to upload a pixmap to a scratch area for
+     * acceleration.
+     *
+     * @param pSrc source pixmap in host memory
+     * @param pDst fake, scratch pixmap to be set up in offscreen memory.
+     *
+     * The UploadToScratch() call was added to support Xati before Xati had
+     * support for hostdata uploads and before exaGlyphs() was written.  It
+     * behaves incorrectly (uses an invalid pixmap as pDst),
+     * and UploadToScreen() should be implemented instead.
+     *
+     * Drivers implementing UploadToScratch() had to set up space (likely in a
+     * statically allocated area) in offscreen memory, copy pSrc to that
+     * scratch area, and adust pDst->devKind for the pitch and
+     * pDst->devPrivate.ptr for the pointer to that scratch area.  The driver
+     * was responsible for syncing (as it was implemented using memcpy() in
+     * Xati), and only the data from the last UploadToScratch() was guaranteed
+     * to be valid at any given time.
+     *
+     * UploadToScratch() should not be implemented by drivers, and will likely
+     * be removed in a future version of EXA.
+     */
+    Bool        (*UploadToScratch) (PixmapPtr           pSrc,
+                                    PixmapPtr           pDst);
+
+    /**
      * DownloadFromScreen() loads a rectangle of data from pSrc into dst
      *
      * @param pSrc source pixmap
@@ -655,13 +672,6 @@ typedef struct _ExaDriver {
 	 * from.
 	 */
 	#define EXA_PREPARE_MASK	2
-	/**
-	 * EXA_PREPARE_AUX* are additional indices for other purposes, e.g.
-	 * separate alpha maps with Composite operations.
-	 */
-	#define EXA_PREPARE_AUX0	3
-	#define EXA_PREPARE_AUX1	4
-	#define EXA_PREPARE_AUX2	5
 	/** @} */
 
     /**
diff --git a/exa/exa_offscreen.c b/exa/exa_offscreen.c
index c45df67..4aaa2c1 100644
--- a/exa/exa_offscreen.c
+++ b/exa/exa_offscreen.c
@@ -285,6 +285,36 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align,
     return area;
 }
 
+/**
+ * Ejects all offscreen areas, and uninitializes the offscreen memory manager.
+ */
+void
+ExaOffscreenSwapOut (ScreenPtr pScreen)
+{
+    ExaScreenPriv (pScreen);
+
+    ExaOffscreenValidate (pScreen);
+    /* loop until a single free area spans the space */
+    for (;;)
+    {
+	ExaOffscreenArea *area = pExaScr->info->offScreenAreas;
+
+	if (!area)
+	    break;
+	if (area->state == ExaOffscreenAvail)
+	{
+	    area = area->next;
+	    if (!area)
+		break;
+	}
+	assert (area->state != ExaOffscreenAvail);
+	(void) ExaOffscreenKickOut (pScreen, area);
+	ExaOffscreenValidate (pScreen);
+    }
+    ExaOffscreenValidate (pScreen);
+    ExaOffscreenFini (pScreen);
+}
+
 /** Ejects all pixmaps managed by EXA. */
 static void
 ExaOffscreenEjectPixmaps (ScreenPtr pScreen)
@@ -314,14 +344,26 @@ ExaOffscreenEjectPixmaps (ScreenPtr pScreen)
     ExaOffscreenValidate (pScreen);
 }
 
+void
+ExaOffscreenSwapIn (ScreenPtr pScreen)
+{
+    exaOffscreenInit (pScreen);
+}
+
 /**
  * Prepares EXA for disabling of FB access, or restoring it.
  *
- * The disabling results in pixmaps being ejected, while other allocations
- * remain.  With this plus the prevention of migration while swappedOut is
- * set, EXA by itself should not cause any access of the framebuffer to occur
- * while swapped out.  Any remaining issues are the responsibility of the
- * driver.
+ * In version 2.1, the disabling results in pixmaps being ejected, while other
+ * allocations remain.  With this plus the prevention of migration while
+ * swappedOut is set, EXA by itself should not cause any access of the
+ * framebuffer to occur while swapped out.  Any remaining issues are the
+ * responsibility of the driver.
+ *
+ * Prior to version 2.1, all allocations, including locked ones, are ejected
+ * when access is disabled, and the allocator is torn down while swappedOut
+ * is set.  This is more drastic, and caused implementation difficulties for
+ * many drivers that could otherwise handle the lack of FB access while
+ * swapped out.
  */
 void
 exaEnableDisableFBAccess (int index, Bool enable)
@@ -330,11 +372,16 @@ exaEnableDisableFBAccess (int index, Bool enable)
     ExaScreenPriv (pScreen);
 
     if (!enable && pExaScr->disableFbCount++ == 0) {
-	ExaOffscreenEjectPixmaps (pScreen);
+	if (pExaScr->info->exa_minor < 1)
+	    ExaOffscreenSwapOut (pScreen);
+	else
+	    ExaOffscreenEjectPixmaps (pScreen);
 	pExaScr->swappedOut = TRUE;
     }
     
     if (enable && --pExaScr->disableFbCount == 0) {
+	if (pExaScr->info->exa_minor < 1)
+	    ExaOffscreenSwapIn (pScreen);
 	pExaScr->swappedOut = FALSE;
     }
 }
diff --git a/exa/exa_priv.h b/exa/exa_priv.h
index 8f83701..a618fb4 100644
--- a/exa/exa_priv.h
+++ b/exa/exa_priv.h
@@ -436,6 +436,12 @@ ExaCheckComposite (CARD8      op,
 #endif
 
 /* exa_offscreen.c */
+void
+ExaOffscreenSwapOut (ScreenPtr pScreen);
+
+void
+ExaOffscreenSwapIn (ScreenPtr pScreen);
+
 Bool
 exaOffscreenInit(ScreenPtr pScreen);
 
diff --git a/exa/exa_render.c b/exa/exa_render.c
index d53f13b..1a5d0ef 100644
--- a/exa/exa_render.c
+++ b/exa/exa_render.c
@@ -343,6 +343,7 @@ exaTryDriverCompositeRects(CARD8	       op,
     int src_off_x, src_off_y, mask_off_x, mask_off_y, dst_off_x, dst_off_y;
     PixmapPtr pSrcPix, pMaskPix = NULL, pDstPix;
     ExaPixmapPrivPtr pSrcExaPix, pMaskExaPix = NULL, pDstExaPix;
+    struct _Pixmap scratch;
     ExaMigrationRec pixmaps[3];
 
     if (!pExaScr->info->PrepareComposite)
@@ -397,6 +398,14 @@ exaTryDriverCompositeRects(CARD8	       op,
 	return 0;
     
     pSrcPix = exaGetOffscreenPixmap (pSrc->pDrawable, &src_off_x, &src_off_y);
+
+    if (!pSrcPix && pExaScr->info->UploadToScratch)
+    {
+	pSrcPix = exaGetDrawablePixmap (pSrc->pDrawable);
+	if ((*pExaScr->info->UploadToScratch) (pSrcPix, &scratch))
+	    pSrcPix = &scratch;
+    }
+
     if (!pSrcPix)
 	return 0;
 
@@ -614,6 +623,7 @@ exaTryDriverComposite(CARD8		op,
     int src_off_x, src_off_y, mask_off_x, mask_off_y, dst_off_x, dst_off_y;
     PixmapPtr pSrcPix, pMaskPix = NULL, pDstPix;
     ExaPixmapPrivPtr pSrcExaPix, pMaskExaPix = NULL, pDstExaPix;
+    struct _Pixmap scratch;
     ExaMigrationRec pixmaps[3];
 
     pSrcPix = exaGetDrawablePixmap(pSrc->pDrawable);
@@ -692,6 +702,16 @@ exaTryDriverComposite(CARD8		op,
 	return 0;
     }
 
+    if (!pSrcPix && (!pMask || pMaskPix) && pExaScr->info->UploadToScratch) {
+	pSrcPix = exaGetDrawablePixmap (pSrc->pDrawable);
+	if ((*pExaScr->info->UploadToScratch) (pSrcPix, &scratch))
+	    pSrcPix = &scratch;
+    } else if (pSrcPix && pMask && !pMaskPix && pExaScr->info->UploadToScratch) {
+	pMaskPix = exaGetDrawablePixmap (pMask->pDrawable);
+	if ((*pExaScr->info->UploadToScratch) (pMaskPix, &scratch))
+	    pMaskPix = &scratch;
+    }
+
     if (!pSrcPix || (pMask && !pMaskPix)) {
 	REGION_UNINIT(pDst->pDrawable->pScreen, &region);
 	return 0;
diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c
index 0c4319f..c821f0d 100644
--- a/exa/exa_unaccel.c
+++ b/exa/exa_unaccel.c
@@ -405,28 +405,16 @@ ExaCheckComposite (CARD8      op,
 	REGION_TRANSLATE(pScreen, &region, xoff, yoff);
 
 	exaPrepareAccessReg (pDst->pDrawable, EXA_PREPARE_DEST, &region);
-
-	if (pDst->alphaMap && pDst->alphaMap->pDrawable)
-	    exaPrepareAccessReg(pDst->alphaMap->pDrawable, EXA_PREPARE_AUX0,
-				&region);
-    } else {
+    } else
 	exaPrepareAccess (pDst->pDrawable, EXA_PREPARE_DEST);
 
-	if (pDst->alphaMap && pDst->alphaMap->pDrawable)
-	    exaPrepareAccess(pDst->alphaMap->pDrawable, EXA_PREPARE_AUX0);
-    }
-
     EXA_FALLBACK(("from picts %p/%p to pict %p\n",
 		 pSrc, pMask, pDst));
 
     if (pSrc->pDrawable != NULL)
 	exaPrepareAccess (pSrc->pDrawable, EXA_PREPARE_SRC);
-    if (pSrc->alphaMap && pSrc->alphaMap->pDrawable)
-	exaPrepareAccess(pSrc->alphaMap->pDrawable, EXA_PREPARE_AUX2);
     if (pMask && pMask->pDrawable != NULL)
 	exaPrepareAccess (pMask->pDrawable, EXA_PREPARE_MASK);
-    if (pMask && pMask->alphaMap && pMask->alphaMap->pDrawable)
-	exaPrepareAccess(pMask->alphaMap->pDrawable, EXA_PREPARE_AUX1);
 #ifdef RENDER
     swap(pExaScr, ps, Composite);
     ps->Composite (op,
@@ -445,15 +433,9 @@ ExaCheckComposite (CARD8      op,
 #endif /* RENDER */
     if (pMask && pMask->pDrawable != NULL)
 	exaFinishAccess (pMask->pDrawable, EXA_PREPARE_MASK);
-    if (pMask && pMask->alphaMap && pMask->alphaMap->pDrawable)
-	exaFinishAccess(pMask->alphaMap->pDrawable, EXA_PREPARE_AUX1);
     if (pSrc->pDrawable != NULL)
 	exaFinishAccess (pSrc->pDrawable, EXA_PREPARE_SRC);
-    if (pSrc->alphaMap && pSrc->alphaMap->pDrawable)
-	exaFinishAccess(pSrc->alphaMap->pDrawable, EXA_PREPARE_AUX2);
     exaFinishAccess (pDst->pDrawable, EXA_PREPARE_DEST);
-    if (pDst->alphaMap && pDst->alphaMap->pDrawable)
-	exaFinishAccess(pDst->alphaMap->pDrawable, EXA_PREPARE_AUX0);
 
     REGION_UNINIT(pScreen, &region);
 }
diff --git a/hw/xfree86/exa/Makefile.am b/hw/xfree86/exa/Makefile.am
index 9fb5151..9eb2e17 100644
--- a/hw/xfree86/exa/Makefile.am
+++ b/hw/xfree86/exa/Makefile.am
@@ -7,8 +7,7 @@ INCLUDES = \
 	-I$(srcdir)/../../../exa \
 	-I$(srcdir)/../../../miext/cw
 
-# Use an arbitrary high major version here to satisfy any driver checks in exa.h
-AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) -DEXA_DRIVER_KNOWN_MAJOR=99
+AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS)
 
 libexa_la_SOURCES = \
 	examodule.c


More information about the xorg-commit mailing list