commit 11e9c6a738c50bb016a7922ce4ff536172506ab1 Author: Michel Dänzer Date: Fri Jul 10 20:19:41 2009 +0200 EXA: Drop tracking of pixmaps subject to PrepareAccess. It can't work anymore since fbComposite() uses scratch GCs. diff --git a/exa/exa.c b/exa/exa.c index d04ea71..511828e 100644 --- a/exa/exa.c +++ b/exa/exa.c @@ -561,21 +561,6 @@ ExaDoPrepareAccess(DrawablePtr pDrawable, int index) if (pExaPixmap == NULL) EXA_FatalErrorDebugWithRet(("EXA bug: ExaDoPrepareAccess was called on a non-exa pixmap.\n"), FALSE); - /* Check if we're dealing SRC == DST or similar. - * In that case the first PrepareAccess has already set pPixmap->devPrivate.ptr. - */ - if (pPixmap->devPrivate.ptr != NULL) { - int i; - for (i = 0; i < 6; i++) - if (pExaScr->prepare_access[i] == pPixmap) - break; - - /* No known PrepareAccess or double prepare on the same index. */ - if (i == 6 || i == index) - EXA_FatalErrorDebug(("EXA bug: pPixmap->devPrivate.ptr was %p, but should have been NULL.\n", - pPixmap->devPrivate.ptr)); - } - offscreen = exaPixmapIsOffscreen(pPixmap); if (offscreen) @@ -583,9 +568,6 @@ ExaDoPrepareAccess(DrawablePtr pDrawable, int index) else pPixmap->devPrivate.ptr = pExaPixmap->sys_ptr; - /* Store so we can check SRC and DEST being the same. */ - pExaScr->prepare_access[index] = pPixmap; - if (!offscreen) return FALSE; @@ -664,12 +646,6 @@ exaFinishAccess(DrawablePtr pDrawable, int index) if (pExaPixmap == NULL) EXA_FatalErrorDebugWithRet(("EXA bug: exaFinishAccesss was called on a non-exa pixmap.\n"),); - /* Avoid mismatching indices. */ - if (pExaScr->prepare_access[index] != pPixmap) - EXA_FatalErrorDebug(("EXA bug: Calling FinishAccess on pixmap %p with index %d while " - "it should have been %p.\n", pPixmap, index, pExaScr->prepare_access[index])); - pExaScr->prepare_access[index] = NULL; - /* We always hide the devPrivate.ptr. */ pPixmap->devPrivate.ptr = NULL; @@ -763,15 +739,7 @@ exaCreatePixmapWithPrepare(ScreenPtr pScreen, int w, int h, int depth, * For EXA_HANDLES_PIXMAPS the driver will handle whatever is needed. * We want to signal that the pixmaps will be used as destination. */ - if (pExaScr->prepare_access[EXA_PREPARE_DEST] == NULL) { - ExaDoPrepareAccess(&pPixmap->drawable, EXA_PREPARE_DEST); - pExaScr->prepare_access[EXA_PREPARE_DEST] = pPixmap; - } else if (pExaScr->prepare_access[EXA_PREPARE_AUX_DEST] == NULL) { - ExaDoPrepareAccess(&pPixmap->drawable, EXA_PREPARE_AUX_DEST); - pExaScr->prepare_access[EXA_PREPARE_AUX_DEST] = pPixmap; - } else { - FatalError("exaCreatePixmapWithPrepare can only accomodate two pixmaps, we're at three.\n"); - } + ExaDoPrepareAccess(&pPixmap->drawable, EXA_PREPARE_AUX_DEST); return pPixmap; } @@ -781,12 +749,9 @@ exaDestroyPixmapWithFinish(PixmapPtr pPixmap) { ScreenPtr pScreen = pPixmap->drawable.pScreen; ExaScreenPriv(pScreen); - int i; Bool ret; - for (i = 0; i < 6; i++) - if (pExaScr->prepare_access[i] == pPixmap) - exaFinishAccess(&pPixmap->drawable, i); + exaFinishAccess(&pPixmap->drawable, EXA_PREPARE_AUX_DEST); /* 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. @@ -848,8 +813,8 @@ exaValidateGC(GCPtr pGC, (*pGC->funcs->ValidateGC)(pGC, changes, pDrawable); - if (pExaScr->prepare_access[EXA_PREPARE_SRC]) /* tile */ - exaFinishAccess(&pExaScr->prepare_access[EXA_PREPARE_SRC]->drawable, EXA_PREPARE_SRC); + if (pTile) + exaFinishAccess(&pTile->drawable, EXA_PREPARE_SRC); if (pGC->stipple) exaFinishAccess(&pGC->stipple->drawable, EXA_PREPARE_MASK); @@ -863,13 +828,6 @@ exaValidateGC(GCPtr pGC, /* restore copy of fb layer pointer. */ pExaScr->SavedDestroyPixmap = old_ptr2; - if (pExaScr->prepare_access[EXA_PREPARE_DEST]) - exaFinishAccess(&pExaScr->prepare_access[EXA_PREPARE_DEST]->drawable, - EXA_PREPARE_DEST); - if (pExaScr->prepare_access[EXA_PREPARE_AUX_DEST]) - exaFinishAccess(&pExaScr->prepare_access[EXA_PREPARE_AUX_DEST]->drawable, - EXA_PREPARE_AUX_DEST); - EXA_GC_EPILOGUE(pGC); } @@ -979,10 +937,10 @@ exaChangeWindowAttributes(WindowPtr pWin, unsigned long mask) ret = pScreen->ChangeWindowAttributes(pWin, mask); swap(pExaScr, pScreen, ChangeWindowAttributes); - if (pExaScr->prepare_access[EXA_PREPARE_SRC]) /* background */ - exaFinishAccess(&pExaScr->prepare_access[EXA_PREPARE_SRC]->drawable, EXA_PREPARE_SRC); - if (pExaScr->prepare_access[EXA_PREPARE_MASK]) /* border */ - exaFinishAccess(&pExaScr->prepare_access[EXA_PREPARE_MASK]->drawable, EXA_PREPARE_MASK); + if ((mask & CWBackPixmap) && pWin->backgroundState == BackgroundPixmap) + exaFinishAccess(&pWin->background.pixmap->drawable, EXA_PREPARE_SRC); + if ((mask & CWBorderPixmap) && pWin->borderIsPixel == FALSE) + exaFinishAccess(&pWin->border.pixmap->drawable, EXA_PREPARE_MASK); /* switch back to the normal upper layer. */ unwrap(pExaScr, pScreen, CreatePixmap); @@ -994,13 +952,6 @@ exaChangeWindowAttributes(WindowPtr pWin, unsigned long mask) /* restore copy of fb layer pointer. */ pExaScr->SavedDestroyPixmap = old_ptr2; - if (pExaScr->prepare_access[EXA_PREPARE_DEST]) - exaFinishAccess(&pExaScr->prepare_access[EXA_PREPARE_DEST]->drawable, - EXA_PREPARE_DEST); - if (pExaScr->prepare_access[EXA_PREPARE_AUX_DEST]) - exaFinishAccess(&pExaScr->prepare_access[EXA_PREPARE_AUX_DEST]->drawable, - EXA_PREPARE_AUX_DEST); - return ret; } diff --git a/exa/exa_priv.h b/exa/exa_priv.h index b3df1a5..6b61104 100644 --- a/exa/exa_priv.h +++ b/exa/exa_priv.h @@ -176,9 +176,6 @@ typedef struct { CARD32 lastDefragment; CARD32 nextDefragment; - /* Store all accessed pixmaps, so we can check for duplicates. */ - PixmapPtr prepare_access[6]; - /* Holds information on fallbacks that cannot be relayed otherwise. */ unsigned int fallback_flags;