summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaarten Maathuis <madman2003@gmail.com>2009-02-27 22:26:52 +0100
committerMaarten Maathuis <madman2003@gmail.com>2009-02-27 22:26:52 +0100
commit7bfad37f7706da5a76174c0da78dce4d6c6a585b (patch)
treeafdccf9fb39ed8586b70649693f9079bce5b5571
parent8c6b4a827624aa70aea94b449fee6d5df8504105 (diff)
exa: fixup aux indices and ensure that the indices are used as they should be.
- In a previous patch i forgot to add a FALSE somewhere it seems. - Rename AUX indices so the driver (think of driver managed pixmaps) can do optimisations based upon them. - Fix one abuse of DEST index now that we have the AUX indices (same reason as above).
-rw-r--r--exa/exa.c29
-rw-r--r--exa/exa.h6
-rw-r--r--exa/exa_unaccel.c14
3 files changed, 22 insertions, 27 deletions
diff --git a/exa/exa.c b/exa/exa.c
index 76860a490..994a67a9a 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -541,10 +541,10 @@ ExaDoPrepareAccess(DrawablePtr pDrawable, int index)
if (pExaScr->info->PrepareAccess == NULL)
return TRUE;
- if (index >= EXA_PREPARE_AUX0 &&
+ if (index >= EXA_PREPARE_AUX_DEST &&
!(pExaScr->info->flags & EXA_SUPPORTS_PREPARE_AUX)) {
exaMoveOutPixmap (pPixmap);
- return;
+ return FALSE;
}
if (!(*pExaScr->info->PrepareAccess) (pPixmap, index)) {
@@ -564,8 +564,13 @@ exaPrepareAccessReg(DrawablePtr pDrawable, int index, RegionPtr pReg)
{
ExaMigrationRec pixmaps[1];
- pixmaps[0].as_dst = index == EXA_PREPARE_DEST;
- pixmaps[0].as_src = index != EXA_PREPARE_DEST;
+ if (index == EXA_PREPARE_DEST || index == EXA_PREPARE_AUX_DEST) {
+ pixmaps[0].as_dst = TRUE;
+ pixmaps[0].as_src = FALSE;
+ } else {
+ pixmaps[0].as_dst = FALSE;
+ pixmaps[0].as_src = TRUE;
+ }
pixmaps[0].pPix = exaGetDrawablePixmap (pDrawable);
pixmaps[0].pReg = pReg;
@@ -610,7 +615,7 @@ exaFinishAccess(DrawablePtr pDrawable, int index)
if (!exaPixmapIsOffscreen (pPixmap))
return;
- if (index >= EXA_PREPARE_AUX0 &&
+ if (index >= EXA_PREPARE_AUX_DEST &&
!(pExaScr->info->flags & EXA_SUPPORTS_PREPARE_AUX)) {
ErrorF("EXA bug: Trying to call driver FinishAccess hook with "
"unsupported index EXA_PREPARE_AUX*\n");
@@ -677,7 +682,6 @@ exaCreatePixmapWithPrepare(ScreenPtr pScreen, int w, int h, int depth,
unsigned usage_hint)
{
PixmapPtr pPixmap;
- ExaMigrationRec pixmaps[1];
ExaScreenPriv(pScreen);
/* This swaps between this function and the real upper layer function.
@@ -690,16 +694,7 @@ exaCreatePixmapWithPrepare(ScreenPtr pScreen, int w, int h, int depth,
if (!pPixmap)
return NULL;
- /* We need to use DEST, but we don't actually want to migrate as dest. */
- /* SRC is taken by tile, and MASK by stipple. */
- pixmaps[0].as_dst = 0;
- pixmaps[0].as_src = 1;
- pixmaps[0].pPix = exaGetDrawablePixmap (&pPixmap->drawable);
- pixmaps[0].pReg = NULL;
-
- exaDoMigration(pixmaps, 1, FALSE);
-
- ExaDoPrepareAccess(&pPixmap->drawable, EXA_PREPARE_DEST);
+ exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_AUX_SRC);
return pPixmap;
}
@@ -759,7 +754,7 @@ exaValidateGC(GCPtr pGC,
pExaScr->SavedCreatePixmap = old_ptr;
if (pGC->fillStyle == FillTiled && pTile != pGC->tile.pixmap)
- exaFinishAccess(&pGC->tile.pixmap->drawable, EXA_PREPARE_DEST);
+ exaFinishAccess(&pGC->tile.pixmap->drawable, EXA_PREPARE_AUX_SRC);
EXA_GC_EPILOGUE(pGC);
}
diff --git a/exa/exa.h b/exa/exa.h
index f3868b8c6..8339a3e44 100644
--- a/exa/exa.h
+++ b/exa/exa.h
@@ -657,9 +657,9 @@ typedef struct _ExaDriver {
* 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
+ #define EXA_PREPARE_AUX_DEST 3
+ #define EXA_PREPARE_AUX_SRC 4
+ #define EXA_PREPARE_AUX_MASK 5
/** @} */
/**
diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c
index 9a0b0e5af..d16ecf79e 100644
--- a/exa/exa_unaccel.c
+++ b/exa/exa_unaccel.c
@@ -397,9 +397,9 @@ ExaCheckComposite (CARD8 op,
* may be used for moving them out.
*/
if (pSrc->alphaMap && pSrc->alphaMap->pDrawable)
- exaPrepareAccess(pSrc->alphaMap->pDrawable, EXA_PREPARE_AUX2);
+ exaPrepareAccess(pSrc->alphaMap->pDrawable, EXA_PREPARE_AUX_SRC);
if (pMask && pMask->alphaMap && pMask->alphaMap->pDrawable)
- exaPrepareAccess(pMask->alphaMap->pDrawable, EXA_PREPARE_AUX1);
+ exaPrepareAccess(pMask->alphaMap->pDrawable, EXA_PREPARE_AUX_MASK);
if (!exaOpReadsDestination(op)) {
if (!miComputeCompositeRegion (&region, pSrc, pMask, pDst,
@@ -414,13 +414,13 @@ ExaCheckComposite (CARD8 op,
REGION_TRANSLATE(pScreen, &region, xoff, yoff);
if (pDst->alphaMap && pDst->alphaMap->pDrawable)
- exaPrepareAccessReg(pDst->alphaMap->pDrawable, EXA_PREPARE_AUX0,
+ exaPrepareAccessReg(pDst->alphaMap->pDrawable, EXA_PREPARE_AUX_DEST,
&region);
exaPrepareAccessReg (pDst->pDrawable, EXA_PREPARE_DEST, &region);
} else {
if (pDst->alphaMap && pDst->alphaMap->pDrawable)
- exaPrepareAccess(pDst->alphaMap->pDrawable, EXA_PREPARE_AUX0);
+ exaPrepareAccess(pDst->alphaMap->pDrawable, EXA_PREPARE_AUX_DEST);
exaPrepareAccess (pDst->pDrawable, EXA_PREPARE_DEST);
}
@@ -451,14 +451,14 @@ ExaCheckComposite (CARD8 op,
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);
+ exaFinishAccess(pMask->alphaMap->pDrawable, EXA_PREPARE_AUX_MASK);
if (pSrc->pDrawable != NULL)
exaFinishAccess (pSrc->pDrawable, EXA_PREPARE_SRC);
if (pSrc->alphaMap && pSrc->alphaMap->pDrawable)
- exaFinishAccess(pSrc->alphaMap->pDrawable, EXA_PREPARE_AUX2);
+ exaFinishAccess(pSrc->alphaMap->pDrawable, EXA_PREPARE_AUX_SRC);
exaFinishAccess (pDst->pDrawable, EXA_PREPARE_DEST);
if (pDst->alphaMap && pDst->alphaMap->pDrawable)
- exaFinishAccess(pDst->alphaMap->pDrawable, EXA_PREPARE_AUX0);
+ exaFinishAccess(pDst->alphaMap->pDrawable, EXA_PREPARE_AUX_DEST);
REGION_UNINIT(pScreen, &region);
}