summaryrefslogtreecommitdiff
path: root/exa/exa_offscreen.c
diff options
context:
space:
mode:
authorMichel Dänzer <daenzer@vmware.com>2009-02-27 16:37:27 +0100
committerMichel Dänzer <daenzer@vmware.com>2009-02-27 16:37:27 +0100
commitde022f8e634baf5a7acd186934b370647df58355 (patch)
tree361ed6d92d193abbf8d3da1b0e984880adad6416 /exa/exa_offscreen.c
parentd0dd649035fc3698c5b436f9d9d248116aa106a3 (diff)
Revert "EXA: Handle separate alpha maps properly in Composite fallback."
This reverts commit 170cf1270dff38d3cce7f5ba5b940d1c0d70eff5. Conflicts: exa/exa_render.c
Diffstat (limited to 'exa/exa_offscreen.c')
-rw-r--r--exa/exa_offscreen.c59
1 files changed, 53 insertions, 6 deletions
diff --git a/exa/exa_offscreen.c b/exa/exa_offscreen.c
index c45df6711..4aaa2c132 100644
--- a/exa/exa_offscreen.c
+++ b/exa/exa_offscreen.c
@@ -285,6 +285,36 @@ exaOffscreenAlloc (ScreenPtr pScreen, int size, int align,
return area;
}
+/**
+ * Ejects all offscreen areas, and uninitializes the offscreen memory manager.
+ */
+void
+ExaOffscreenSwapOut (ScreenPtr pScreen)
+{
+ ExaScreenPriv (pScreen);
+
+ ExaOffscreenValidate (pScreen);
+ /* loop until a single free area spans the space */
+ for (;;)
+ {
+ ExaOffscreenArea *area = pExaScr->info->offScreenAreas;
+
+ if (!area)
+ break;
+ if (area->state == ExaOffscreenAvail)
+ {
+ area = area->next;
+ if (!area)
+ break;
+ }
+ assert (area->state != ExaOffscreenAvail);
+ (void) ExaOffscreenKickOut (pScreen, area);
+ ExaOffscreenValidate (pScreen);
+ }
+ ExaOffscreenValidate (pScreen);
+ ExaOffscreenFini (pScreen);
+}
+
/** Ejects all pixmaps managed by EXA. */
static void
ExaOffscreenEjectPixmaps (ScreenPtr pScreen)
@@ -314,14 +344,26 @@ ExaOffscreenEjectPixmaps (ScreenPtr pScreen)
ExaOffscreenValidate (pScreen);
}
+void
+ExaOffscreenSwapIn (ScreenPtr pScreen)
+{
+ exaOffscreenInit (pScreen);
+}
+
/**
* Prepares EXA for disabling of FB access, or restoring it.
*
- * The disabling results in pixmaps being ejected, while other allocations
- * remain. With this plus the prevention of migration while swappedOut is
- * set, EXA by itself should not cause any access of the framebuffer to occur
- * while swapped out. Any remaining issues are the responsibility of the
- * driver.
+ * In version 2.1, the disabling results in pixmaps being ejected, while other
+ * allocations remain. With this plus the prevention of migration while
+ * swappedOut is set, EXA by itself should not cause any access of the
+ * framebuffer to occur while swapped out. Any remaining issues are the
+ * responsibility of the driver.
+ *
+ * Prior to version 2.1, all allocations, including locked ones, are ejected
+ * when access is disabled, and the allocator is torn down while swappedOut
+ * is set. This is more drastic, and caused implementation difficulties for
+ * many drivers that could otherwise handle the lack of FB access while
+ * swapped out.
*/
void
exaEnableDisableFBAccess (int index, Bool enable)
@@ -330,11 +372,16 @@ exaEnableDisableFBAccess (int index, Bool enable)
ExaScreenPriv (pScreen);
if (!enable && pExaScr->disableFbCount++ == 0) {
- ExaOffscreenEjectPixmaps (pScreen);
+ if (pExaScr->info->exa_minor < 1)
+ ExaOffscreenSwapOut (pScreen);
+ else
+ ExaOffscreenEjectPixmaps (pScreen);
pExaScr->swappedOut = TRUE;
}
if (enable && --pExaScr->disableFbCount == 0) {
+ if (pExaScr->info->exa_minor < 1)
+ ExaOffscreenSwapIn (pScreen);
pExaScr->swappedOut = FALSE;
}
}