[PATCH 3/4] XAA: Move SYNC_CHECK into XAA_GC_OP_PROLOGUE.

Jamey Sharp jamey at minilop.net
Sat Oct 1 23:36:56 PDT 2011


Since every fallback checks whether it needs to sync, just do it in the
prologue, like the pixmap ops do.

Signed-off-by: Jamey Sharp <jamey at minilop.net>
---
 hw/xfree86/xaa/xaaFallback.c |   20 --------------------
 hw/xfree86/xaa/xaawrap.h     |    6 ++++--
 2 files changed, 4 insertions(+), 22 deletions(-)

diff --git a/hw/xfree86/xaa/xaaFallback.c b/hw/xfree86/xaa/xaaFallback.c
index 4a1b1dd..1b05d96 100644
--- a/hw/xfree86/xaa/xaaFallback.c
+++ b/hw/xfree86/xaa/xaaFallback.c
@@ -28,7 +28,6 @@ XAAFillSpansFallback(
     int fSorted )
 {
     XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
     (*pGC->ops->FillSpans)(pDraw, pGC, nInit, pptInit, pwidthInit, fSorted);
     XAA_GC_OP_EPILOGUE(pGC);
 }
@@ -44,7 +43,6 @@ XAASetSpansFallback(
     int			fSorted )
 {
     XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
     (*pGC->ops->SetSpans)(pDraw, pGC, pcharsrc, ppt, pwidth, nspans, fSorted);
     XAA_GC_OP_EPILOGUE(pGC);
 }
