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).
This commit is contained in:
parent
8c6b4a8276
commit
7bfad37f77
29
exa/exa.c
29
exa/exa.c
|
@ -541,10 +541,10 @@ ExaDoPrepareAccess(DrawablePtr pDrawable, int index)
|
||||||
if (pExaScr->info->PrepareAccess == NULL)
|
if (pExaScr->info->PrepareAccess == NULL)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
||||||
if (index >= EXA_PREPARE_AUX0 &&
|
if (index >= EXA_PREPARE_AUX_DEST &&
|
||||||
!(pExaScr->info->flags & EXA_SUPPORTS_PREPARE_AUX)) {
|
!(pExaScr->info->flags & EXA_SUPPORTS_PREPARE_AUX)) {
|
||||||
exaMoveOutPixmap (pPixmap);
|
exaMoveOutPixmap (pPixmap);
|
||||||
return;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(*pExaScr->info->PrepareAccess) (pPixmap, index)) {
|
if (!(*pExaScr->info->PrepareAccess) (pPixmap, index)) {
|
||||||
|
@ -564,8 +564,13 @@ exaPrepareAccessReg(DrawablePtr pDrawable, int index, RegionPtr pReg)
|
||||||
{
|
{
|
||||||
ExaMigrationRec pixmaps[1];
|
ExaMigrationRec pixmaps[1];
|
||||||
|
|
||||||
pixmaps[0].as_dst = index == EXA_PREPARE_DEST;
|
if (index == EXA_PREPARE_DEST || index == EXA_PREPARE_AUX_DEST) {
|
||||||
pixmaps[0].as_src = index != EXA_PREPARE_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].pPix = exaGetDrawablePixmap (pDrawable);
|
||||||
pixmaps[0].pReg = pReg;
|
pixmaps[0].pReg = pReg;
|
||||||
|
|
||||||
|
@ -610,7 +615,7 @@ exaFinishAccess(DrawablePtr pDrawable, int index)
|
||||||
if (!exaPixmapIsOffscreen (pPixmap))
|
if (!exaPixmapIsOffscreen (pPixmap))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (index >= EXA_PREPARE_AUX0 &&
|
if (index >= EXA_PREPARE_AUX_DEST &&
|
||||||
!(pExaScr->info->flags & EXA_SUPPORTS_PREPARE_AUX)) {
|
!(pExaScr->info->flags & EXA_SUPPORTS_PREPARE_AUX)) {
|
||||||
ErrorF("EXA bug: Trying to call driver FinishAccess hook with "
|
ErrorF("EXA bug: Trying to call driver FinishAccess hook with "
|
||||||
"unsupported index EXA_PREPARE_AUX*\n");
|
"unsupported index EXA_PREPARE_AUX*\n");
|
||||||
|
@ -677,7 +682,6 @@ exaCreatePixmapWithPrepare(ScreenPtr pScreen, int w, int h, int depth,
|
||||||
unsigned usage_hint)
|
unsigned usage_hint)
|
||||||
{
|
{
|
||||||
PixmapPtr pPixmap;
|
PixmapPtr pPixmap;
|
||||||
ExaMigrationRec pixmaps[1];
|
|
||||||
ExaScreenPriv(pScreen);
|
ExaScreenPriv(pScreen);
|
||||||
|
|
||||||
/* This swaps between this function and the real upper layer function.
|
/* 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)
|
if (!pPixmap)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* We need to use DEST, but we don't actually want to migrate as dest. */
|
exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_AUX_SRC);
|
||||||
/* 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);
|
|
||||||
|
|
||||||
return pPixmap;
|
return pPixmap;
|
||||||
}
|
}
|
||||||
|
@ -759,7 +754,7 @@ exaValidateGC(GCPtr pGC,
|
||||||
pExaScr->SavedCreatePixmap = old_ptr;
|
pExaScr->SavedCreatePixmap = old_ptr;
|
||||||
|
|
||||||
if (pGC->fillStyle == FillTiled && pTile != pGC->tile.pixmap)
|
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);
|
EXA_GC_EPILOGUE(pGC);
|
||||||
}
|
}
|
||||||
|
|
|
@ -657,9 +657,9 @@ typedef struct _ExaDriver {
|
||||||
* EXA_PREPARE_AUX* are additional indices for other purposes, e.g.
|
* EXA_PREPARE_AUX* are additional indices for other purposes, e.g.
|
||||||
* separate alpha maps with Composite operations.
|
* separate alpha maps with Composite operations.
|
||||||
*/
|
*/
|
||||||
#define EXA_PREPARE_AUX0 3
|
#define EXA_PREPARE_AUX_DEST 3
|
||||||
#define EXA_PREPARE_AUX1 4
|
#define EXA_PREPARE_AUX_SRC 4
|
||||||
#define EXA_PREPARE_AUX2 5
|
#define EXA_PREPARE_AUX_MASK 5
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -397,9 +397,9 @@ ExaCheckComposite (CARD8 op,
|
||||||
* may be used for moving them out.
|
* may be used for moving them out.
|
||||||
*/
|
*/
|
||||||
if (pSrc->alphaMap && pSrc->alphaMap->pDrawable)
|
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)
|
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 (!exaOpReadsDestination(op)) {
|
||||||
if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst,
|
if (!miComputeCompositeRegion (®ion, pSrc, pMask, pDst,
|
||||||
|
@ -414,13 +414,13 @@ ExaCheckComposite (CARD8 op,
|
||||||
REGION_TRANSLATE(pScreen, ®ion, xoff, yoff);
|
REGION_TRANSLATE(pScreen, ®ion, xoff, yoff);
|
||||||
|
|
||||||
if (pDst->alphaMap && pDst->alphaMap->pDrawable)
|
if (pDst->alphaMap && pDst->alphaMap->pDrawable)
|
||||||
exaPrepareAccessReg(pDst->alphaMap->pDrawable, EXA_PREPARE_AUX0,
|
exaPrepareAccessReg(pDst->alphaMap->pDrawable, EXA_PREPARE_AUX_DEST,
|
||||||
®ion);
|
®ion);
|
||||||
|
|
||||||
exaPrepareAccessReg (pDst->pDrawable, EXA_PREPARE_DEST, ®ion);
|
exaPrepareAccessReg (pDst->pDrawable, EXA_PREPARE_DEST, ®ion);
|
||||||
} else {
|
} else {
|
||||||
if (pDst->alphaMap && pDst->alphaMap->pDrawable)
|
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);
|
exaPrepareAccess (pDst->pDrawable, EXA_PREPARE_DEST);
|
||||||
}
|
}
|
||||||
|
@ -451,14 +451,14 @@ ExaCheckComposite (CARD8 op,
|
||||||
if (pMask && pMask->pDrawable != NULL)
|
if (pMask && pMask->pDrawable != NULL)
|
||||||
exaFinishAccess (pMask->pDrawable, EXA_PREPARE_MASK);
|
exaFinishAccess (pMask->pDrawable, EXA_PREPARE_MASK);
|
||||||
if (pMask && pMask->alphaMap && pMask->alphaMap->pDrawable)
|
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)
|
if (pSrc->pDrawable != NULL)
|
||||||
exaFinishAccess (pSrc->pDrawable, EXA_PREPARE_SRC);
|
exaFinishAccess (pSrc->pDrawable, EXA_PREPARE_SRC);
|
||||||
if (pSrc->alphaMap && pSrc->alphaMap->pDrawable)
|
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);
|
exaFinishAccess (pDst->pDrawable, EXA_PREPARE_DEST);
|
||||||
if (pDst->alphaMap && pDst->alphaMap->pDrawable)
|
if (pDst->alphaMap && pDst->alphaMap->pDrawable)
|
||||||
exaFinishAccess(pDst->alphaMap->pDrawable, EXA_PREPARE_AUX0);
|
exaFinishAccess(pDst->alphaMap->pDrawable, EXA_PREPARE_AUX_DEST);
|
||||||
|
|
||||||
REGION_UNINIT(pScreen, ®ion);
|
REGION_UNINIT(pScreen, ®ion);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue