diff options
author | Maarten Maathuis <madman2003@gmail.com> | 2009-02-27 22:26:52 +0100 |
---|---|---|
committer | Maarten Maathuis <madman2003@gmail.com> | 2009-02-27 22:26:52 +0100 |
commit | 7bfad37f7706da5a76174c0da78dce4d6c6a585b (patch) | |
tree | afdccf9fb39ed8586b70649693f9079bce5b5571 /exa/exa.c | |
parent | 8c6b4a827624aa70aea94b449fee6d5df8504105 (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).
Diffstat (limited to 'exa/exa.c')
-rw-r--r-- | exa/exa.c | 29 |
1 files changed, 12 insertions, 17 deletions
@@ -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); } |