EXA: Add a couple of missing exaPrepare/FinishAccess calls.
This commit is contained in:
parent
84eb7e6224
commit
e510a77ba4
57
exa/exa.c
57
exa/exa.c
|
@ -452,11 +452,9 @@ exaValidateGC (GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
|
|||
if (!pGC->tileIsPixel && FbEvenTile (pGC->tile.pixmap->drawable.width *
|
||||
pDrawable->bitsPerPixel))
|
||||
{
|
||||
/* XXX This fixes corruption with tiled pixmaps, but may just be a
|
||||
* workaround for broken drivers
|
||||
*/
|
||||
exaMoveOutPixmap(pGC->tile.pixmap);
|
||||
exaPrepareAccess(&pGC->tile.pixmap->drawable, EXA_PREPARE_SRC);
|
||||
fbPadPixmap (pGC->tile.pixmap);
|
||||
exaFinishAccess(&pGC->tile.pixmap->drawable, EXA_PREPARE_SRC);
|
||||
exaPixmapDirty(pGC->tile.pixmap, 0, 0,
|
||||
pGC->tile.pixmap->drawable.width,
|
||||
pGC->tile.pixmap->drawable.height);
|
||||
|
@ -467,7 +465,9 @@ exaValidateGC (GCPtr pGC, unsigned long changes, DrawablePtr pDrawable)
|
|||
changes &= ~GCTile;
|
||||
}
|
||||
|
||||
exaPrepareAccessGC(pGC);
|
||||
fbValidateGC (pGC, changes, pDrawable);
|
||||
exaFinishAccessGC(pGC);
|
||||
|
||||
pGC->ops = (GCOps *) &exaOps;
|
||||
}
|
||||
|
@ -497,6 +497,47 @@ exaCreateGC (GCPtr pGC)
|
|||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
exaPrepareAccessWindow(WindowPtr pWin)
|
||||
{
|
||||
if (pWin->backgroundState == BackgroundPixmap)
|
||||
exaPrepareAccess(&pWin->background.pixmap->drawable, EXA_PREPARE_SRC);
|
||||
|
||||
if (pWin->borderIsPixel == FALSE)
|
||||
exaPrepareAccess(&pWin->border.pixmap->drawable, EXA_PREPARE_SRC);
|
||||
}
|
||||
|
||||
void
|
||||
exaFinishAccessWindow(WindowPtr pWin)
|
||||
{
|
||||
if (pWin->backgroundState == BackgroundPixmap)
|
||||
exaFinishAccess(&pWin->background.pixmap->drawable, EXA_PREPARE_SRC);
|
||||
|
||||
if (pWin->borderIsPixel == FALSE)
|
||||
exaFinishAccess(&pWin->border.pixmap->drawable, EXA_PREPARE_SRC);
|
||||
}
|
||||
|
||||
static Bool
|
||||
exaChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
|
||||
{
|
||||
Bool ret;
|
||||
|
||||
exaPrepareAccessWindow(pWin);
|
||||
ret = fbChangeWindowAttributes(pWin, mask);
|
||||
exaFinishAccessWindow(pWin);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static RegionPtr
|
||||
exaBitmapToRegion(PixmapPtr pPix)
|
||||
{
|
||||
RegionPtr ret;
|
||||
exaPrepareAccess(&pPix->drawable, EXA_PREPARE_SRC);
|
||||
ret = fbPixmapToRegion(pPix);
|
||||
exaFinishAccess(&pPix->drawable, EXA_PREPARE_SRC);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
* exaCloseScreen() unwraps its wrapped screen functions and tears down EXA's
|
||||
* screen private, before calling down to the next CloseSccreen.
|
||||
|
@ -518,6 +559,8 @@ exaCloseScreen(int i, ScreenPtr pScreen)
|
|||
pScreen->CreatePixmap = pExaScr->SavedCreatePixmap;
|
||||
pScreen->DestroyPixmap = pExaScr->SavedDestroyPixmap;
|
||||
pScreen->CopyWindow = pExaScr->SavedCopyWindow;
|
||||
pScreen->ChangeWindowAttributes = pExaScr->SavedChangeWindowAttributes;
|
||||
pScreen->BitmapToRegion = pExaScr->SavedBitmapToRegion;
|
||||
#ifdef RENDER
|
||||
if (ps) {
|
||||
ps->Composite = pExaScr->SavedComposite;
|
||||
|
@ -660,6 +703,12 @@ exaDriverInit (ScreenPtr pScreen,
|
|||
pExaScr->SavedCopyWindow = pScreen->CopyWindow;
|
||||
pScreen->CopyWindow = exaCopyWindow;
|
||||
|
||||
pExaScr->SavedChangeWindowAttributes = pScreen->ChangeWindowAttributes;
|
||||
pScreen->ChangeWindowAttributes = exaChangeWindowAttributes;
|
||||
|
||||
pExaScr->SavedBitmapToRegion = pScreen->BitmapToRegion;
|
||||
pScreen->BitmapToRegion = exaBitmapToRegion;
|
||||
|
||||
pExaScr->SavedPaintWindowBackground = pScreen->PaintWindowBackground;
|
||||
pScreen->PaintWindowBackground = exaPaintWindow;
|
||||
|
||||
|
|
|
@ -106,6 +106,8 @@ typedef struct {
|
|||
DestroyPixmapProcPtr SavedDestroyPixmap;
|
||||
PaintWindowBorderProcPtr SavedPaintWindowBorder;
|
||||
CopyWindowProcPtr SavedCopyWindow;
|
||||
ChangeWindowAttributesProcPtr SavedChangeWindowAttributes;
|
||||
BitmapToRegionProcPtr SavedBitmapToRegion;
|
||||
#ifdef RENDER
|
||||
CompositeProcPtr SavedComposite;
|
||||
RasterizeTrapezoidProcPtr SavedRasterizeTrapezoid;
|
||||
|
@ -113,6 +115,7 @@ typedef struct {
|
|||
GlyphsProcPtr SavedGlyphs;
|
||||
TrapezoidsProcPtr SavedTrapezoids;
|
||||
#endif
|
||||
|
||||
Bool swappedOut;
|
||||
enum ExaMigrationHeuristic migration;
|
||||
Bool hideOffscreenPixmapData;
|
||||
|
@ -190,6 +193,12 @@ typedef struct _ExaMigrationRec {
|
|||
*/
|
||||
void exaDDXDriverInit (ScreenPtr pScreen);
|
||||
|
||||
void
|
||||
exaPrepareAccessWindow(WindowPtr pWin);
|
||||
|
||||
void
|
||||
exaFinishAccessWindow(WindowPtr pWin);
|
||||
|
||||
/* exa_unaccel.c */
|
||||
void
|
||||
exaPrepareAccessGC(GCPtr pGC);
|
||||
|
|
|
@ -35,10 +35,13 @@
|
|||
*
|
||||
* Solid doesn't use an extra pixmap source, and Stippled/OpaqueStippled are
|
||||
* 1bpp and never in fb, so we don't worry about them.
|
||||
* We should worry about them for completeness sake and going forward.
|
||||
*/
|
||||
void
|
||||
exaPrepareAccessGC(GCPtr pGC)
|
||||
{
|
||||
if (pGC->stipple)
|
||||
exaPrepareAccess(&pGC->stipple->drawable, EXA_PREPARE_SRC);
|
||||
if (pGC->fillStyle == FillTiled)
|
||||
exaPrepareAccess(&pGC->tile.pixmap->drawable, EXA_PREPARE_SRC);
|
||||
}
|
||||
|
@ -51,6 +54,8 @@ exaFinishAccessGC(GCPtr pGC)
|
|||
{
|
||||
if (pGC->fillStyle == FillTiled)
|
||||
exaFinishAccess(&pGC->tile.pixmap->drawable, EXA_PREPARE_SRC);
|
||||
if (pGC->stipple)
|
||||
exaFinishAccess(&pGC->stipple->drawable, EXA_PREPARE_SRC);
|
||||
}
|
||||
|
||||
#if DEBUG_TRACE_FALL
|
||||
|
@ -294,7 +299,9 @@ ExaCheckPaintWindow (WindowPtr pWin, RegionPtr pRegion, int what)
|
|||
EXA_FALLBACK(("from %p (%c)\n", pWin,
|
||||
exaDrawableLocation(&pWin->drawable)));
|
||||
exaPrepareAccess (&pWin->drawable, EXA_PREPARE_DEST);
|
||||
exaPrepareAccessWindow(pWin);
|
||||
fbPaintWindow (pWin, pRegion, what);
|
||||
exaFinishAccessWindow(pWin);
|
||||
exaFinishAccess (&pWin->drawable, EXA_PREPARE_DEST);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue