xserver: Branch 'master' - 2 commits
Michel Dänzer
daenzer at kemper.freedesktop.org
Tue Aug 19 02:37:33 PDT 2008
exa/exa.c | 45 ++++++++++++++++++++-------------------------
exa/exa_priv.h | 6 ------
2 files changed, 20 insertions(+), 31 deletions(-)
New commits:
commit f227fbf74f0c619ecf3275cdb4c10b1a4b3a8cfc
Author: Michel Dänzer <michel at tungstengraphics.com>
Date: Tue Aug 19 11:36:12 2008 +0200
EXA: Inline Prepare/FinishAccessWindow into only caller, ChangeWindowAttributes.
Also check the requested mask in addition to the GC state before doing work.
diff --git a/exa/exa.c b/exa/exa.c
index 37a0bb0..ab7aab3 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -671,34 +671,25 @@ exaCreateGC (GCPtr pGC)
return TRUE;
}
-void
-exaPrepareAccessWindow(WindowPtr pWin)
+static Bool
+exaChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
{
- if (pWin->backgroundState == BackgroundPixmap)
+ Bool ret;
+
+ if ((mask & CWBackPixmap) && pWin->backgroundState == BackgroundPixmap)
exaPrepareAccess(&pWin->background.pixmap->drawable, EXA_PREPARE_SRC);
- if (pWin->borderIsPixel == FALSE)
- exaPrepareAccess(&pWin->border.pixmap->drawable, EXA_PREPARE_SRC);
-}
+ if ((mask & CWBorderPixmap) && pWin->borderIsPixel == FALSE)
+ exaPrepareAccess(&pWin->border.pixmap->drawable, EXA_PREPARE_MASK);
-void
-exaFinishAccessWindow(WindowPtr pWin)
-{
- if (pWin->backgroundState == BackgroundPixmap)
- exaFinishAccess(&pWin->background.pixmap->drawable, EXA_PREPARE_SRC);
+ ret = fbChangeWindowAttributes(pWin, mask);
- if (pWin->borderIsPixel == FALSE)
- exaFinishAccess(&pWin->border.pixmap->drawable, EXA_PREPARE_SRC);
-}
+ if ((mask & CWBorderPixmap) && pWin->borderIsPixel == FALSE)
+ exaFinishAccess(&pWin->border.pixmap->drawable, EXA_PREPARE_MASK);
-static Bool
-exaChangeWindowAttributes(WindowPtr pWin, unsigned long mask)
-{
- Bool ret;
+ if ((mask & CWBackPixmap) && pWin->backgroundState == BackgroundPixmap)
+ exaFinishAccess(&pWin->background.pixmap->drawable, EXA_PREPARE_SRC);
- exaPrepareAccessWindow(pWin);
- ret = fbChangeWindowAttributes(pWin, mask);
- exaFinishAccessWindow(pWin);
return ret;
}
diff --git a/exa/exa_priv.h b/exa/exa_priv.h
index 9ec2a56..dc6a6e0 100644
--- a/exa/exa_priv.h
+++ b/exa/exa_priv.h
@@ -260,12 +260,6 @@ typedef struct {
*/
void exaDDXDriverInit (ScreenPtr pScreen);
-void
-exaPrepareAccessWindow(WindowPtr pWin);
-
-void
-exaFinishAccessWindow(WindowPtr pWin);
-
/* exa_unaccel.c */
void
exaPrepareAccessGC(GCPtr pGC);
commit 825b3fe11d1b813bf8d5b24a880ed04b78ae1acf
Author: Michel Dänzer <michel at tungstengraphics.com>
Date: Tue Aug 19 11:22:40 2008 +0200
EXA: Don't use exaGlyphs if the driver doesn't provide a PrepareComposite hook.
It's buggy without Composite acceleration (leading to cropped glyphs) and not
really useful in that case anyway. The bug probably still needs to be found and
fixed for drivers that provide a PrepareComposite hook but can't accelerate
text rendering though.
diff --git a/exa/exa.c b/exa/exa.c
index e1bbb32..37a0bb0 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -752,7 +752,8 @@ exaCloseScreen(int i, ScreenPtr pScreen)
PictureScreenPtr ps = GetPictureScreenIfSet(pScreen);
#endif
- exaGlyphsFini(pScreen);
+ if (ps->Glyphs == exaGlyphs)
+ exaGlyphsFini(pScreen);
pScreen->CreateGC = pExaScr->SavedCreateGC;
pScreen->CloseScreen = pExaScr->SavedCloseScreen;
@@ -931,8 +932,10 @@ exaDriverInit (ScreenPtr pScreen,
pExaScr->SavedComposite = ps->Composite;
ps->Composite = exaComposite;
- pExaScr->SavedGlyphs = ps->Glyphs;
- ps->Glyphs = exaGlyphs;
+ if (pScreenInfo->PrepareComposite) {
+ pExaScr->SavedGlyphs = ps->Glyphs;
+ ps->Glyphs = exaGlyphs;
+ }
pExaScr->SavedTriangles = ps->Triangles;
ps->Triangles = exaTriangles;
@@ -993,7 +996,8 @@ exaDriverInit (ScreenPtr pScreen,
}
}
- exaGlyphsInit(pScreen);
+ if (ps->Glyphs == exaGlyphs)
+ exaGlyphsInit(pScreen);
LogMessage(X_INFO, "EXA(%d): Driver registered support for the following"
" operations:\n", pScreen->myNum);
More information about the xorg-commit
mailing list