summaryrefslogtreecommitdiff
path: root/drv/exa/exa.c
diff options
context:
space:
mode:
Diffstat (limited to 'drv/exa/exa.c')
-rw-r--r--drv/exa/exa.c111
1 files changed, 106 insertions, 5 deletions
diff --git a/drv/exa/exa.c b/drv/exa/exa.c
index 71ecf8c0a..31d4aa596 100644
--- a/drv/exa/exa.c
+++ b/drv/exa/exa.c
@@ -449,7 +449,46 @@ exaDestroyPixmap(DrvPixmapPtr pPixmap)
* Do not ever access the fb/mi layer directly.
*/
-void
+static void
+exaValidateGC(DrvGCPtr pGC,
+ unsigned long changes,
+ DrvPixmapPtr pPixmap);
+
+static void
+exaDestroyGC(DrvGCPtr pGC);
+
+static void
+exaChangeGC (DrvGCPtr pGC,
+ unsigned long mask);
+
+static void
+exaCopyGC (DrvGCPtr pGCSrc,
+ unsigned long mask,
+ DrvGCPtr pGCDst);
+
+static void
+exaChangeClip (DrvGCPtr pGC,
+ int type,
+ pointer pvalue,
+ int nrects);
+
+static void
+exaCopyClip(DrvGCPtr pGCDst, DrvGCPtr pGCSrc);
+
+static void
+exaDestroyClip(DrvGCPtr pGC);
+
+const DrvGCFuncs drvexaGCFuncs = {
+ exaValidateGC,
+ exaChangeGC,
+ exaCopyGC,
+ exaDestroyGC,
+ exaChangeClip,
+ exaDestroyClip,
+ exaCopyClip
+};
+
+static void
exaValidateGC(DrvGCPtr pGC,
unsigned long changes,
DrvPixmapPtr pPixmap)
@@ -490,9 +529,9 @@ exaValidateGC(DrvGCPtr pGC,
/* Calls to Create/DestroyPixmap have to be identified as special. */
pExaScr->fallback_counter++;
- swap(pExaGC, pGC, ops);
- (*pGC->ops->GPUValidateGC)(pGC, changes, pPixmap);
- swap(pExaGC, pGC, ops);
+ swap(pExaGC, pGC, funcs);
+ (*pGC->funcs->ValidateGC)(pGC, changes, pPixmap);
+ swap(pExaGC, pGC, funcs);
pExaScr->fallback_counter--;
if (pTile)
@@ -503,6 +542,68 @@ exaValidateGC(DrvGCPtr pGC,
exaFinishAccess(pGC->stipple, DRV_EXA_PREPARE_MASK);
}
+/* Is exaPrepareAccessGC() needed? */
+static void
+exaDestroyGC(DrvGCPtr pGC)
+{
+ ExaGCPriv(pGC);
+ swap(pExaGC, pGC, funcs);
+ (*pGC->funcs->DestroyGC)(pGC);
+ swap(pExaGC, pGC, funcs);
+}
+
+
+static void
+exaChangeGC (DrvGCPtr pGC,
+ unsigned long mask)
+{
+ ExaGCPriv(pGC);
+ swap(pExaGC, pGC, funcs);
+ (*pGC->funcs->ChangeGC) (pGC, mask);
+ swap(pExaGC, pGC, funcs);
+}
+
+static void
+exaCopyGC (DrvGCPtr pGCSrc,
+ unsigned long mask,
+ DrvGCPtr pGCDst)
+{
+ ExaGCPriv(pGCDst);
+ swap(pExaGC, pGCDst, funcs);
+ (*pGCDst->funcs->CopyGC) (pGCSrc, mask, pGCDst);
+ swap(pExaGC, pGCDst, funcs);
+}
+
+static void
+exaChangeClip (DrvGCPtr pGC,
+ int type,
+ pointer pvalue,
+ int nrects)
+{
+ ExaGCPriv(pGC);
+ swap(pExaGC, pGC, funcs);
+ (*pGC->funcs->ChangeClip) (pGC, type, pvalue, nrects);
+ swap(pExaGC, pGC, funcs);
+}
+
+static void
+exaCopyClip(DrvGCPtr pGCDst, DrvGCPtr pGCSrc)
+{
+ ExaGCPriv(pGCDst);
+ swap(pExaGC, pGCDst, funcs);
+ (*pGCDst->funcs->CopyClip)(pGCDst, pGCSrc);
+ swap(pExaGC, pGCDst, funcs);
+}
+
+static void
+exaDestroyClip(DrvGCPtr pGC)
+{
+ ExaGCPriv(pGC);
+ swap(pExaGC, pGC, funcs);
+ (*pGC->funcs->DestroyClip)(pGC);
+ swap(pExaGC, pGC, funcs);
+}
+
/**
* exaCreateGC makes a new GC and hooks up its funcs handler, so that
@@ -518,7 +619,7 @@ exaCreateGC (DrvGCPtr pGC)
swap(pExaScr, pScreen, CreateGC);
if ((ret = (*pScreen->CreateGC) (pGC))) {
- // wrap(pExaGC, pGC, funcs, (GCFuncs *) &exaGCFuncs);
+ wrap(pExaGC, pGC, funcs, (DrvGCFuncs *) &drvexaGCFuncs);
wrap(pExaGC, pGC, ops, (DrvGCOps *) &exaOps);
}
swap(pExaScr, pScreen, CreateGC);