@@ -60,7 +58,6 @@ XAAPutImageFallback(
     char 	*pImage )
 {
     XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
     (*pGC->ops->PutImage)(pDraw, pGC, depth, x, y, w, h, 
 		leftPad, format, pImage);
     XAA_GC_OP_EPILOGUE(pGC);
@@ -78,7 +75,6 @@ XAACopyAreaFallback(
     RegionPtr ret;
 
     XAA_GC_OP_PROLOGUE(pGC);
-    SYNC_CHECK(pGC);
     ret = (*pGC->ops->CopyArea)(pSrc, pDst,
             pGC, srcx, srcy, width, height, dstx, dsty);
     XAA_GC_OP_EPILOGUE(pGC);
@@ -98,7 +94,6 @@ XAACopyPlaneFallback(
     RegionPtr ret;
 
     XAA_GC_OP_PROLOGUE(pGC);
-    SYNC_CHECK(pGC);
     ret = (*pGC->ops->CopyPlane)(pSrc, pDst,
 	       pGC, srcx, srcy, width, height, dstx, dsty, bitPlane);
     XAA_GC_OP_EPILOGUE(pGC);
@@ -114,7 +109,6 @@ XAAPolyPointFallback(
     xPoint *pptInit )
 {
     XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
     (*pGC->ops->PolyPoint)(pDraw, pGC, mode, npt, pptInit);
     XAA_GC_OP_EPILOGUE(pGC);
 }
@@ -129,7 +123,6 @@ XAAPolylinesFallback(
     DDXPointPtr pptInit )
 {
     XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
     (*pGC->ops->Polylines)(pDraw, pGC, mode, npt, pptInit);
     XAA_GC_OP_EPILOGUE(pGC);
 }
@@ -142,7 +135,6 @@ XAAPolySegmentFallback(
     xSegment	*pSeg )
 {
     XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
     (*pGC->ops->PolySegment)(pDraw, pGC, nseg, pSeg);
     XAA_GC_OP_EPILOGUE(pGC);
 }
@@ -155,7 +147,6 @@ XAAPolyRectangleFallback(
     xRectangle  *pRectsInit )
 {
     XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
     (*pGC->ops->PolyRectangle)(pDraw, pGC, nRectsInit, pRectsInit);
     XAA_GC_OP_EPILOGUE(pGC);
 }
@@ -168,7 +159,6 @@ XAAPolyArcFallback(
     xArc	*parcs )
 {
     XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
     (*pGC->ops->PolyArc)(pDraw, pGC, narcs, parcs);
     XAA_GC_OP_EPILOGUE(pGC);
 }
@@ -183,7 +173,6 @@ XAAFillPolygonFallback(
     DDXPointPtr	ptsIn )
 {
     XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
     (*pGC->ops->FillPolygon)(pDraw, pGC, shape, mode, count, ptsIn);
     XAA_GC_OP_EPILOGUE(pGC);
 }
@@ -197,7 +186,6 @@ XAAPolyFillRectFallback(
     xRectangle	*prectInit )  
 {
     XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
     (*pGC->ops->PolyFillRect)(pDraw, pGC, nrectFill, prectInit);
     XAA_GC_OP_EPILOGUE(pGC);
 }
@@ -211,7 +199,6 @@ XAAPolyFillArcFallback(
     xArc	*parcs )
 {
     XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
     (*pGC->ops->PolyFillArc)(pDraw, pGC, narcs, parcs);
     XAA_GC_OP_EPILOGUE(pGC);
 }
@@ -228,7 +215,6 @@ XAAPolyText8Fallback(
     int ret;
 
     XAA_GC_OP_PROLOGUE(pGC);
-    SYNC_CHECK(pGC);
     ret = (*pGC->ops->PolyText8)(pDraw, pGC, x, y, count, chars);
     XAA_GC_OP_EPILOGUE(pGC);
     return ret;
@@ -246,7 +232,6 @@ XAAPolyText16Fallback(
     int ret;
 
     XAA_GC_OP_PROLOGUE(pGC);
-    SYNC_CHECK(pGC);
     ret = (*pGC->ops->PolyText16)(pDraw, pGC, x, y, count, chars);
     XAA_GC_OP_EPILOGUE(pGC);
     return ret;
@@ -262,7 +247,6 @@ XAAImageText8Fallback(
     char	*chars )
 {
     XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
     (*pGC->ops->ImageText8)(pDraw, pGC, x, y, count, chars);
     XAA_GC_OP_EPILOGUE(pGC);
 }
@@ -277,7 +261,6 @@ XAAImageText16Fallback(
     unsigned short *chars )
 {
     XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
     (*pGC->ops->ImageText16)(pDraw, pGC, x, y, count, chars);
     XAA_GC_OP_EPILOGUE(pGC);
 }
@@ -293,7 +276,6 @@ XAAImageGlyphBltFallback(
     pointer pglyphBase )
 {
     XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
     (*pGC->ops->ImageGlyphBlt)(pDraw, pGC, xInit, yInit, nglyph, ppci, pglyphBase);
     XAA_GC_OP_EPILOGUE(pGC);
 }
@@ -308,7 +290,6 @@ XAAPolyGlyphBltFallback(
     pointer pglyphBase )
 {
     XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
     (*pGC->ops->PolyGlyphBlt)(pDraw, pGC, xInit, yInit, nglyph, ppci, pglyphBase);
     XAA_GC_OP_EPILOGUE(pGC);
 }
@@ -321,7 +302,6 @@ XAAPushPixelsFallback(
     int	dx, int dy, int xOrg, int yOrg )
 {
     XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC);
-    SYNC_CHECK(pGC);
     (*pGC->ops->PushPixels)(pGC, pBitMap, pDraw, dx, dy, xOrg, yOrg);
     XAA_GC_OP_EPILOGUE(pGC);
 }
diff --git a/hw/xfree86/xaa/xaawrap.h b/hw/xfree86/xaa/xaawrap.h
index 3f3c261..3e410db 100644
--- a/hw/xfree86/xaa/xaawrap.h
+++ b/hw/xfree86/xaa/xaawrap.h
@@ -27,14 +27,16 @@
     XAAGCPtr pGCPriv = (XAAGCPtr)dixLookupPrivate(&(pGC)->devPrivates, XAAGetGCKey()); \
     GCFuncs *oldFuncs = pGC->funcs;\
     pGC->funcs = pGCPriv->wrapFuncs;\
-    pGC->ops = pGCPriv->wrapOps
+    pGC->ops = pGCPriv->wrapOps;\
+    SYNC_CHECK(pGC)
 
 #define XAA_GC_OP_PROLOGUE_WITH_RETURN(pGC)\
     XAAGCPtr pGCPriv = (XAAGCPtr)dixLookupPrivate(&(pGC)->devPrivates, XAAGetGCKey()); \
     GCFuncs *oldFuncs = pGC->funcs;\
     if(!RegionNumRects(pGC->pCompositeClip)) return; \
     pGC->funcs = pGCPriv->wrapFuncs;\
-    pGC->ops = pGCPriv->wrapOps
+    pGC->ops = pGCPriv->wrapOps;\
+    SYNC_CHECK(pGC)
 
     
 #define XAA_GC_OP_EPILOGUE(pGC)\
-- 
1.7.5.4



More information about the xorg-devel mailing list