exa: properly wrap GC functions

This commit is contained in:
Maarten Maathuis 2009-01-31 18:53:52 +01:00
parent 5e6a06fe69
commit 015c99a4ad
3 changed files with 251 additions and 119 deletions

239
exa/exa.c
View File

@ -575,86 +575,178 @@ exaFinishAccess(DrawablePtr pDrawable, int index)
} }
/** /**
* exaValidateGC() sets the ops to EXA's implementations, which may be * Here begins EXA's GC code.
* accelerated or may sync the card and fall back to fb. * Do not ever access the fb/mi layer directly.
*/ */
static void static void
exaValidateGC (GCPtr pGC, unsigned long changes, DrawablePtr pDrawable) exaValidateGC(GCPtr pGC,
unsigned long changes,
DrawablePtr pDrawable);
static void
exaDestroyGC(GCPtr pGC);
static void
exaChangeGC (GCPtr pGC,
unsigned long mask);
static void
exaCopyGC (GCPtr pGCSrc,
unsigned long mask,
GCPtr pGCDst);
static void
exaChangeClip (GCPtr pGC,
int type,
pointer pvalue,
int nrects);
static void
exaCopyClip(GCPtr pGCDst, GCPtr pGCSrc);
static void
exaCopyClip(GCPtr pGCDst, GCPtr pGCSrc);
static void
exaDestroyClip(GCPtr pGC);
const GCFuncs exaGCFuncs = {
exaValidateGC,
exaChangeGC,
exaCopyGC,
exaDestroyGC,
exaChangeClip,
exaDestroyClip,
exaCopyClip
};
/*
* This wrapper exists to allow fbValidateGC to work.
*/
static PixmapPtr
exaCreatePixmapWithPrepare(ScreenPtr pScreen, int w, int h, int depth,
unsigned usage_hint)
{
PixmapPtr pPixmap;
ExaScreenPriv(pScreen);
/* This swaps between this function and the real upper layer function.
* Normally this would swap to the fb layer pointer, this is a very special case.
*/
swap(pExaScr, pScreen, CreatePixmap);
pPixmap = pScreen->CreatePixmap(pScreen, w, h, depth, usage_hint);
swap(pExaScr, pScreen, CreatePixmap);
if (!pPixmap)
return NULL;
/* We use MASK, because SRC is already taken. */
exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_MASK);
return pPixmap;
}
static void
exaValidateGC(GCPtr pGC,
unsigned long changes,
DrawablePtr pDrawable)
{ {
/* fbValidateGC will do direct access to pixmaps if the tiling has changed. /* fbValidateGC will do direct access to pixmaps if the tiling has changed.
* Preempt fbValidateGC by doing its work and masking the change out, so * Do a few smart things so fbValidateGC can do it's work.
* that we can do the Prepare/FinishAccess.
*/ */
#ifdef FB_24_32BIT
if ((changes & GCTile) && fbGetRotatedPixmap(pGC)) {
(*pGC->pScreen->DestroyPixmap) (fbGetRotatedPixmap(pGC));
fbGetRotatedPixmap(pGC) = 0;
}
if (pGC->fillStyle == FillTiled) { ScreenPtr pScreen = pDrawable->pScreen;
PixmapPtr pOldTile, pNewTile; ExaScreenPriv(pScreen);
CreatePixmapProcPtr old_ptr = NULL;
pOldTile = pGC->tile.pixmap; PixmapPtr pTile = NULL;
if (pOldTile->drawable.bitsPerPixel != pDrawable->bitsPerPixel) EXA_GC_PROLOGUE(pGC);
{
pNewTile = fbGetRotatedPixmap(pGC);
if (!pNewTile ||
pNewTile ->drawable.bitsPerPixel != pDrawable->bitsPerPixel)
{
if (pNewTile)
(*pGC->pScreen->DestroyPixmap) (pNewTile);
/* fb24_32ReformatTile will do direct access of a newly-
* allocated pixmap. This isn't a problem yet, since we don't
* put pixmaps in FB until at least one accelerated EXA op.
*/
exaPrepareAccess(&pOldTile->drawable, EXA_PREPARE_SRC);
pNewTile = fb24_32ReformatTile (pOldTile,
pDrawable->bitsPerPixel);
exaPixmapDirty(pNewTile, 0, 0, pNewTile->drawable.width, pNewTile->drawable.height);
exaFinishAccess(&pOldTile->drawable, EXA_PREPARE_SRC);
}
if (pNewTile)
{
fbGetRotatedPixmap(pGC) = pOldTile;
pGC->tile.pixmap = pNewTile;
changes |= GCTile;
}
}
}
#endif
if (changes & GCTile) { if (changes & GCTile) {
if (!pGC->tileIsPixel && FbEvenTile (pGC->tile.pixmap->drawable.width * /* save the "fb" pointer. */
pDrawable->bitsPerPixel)) old_ptr = pExaScr->SavedCreatePixmap;
{ /* create a new upper layer pointer. */
exaPrepareAccess(&pGC->tile.pixmap->drawable, EXA_PREPARE_SRC); wrap(pExaScr, pScreen, CreatePixmap, exaCreatePixmapWithPrepare);
fbPadPixmap (pGC->tile.pixmap); if (pGC->fillStyle == FillTiled)
exaFinishAccess(&pGC->tile.pixmap->drawable, EXA_PREPARE_SRC); pTile = pGC->tile.pixmap;
if (pTile)
exaPrepareAccess(&pTile->drawable, EXA_PREPARE_SRC);
}
exaPrepareAccessGC(pGC);
(*pGC->funcs->ValidateGC)(pGC, changes, pDrawable);
exaFinishAccessGC(pGC);
if (changes & GCTile) {
/* switch back to the normal upper layer. */
unwrap(pExaScr, pScreen, CreatePixmap);
/* restore copy of fb layer pointer. */
pExaScr->SavedCreatePixmap = old_ptr;
if (pTile)
exaFinishAccess(&pTile->drawable, EXA_PREPARE_SRC);
/* A new tile pixmap was created. */
if (pGC->tile.pixmap != pTile && pGC->fillStyle == FillTiled) {
exaFinishAccess(&pGC->tile.pixmap->drawable, EXA_PREPARE_MASK);
exaPixmapDirty(pGC->tile.pixmap, 0, 0, exaPixmapDirty(pGC->tile.pixmap, 0, 0,
pGC->tile.pixmap->drawable.width, pGC->tile.pixmap->drawable.width,
pGC->tile.pixmap->drawable.height); pGC->tile.pixmap->drawable.height);
} }
/* Mask out the GCTile change notification, now that we've done FB's
* job for it.
*/
changes &= ~GCTile;
} }
EXA_GC_EPILOGUE(pGC);
exaPrepareAccessGC(pGC);
fbValidateGC (pGC, changes, pDrawable);
exaFinishAccessGC(pGC);
pGC->ops = (GCOps *) &exaOps;
} }
static GCFuncs exaGCFuncs = { /* Is exaPrepareAccessGC() needed? */
exaValidateGC, static void
miChangeGC, exaDestroyGC(GCPtr pGC)
miCopyGC, {
miDestroyGC, EXA_GC_PROLOGUE (pGC);
miChangeClip, (*pGC->funcs->DestroyGC)(pGC);
miDestroyClip, EXA_GC_EPILOGUE (pGC);
miCopyClip }
};
static void
exaChangeGC (GCPtr pGC,
unsigned long mask)
{
EXA_GC_PROLOGUE (pGC);
(*pGC->funcs->ChangeGC) (pGC, mask);
EXA_GC_EPILOGUE (pGC);
}
static void
exaCopyGC (GCPtr pGCSrc,
unsigned long mask,
GCPtr pGCDst)
{
EXA_GC_PROLOGUE (pGCDst);
(*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst);
EXA_GC_EPILOGUE (pGCDst);
}
static void
exaChangeClip (GCPtr pGC,
int type,
pointer pvalue,
int nrects)
{
EXA_GC_PROLOGUE (pGC);
(*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
EXA_GC_EPILOGUE (pGC);
}
static void
exaCopyClip(GCPtr pGCDst, GCPtr pGCSrc)
{
EXA_GC_PROLOGUE (pGCDst);
(*pGCDst->funcs->CopyClip)(pGCDst, pGCSrc);
EXA_GC_EPILOGUE (pGCDst);
}
static void
exaDestroyClip(GCPtr pGC)
{
EXA_GC_PROLOGUE (pGC);
(*pGC->funcs->DestroyClip)(pGC);
EXA_GC_EPILOGUE (pGC);
}
/** /**
* exaCreateGC makes a new GC and hooks up its funcs handler, so that * exaCreateGC makes a new GC and hooks up its funcs handler, so that
@ -663,14 +755,19 @@ static GCFuncs exaGCFuncs = {
static int static int
exaCreateGC (GCPtr pGC) exaCreateGC (GCPtr pGC)
{ {
ScreenPtr pScreen = pGC->pScreen;
ExaScreenPriv(pScreen);
ExaGCPriv(pGC); ExaGCPriv(pGC);
Bool ret;
if (!fbCreateGC (pGC)) swap(pExaScr, pScreen, CreateGC);
return FALSE; if ((ret = (*pScreen->CreateGC) (pGC))) {
wrap(pExaGC, pGC, funcs, (GCFuncs *) &exaGCFuncs);
wrap(pExaGC, pGC, ops, (GCOps *) &exaOps);
}
swap(pExaScr, pScreen, CreateGC);
pGC->funcs = &exaGCFuncs; return ret;
return TRUE;
} }
static Bool static Bool

View File

@ -180,6 +180,33 @@ extern DevPrivateKey exaGCPrivateKey;
#define ExaGetGCPriv(gc) ((ExaGCPrivPtr)dixLookupPrivate(&(gc)->devPrivates, exaGCPrivateKey)) #define ExaGetGCPriv(gc) ((ExaGCPrivPtr)dixLookupPrivate(&(gc)->devPrivates, exaGCPrivateKey))
#define ExaGCPriv(gc) ExaGCPrivPtr pExaGC = ExaGetGCPriv(gc) #define ExaGCPriv(gc) ExaGCPrivPtr pExaGC = ExaGetGCPriv(gc)
/*
* Some macros to deal with function wrapping.
*/
#define wrap(priv, real, mem, func) {\
priv->Saved##mem = real->mem; \
real->mem = func; \
}
#define unwrap(priv, real, mem) {\
real->mem = priv->Saved##mem; \
}
#define swap(priv, real, mem) {\
void *tmp = priv->Saved##mem; \
priv->Saved##mem = real->mem; \
real->mem = tmp; \
}
#define EXA_GC_PROLOGUE(_gc_) \
ExaGCPriv(_gc_); \
swap(pExaGC, _gc_, funcs); \
swap(pExaGC, _gc_, ops);
#define EXA_GC_EPILOGUE(_gc_) \
swap(pExaGC, _gc_, funcs); \
swap(pExaGC, _gc_, ops);
/** Align an offset to an arbitrary alignment */ /** Align an offset to an arbitrary alignment */
#define EXA_ALIGN(offset, align) (((offset) + (align) - 1) - \ #define EXA_ALIGN(offset, align) (((offset) + (align) - 1) - \
(((offset) + (align) - 1) % (align))) (((offset) + (align) - 1) % (align)))
@ -243,8 +270,8 @@ typedef struct {
typedef struct { typedef struct {
/* GC values from the layer below. */ /* GC values from the layer below. */
GCOps *ops; GCOps *Savedops;
GCFuncs *funcs; GCFuncs *Savedfuncs;
} ExaGCPrivRec, *ExaGCPrivPtr; } ExaGCPrivRec, *ExaGCPrivPtr;
typedef struct _ExaMigrationRec { typedef struct _ExaMigrationRec {
@ -447,6 +474,8 @@ exaCopyNtoN (DrawablePtr pSrcDrawable,
Pixel bitplane, Pixel bitplane,
void *closure); void *closure);
extern const GCFuncs exaGCFuncs;
/* exa_render.c */ /* exa_render.c */
Bool Bool
exaOpReadsDestination (CARD8 op); exaOpReadsDestination (CARD8 op);

View File

@ -74,22 +74,26 @@ void
ExaCheckFillSpans (DrawablePtr pDrawable, GCPtr pGC, int nspans, ExaCheckFillSpans (DrawablePtr pDrawable, GCPtr pGC, int nspans,
DDXPointPtr ppt, int *pwidth, int fSorted) DDXPointPtr ppt, int *pwidth, int fSorted)
{ {
EXA_GC_PROLOGUE(pGC);
EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable)));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
exaPrepareAccessGC (pGC); exaPrepareAccessGC (pGC);
fbFillSpans (pDrawable, pGC, nspans, ppt, pwidth, fSorted); pGC->ops->FillSpans (pDrawable, pGC, nspans, ppt, pwidth, fSorted);
exaFinishAccessGC (pGC); exaFinishAccessGC (pGC);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST); exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
EXA_GC_EPILOGUE(pGC);
} }
void void
ExaCheckSetSpans (DrawablePtr pDrawable, GCPtr pGC, char *psrc, ExaCheckSetSpans (DrawablePtr pDrawable, GCPtr pGC, char *psrc,
DDXPointPtr ppt, int *pwidth, int nspans, int fSorted) DDXPointPtr ppt, int *pwidth, int nspans, int fSorted)
{ {
EXA_GC_PROLOGUE(pGC);
EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable)));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fbSetSpans (pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted); pGC->ops->SetSpans (pDrawable, pGC, psrc, ppt, pwidth, nspans, fSorted);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST); exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
EXA_GC_EPILOGUE(pGC);
} }
void void
@ -99,6 +103,7 @@ ExaCheckPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth,
{ {
ExaPixmapPriv(exaGetDrawablePixmap(pDrawable)); ExaPixmapPriv(exaGetDrawablePixmap(pDrawable));
EXA_GC_PROLOGUE(pGC);
EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable)));
if (exaGCReadsDestination(pDrawable, pGC->planemask, pGC->fillStyle, if (exaGCReadsDestination(pDrawable, pGC->planemask, pGC->fillStyle,
pGC->alu)) pGC->alu))
@ -106,8 +111,9 @@ ExaCheckPutImage (DrawablePtr pDrawable, GCPtr pGC, int depth,
else else
exaPrepareAccessReg (pDrawable, EXA_PREPARE_DEST, pExaPixmap->pDamage ? exaPrepareAccessReg (pDrawable, EXA_PREPARE_DEST, pExaPixmap->pDamage ?
DamagePendingRegion(pExaPixmap->pDamage) : NULL); DamagePendingRegion(pExaPixmap->pDamage) : NULL);
fbPutImage (pDrawable, pGC, depth, x, y, w, h, leftPad, format, bits); pGC->ops->PutImage (pDrawable, pGC, depth, x, y, w, h, leftPad, format, bits);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST); exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
EXA_GC_EPILOGUE(pGC);
} }
RegionPtr RegionPtr
@ -116,13 +122,15 @@ ExaCheckCopyArea (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
{ {
RegionPtr ret; RegionPtr ret;
EXA_GC_PROLOGUE(pGC);
EXA_FALLBACK(("from %p to %p (%c,%c)\n", pSrc, pDst, EXA_FALLBACK(("from %p to %p (%c,%c)\n", pSrc, pDst,
exaDrawableLocation(pSrc), exaDrawableLocation(pDst))); exaDrawableLocation(pSrc), exaDrawableLocation(pDst)));
exaPrepareAccess (pDst, EXA_PREPARE_DEST); exaPrepareAccess (pDst, EXA_PREPARE_DEST);
exaPrepareAccess (pSrc, EXA_PREPARE_SRC); exaPrepareAccess (pSrc, EXA_PREPARE_SRC);
ret = fbCopyArea (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty); ret = pGC->ops->CopyArea (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty);
exaFinishAccess (pSrc, EXA_PREPARE_SRC); exaFinishAccess (pSrc, EXA_PREPARE_SRC);
exaFinishAccess (pDst, EXA_PREPARE_DEST); exaFinishAccess (pDst, EXA_PREPARE_DEST);
EXA_GC_EPILOGUE(pGC);
return ret; return ret;
} }
@ -134,14 +142,16 @@ ExaCheckCopyPlane (DrawablePtr pSrc, DrawablePtr pDst, GCPtr pGC,
{ {
RegionPtr ret; RegionPtr ret;
EXA_GC_PROLOGUE(pGC);
EXA_FALLBACK(("from %p to %p (%c,%c)\n", pSrc, pDst, EXA_FALLBACK(("from %p to %p (%c,%c)\n", pSrc, pDst,
exaDrawableLocation(pSrc), exaDrawableLocation(pDst))); exaDrawableLocation(pSrc), exaDrawableLocation(pDst)));
exaPrepareAccess (pDst, EXA_PREPARE_DEST); exaPrepareAccess (pDst, EXA_PREPARE_DEST);
exaPrepareAccess (pSrc, EXA_PREPARE_SRC); exaPrepareAccess (pSrc, EXA_PREPARE_SRC);
ret = fbCopyPlane (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty, ret = pGC->ops->CopyPlane (pSrc, pDst, pGC, srcx, srcy, w, h, dstx, dsty,
bitPlane); bitPlane);
exaFinishAccess (pSrc, EXA_PREPARE_SRC); exaFinishAccess (pSrc, EXA_PREPARE_SRC);
exaFinishAccess (pDst, EXA_PREPARE_DEST); exaFinishAccess (pDst, EXA_PREPARE_DEST);
EXA_GC_EPILOGUE(pGC);
return ret; return ret;
} }
@ -150,85 +160,75 @@ void
ExaCheckPolyPoint (DrawablePtr pDrawable, GCPtr pGC, int mode, int npt, ExaCheckPolyPoint (DrawablePtr pDrawable, GCPtr pGC, int mode, int npt,
DDXPointPtr pptInit) DDXPointPtr pptInit)
{ {
EXA_GC_PROLOGUE(pGC);
EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable)));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
fbPolyPoint (pDrawable, pGC, mode, npt, pptInit); pGC->ops->PolyPoint (pDrawable, pGC, mode, npt, pptInit);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST); exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
EXA_GC_EPILOGUE(pGC);
} }
void void
ExaCheckPolylines (DrawablePtr pDrawable, GCPtr pGC, ExaCheckPolylines (DrawablePtr pDrawable, GCPtr pGC,
int mode, int npt, DDXPointPtr ppt) int mode, int npt, DDXPointPtr ppt)
{ {
EXA_GC_PROLOGUE(pGC);
EXA_FALLBACK(("to %p (%c), width %d, mode %d, count %d\n", EXA_FALLBACK(("to %p (%c), width %d, mode %d, count %d\n",
pDrawable, exaDrawableLocation(pDrawable), pDrawable, exaDrawableLocation(pDrawable),
pGC->lineWidth, mode, npt)); pGC->lineWidth, mode, npt));
if (pGC->lineWidth == 0) {
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
exaPrepareAccessGC (pGC); exaPrepareAccessGC (pGC);
fbPolyLine (pDrawable, pGC, mode, npt, ppt); pGC->ops->Polylines (pDrawable, pGC, mode, npt, ppt);
exaFinishAccessGC (pGC); exaFinishAccessGC (pGC);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST); exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
return; EXA_GC_EPILOGUE(pGC);
}
/* fb calls mi functions in the lineWidth != 0 case. */
fbPolyLine (pDrawable, pGC, mode, npt, ppt);
} }
void void
ExaCheckPolySegment (DrawablePtr pDrawable, GCPtr pGC, ExaCheckPolySegment (DrawablePtr pDrawable, GCPtr pGC,
int nsegInit, xSegment *pSegInit) int nsegInit, xSegment *pSegInit)
{ {
EXA_GC_PROLOGUE(pGC);
EXA_FALLBACK(("to %p (%c) width %d, count %d\n", pDrawable, EXA_FALLBACK(("to %p (%c) width %d, count %d\n", pDrawable,
exaDrawableLocation(pDrawable), pGC->lineWidth, nsegInit)); exaDrawableLocation(pDrawable), pGC->lineWidth, nsegInit));
if (pGC->lineWidth == 0) {
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
exaPrepareAccessGC (pGC); exaPrepareAccessGC (pGC);
fbPolySegment (pDrawable, pGC, nsegInit, pSegInit); pGC->ops->PolySegment (pDrawable, pGC, nsegInit, pSegInit);
exaFinishAccessGC (pGC); exaFinishAccessGC (pGC);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST); exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
return; EXA_GC_EPILOGUE(pGC);
}
/* fb calls mi functions in the lineWidth != 0 case. */
fbPolySegment (pDrawable, pGC, nsegInit, pSegInit);
} }
void void
ExaCheckPolyArc (DrawablePtr pDrawable, GCPtr pGC, ExaCheckPolyArc (DrawablePtr pDrawable, GCPtr pGC,
int narcs, xArc *pArcs) int narcs, xArc *pArcs)
{ {
EXA_GC_PROLOGUE(pGC);
EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable)));
/* Disable this as fbPolyArc can call miZeroPolyArc which in turn
* can call accelerated functions, that as yet, haven't been notified
* with exaFinishAccess().
*/
#if 0
if (pGC->lineWidth == 0)
{
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
exaPrepareAccessGC (pGC); exaPrepareAccessGC (pGC);
fbPolyArc (pDrawable, pGC, narcs, pArcs); pGC->ops->PolyArc (pDrawable, pGC, narcs, pArcs);
exaFinishAccessGC (pGC); exaFinishAccessGC (pGC);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST); exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
return; EXA_GC_EPILOGUE(pGC);
}
#endif
miPolyArc (pDrawable, pGC, narcs, pArcs);
} }
void void
ExaCheckPolyFillRect (DrawablePtr pDrawable, GCPtr pGC, ExaCheckPolyFillRect (DrawablePtr pDrawable, GCPtr pGC,
int nrect, xRectangle *prect) int nrect, xRectangle *prect)
{ {
EXA_GC_PROLOGUE(pGC);
EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable))); EXA_FALLBACK(("to %p (%c)\n", pDrawable, exaDrawableLocation(pDrawable)));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
exaPrepareAccessGC (pGC); exaPrepareAccessGC (pGC);
fbPolyFillRect (pDrawable, pGC, nrect, prect); pGC->ops->PolyFillRect (pDrawable, pGC, nrect, prect);
exaFinishAccessGC (pGC); exaFinishAccessGC (pGC);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST); exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
EXA_GC_EPILOGUE(pGC);
} }
void void
@ -236,13 +236,15 @@ ExaCheckImageGlyphBlt (DrawablePtr pDrawable, GCPtr pGC,
int x, int y, unsigned int nglyph, int x, int y, unsigned int nglyph,
CharInfoPtr *ppci, pointer pglyphBase) CharInfoPtr *ppci, pointer pglyphBase)
{ {
EXA_GC_PROLOGUE(pGC);
EXA_FALLBACK(("to %p (%c)\n", pDrawable, EXA_FALLBACK(("to %p (%c)\n", pDrawable,
exaDrawableLocation(pDrawable))); exaDrawableLocation(pDrawable)));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
exaPrepareAccessGC (pGC); exaPrepareAccessGC (pGC);
fbImageGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase); pGC->ops->ImageGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
exaFinishAccessGC (pGC); exaFinishAccessGC (pGC);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST); exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
EXA_GC_EPILOGUE(pGC);
} }
void void
@ -250,13 +252,15 @@ ExaCheckPolyGlyphBlt (DrawablePtr pDrawable, GCPtr pGC,
int x, int y, unsigned int nglyph, int x, int y, unsigned int nglyph,
CharInfoPtr *ppci, pointer pglyphBase) CharInfoPtr *ppci, pointer pglyphBase)
{ {
EXA_GC_PROLOGUE(pGC);
EXA_FALLBACK(("to %p (%c), style %d alu %d\n", pDrawable, EXA_FALLBACK(("to %p (%c), style %d alu %d\n", pDrawable,
exaDrawableLocation(pDrawable), pGC->fillStyle, pGC->alu)); exaDrawableLocation(pDrawable), pGC->fillStyle, pGC->alu));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
exaPrepareAccessGC (pGC); exaPrepareAccessGC (pGC);
fbPolyGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase); pGC->ops->PolyGlyphBlt (pDrawable, pGC, x, y, nglyph, ppci, pglyphBase);
exaFinishAccessGC (pGC); exaFinishAccessGC (pGC);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST); exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
EXA_GC_EPILOGUE(pGC);
} }
void void
@ -264,16 +268,18 @@ ExaCheckPushPixels (GCPtr pGC, PixmapPtr pBitmap,
DrawablePtr pDrawable, DrawablePtr pDrawable,
int w, int h, int x, int y) int w, int h, int x, int y)
{ {
EXA_GC_PROLOGUE(pGC);
EXA_FALLBACK(("from %p to %p (%c,%c)\n", pBitmap, pDrawable, EXA_FALLBACK(("from %p to %p (%c,%c)\n", pBitmap, pDrawable,
exaDrawableLocation(&pBitmap->drawable), exaDrawableLocation(&pBitmap->drawable),
exaDrawableLocation(pDrawable))); exaDrawableLocation(pDrawable)));
exaPrepareAccess (pDrawable, EXA_PREPARE_DEST); exaPrepareAccess (pDrawable, EXA_PREPARE_DEST);
exaPrepareAccess (&pBitmap->drawable, EXA_PREPARE_SRC); exaPrepareAccess (&pBitmap->drawable, EXA_PREPARE_SRC);
exaPrepareAccessGC (pGC); exaPrepareAccessGC (pGC);
fbPushPixels (pGC, pBitmap, pDrawable, w, h, x, y); pGC->ops->PushPixels (pGC, pBitmap, pDrawable, w, h, x, y);
exaFinishAccessGC (pGC); exaFinishAccessGC (pGC);
exaFinishAccess (&pBitmap->drawable, EXA_PREPARE_SRC); exaFinishAccess (&pBitmap->drawable, EXA_PREPARE_SRC);
exaFinishAccess (pDrawable, EXA_PREPARE_DEST); exaFinishAccess (pDrawable, EXA_PREPARE_DEST);
EXA_GC_EPILOGUE(pGC);
} }
void void