[PATCH] EXA: Wrap Glyphs even without Composite acceleration.

Michel Dänzer michel at daenzer.net
Thu Apr 22 00:06:40 PDT 2010


From: Michel Dänzer <daenzer at vmware.com>

In order to avoid migration ping-pong when accumulating glyphs in a mask
picture.

Signed-off-by: Michel Dänzer <daenzer at vmware.com>
---
 exa/exa.c         |    5 ++++-
 exa/exa_priv.h    |   11 +++++++++++
 exa/exa_unaccel.c |   22 ++++++++++++++++++++++
 3 files changed, 37 insertions(+), 1 deletions(-)

diff --git a/exa/exa.c b/exa/exa.c
index da37972..7421328 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -932,8 +932,11 @@ exaDriverInit (ScreenPtr		pScreen,
 
     if (ps) {
 	wrap(pExaScr, ps, Composite, exaComposite);
-	if (pScreenInfo->PrepareComposite)
+	if (pScreenInfo->PrepareComposite) {
 	    wrap(pExaScr, ps, Glyphs, exaGlyphs);
+	} else {
+	    wrap(pExaScr, ps, Glyphs, ExaCheckGlyphs);
+	}
 	wrap(pExaScr, ps, Trapezoids, exaTrapezoids);
 	wrap(pExaScr, ps, Triangles, exaTriangles);
 	wrap(pExaScr, ps, AddTraps, ExaCheckAddTraps);
diff --git a/exa/exa_priv.h b/exa/exa_priv.h
index ab4ec32..95389bb 100644
--- a/exa/exa_priv.h
+++ b/exa/exa_priv.h
@@ -516,6 +516,17 @@ ExaCheckComposite (CARD8      op,
 		  CARD16     width,
 		  CARD16     height);
 
+void
+ExaCheckGlyphs (CARD8	      op,
+		PicturePtr    pSrc,
+		PicturePtr    pDst,
+		PictFormatPtr maskFormat,
+		INT16	      xSrc,
+		INT16	      ySrc,
+		int	      nlist,
+		GlyphListPtr  list,
+		GlyphPtr      *glyphs);
+
 /* exa_offscreen.c */
 void
 ExaOffscreenSwapOut (ScreenPtr pScreen);
diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c
index db9ce9f..39d7c04 100644
--- a/exa/exa_unaccel.c
+++ b/exa/exa_unaccel.c
@@ -678,6 +678,28 @@ out_no_clip:
     EXA_POST_FALLBACK(pScreen);
 }
 
+/**
+ * Avoid migration ping-pong when using a mask.
+ */
+void
+ExaCheckGlyphs (CARD8	      op,
+		PicturePtr    pSrc,
+		PicturePtr    pDst,
+		PictFormatPtr maskFormat,
+		INT16	      xSrc,
+		INT16	      ySrc,
+		int	      nlist,
+		GlyphListPtr  list,
+		GlyphPtr      *glyphs)
+{
+    ScreenPtr pScreen = pDst->pDrawable->pScreen;
+    EXA_PRE_FALLBACK(pScreen);
+
+    miGlyphs(op, pSrc, pDst, maskFormat, xSrc, ySrc, nlist, list, glyphs);
+
+    EXA_POST_FALLBACK(pScreen);
+}
+
 void
 ExaCheckAddTraps (PicturePtr	pPicture,
 		  INT16		x_off,
-- 
1.7.0.4



More information about the xorg-devel mailing list