summaryrefslogtreecommitdiff
path: root/exa/exa.c
diff options
context:
space:
mode:
authorMaarten Maathuis <madman2003@gmail.com>2009-08-01 19:19:19 +0200
committerMaarten Maathuis <madman2003@gmail.com>2009-08-06 23:48:14 +0200
commit03ecb164f2592c954aa408bf121e0c67b604d854 (patch)
tree98acdd425239b9c8723cea9c537eebca70af8cba /exa/exa.c
parentac7ac913fd98ea359c05c89968ab53a3223615b4 (diff)
exa: A simple 3rd backend implementation.
- Based on driver pixmaps with some changes (completely transparent to driver). - It helps with the problem of known software fallbacks, such as trapezoids. - exaDoMigration is now called for all cases that provide a do_migration hook. - exa_migration.c is renamed to exa_migration_classic.c
Diffstat (limited to 'exa/exa.c')
-rw-r--r--exa/exa.c42
1 files changed, 33 insertions, 9 deletions
diff --git a/exa/exa.c b/exa/exa.c
index 0f3716894..fd9ba9001 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -217,6 +217,22 @@ exaSetFbPitch(ExaScreenPrivPtr pExaScr, ExaPixmapPrivPtr pExaPixmap,
}
/**
+ * Returns TRUE if the pixmap is not movable. This is the case where it's a
+ * pixmap which has no private (almost always bad) or it's a scratch pixmap created by
+ * some X Server internal component (the score says it's pinned).
+ */
+Bool
+exaPixmapIsPinned (PixmapPtr pPix)
+{
+ ExaPixmapPriv (pPix);
+
+ if (pExaPixmap == NULL)
+ EXA_FatalErrorDebugWithRet(("EXA bug: exaPixmapIsPinned was called on a non-exa pixmap.\n"), TRUE);
+
+ return pExaPixmap->score == EXA_PIXMAP_SCORE_PINNED;
+}
+
+/**
* exaPixmapIsOffscreen() is used to determine if a pixmap is in offscreen
* memory, meaning that acceleration could probably be done to it, and that it
* will need to be wrapped by PrepareAccess()/FinishAccess() when accessing it
@@ -237,7 +253,7 @@ exaPixmapIsOffscreen(PixmapPtr pPixmap)
if (!(pExaScr->info->flags & EXA_OFFSCREEN_PIXMAPS))
return FALSE;
- return pExaScr->pixmap_is_offscreen(pPixmap);
+ return (*pExaScr->pixmap_is_offscreen)(pPixmap);
}
/**
@@ -348,9 +364,9 @@ void
exaPrepareAccessReg(DrawablePtr pDrawable, int index, RegionPtr pReg)
{
PixmapPtr pPixmap = exaGetDrawablePixmap (pDrawable);
- ExaPixmapPriv(pPixmap);
+ ExaScreenPriv(pPixmap->drawable.pScreen);
- if (pExaPixmap->pDamage) {
+ if (pExaScr->do_migration) {
ExaMigrationRec pixmaps[1];
if (index == EXA_PREPARE_DEST || index == EXA_PREPARE_AUX_DEST) {
@@ -1037,11 +1053,19 @@ exaDriverInit (ScreenPtr pScreen,
return FALSE;
}
if (pExaScr->info->flags & EXA_HANDLES_PIXMAPS) {
- wrap(pExaScr, pScreen, CreatePixmap, exaCreatePixmap_driver);
- wrap(pExaScr, pScreen, DestroyPixmap, exaDestroyPixmap_driver);
- wrap(pExaScr, pScreen, ModifyPixmapHeader, exaModifyPixmapHeader_driver);
- pExaScr->do_migration = NULL;
- pExaScr->pixmap_is_offscreen = exaPixmapIsOffscreen_driver;
+ if (pExaScr->info->flags & EXA_MIXED_PIXMAPS) {
+ wrap(pExaScr, pScreen, CreatePixmap, exaCreatePixmap_mixed);
+ wrap(pExaScr, pScreen, DestroyPixmap, exaDestroyPixmap_mixed);
+ wrap(pExaScr, pScreen, ModifyPixmapHeader, exaModifyPixmapHeader_mixed);
+ pExaScr->do_migration = exaDoMigration_mixed;
+ pExaScr->pixmap_is_offscreen = exaPixmapIsOffscreen_mixed;
+ } else {
+ wrap(pExaScr, pScreen, CreatePixmap, exaCreatePixmap_driver);
+ wrap(pExaScr, pScreen, DestroyPixmap, exaDestroyPixmap_driver);
+ wrap(pExaScr, pScreen, ModifyPixmapHeader, exaModifyPixmapHeader_driver);
+ pExaScr->do_migration = NULL;
+ pExaScr->pixmap_is_offscreen = exaPixmapIsOffscreen_driver;
+ }
} else {
wrap(pExaScr, pScreen, CreatePixmap, exaCreatePixmap_classic);
wrap(pExaScr, pScreen, DestroyPixmap, exaDestroyPixmap_classic);
@@ -1162,5 +1186,5 @@ exaDoMigration (ExaMigrationPtr pixmaps, int npixmaps, Bool can_accel)
return;
if (pExaScr->do_migration)
- pExaScr->do_migration(pixmaps, npixmaps, can_accel);
+ (*pExaScr->do_migration)(pixmaps, npixmaps, can_accel);
}