summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland Scheidegger <rscheidegger_lists@hispeed.ch>2005-09-27 23:55:15 +0000
committerRoland Scheidegger <rscheidegger_lists@hispeed.ch>2005-09-27 23:55:15 +0000
commite7b1af5d1677e53820dd1c0926cc8b5a4284901e (patch)
treeb333fbd9729e5c45fb71aaeaae0bfd2bfe64a52e
parentbc3c26fe365347c427e04385c1df95a5eec14f28 (diff)
Move the RADEONEnablePageFlip/RADEONChangeSurfaces calls back to the end of
the function (the code above will cause pixmap cache to be freed and copied around, and these functions must be called after that otherwise pixmap damage will occur). May be related to #4440, #4456 (unclear if these setups involve 3d apps)
-rw-r--r--src/radeon_dri.c129
1 files changed, 64 insertions, 65 deletions
diff --git a/src/radeon_dri.c b/src/radeon_dri.c
index 05a7169e..57c5b15c 100644
--- a/src/radeon_dri.c
+++ b/src/radeon_dri.c
@@ -1867,83 +1867,82 @@ static void RADEONDRITransitionTo3d(ScreenPtr pScreen)
FBAreaPtr fbarea;
int width, height;
- info->have3DWindows = 1;
-
- RADEONChangeSurfaces(pScrn);
- RADEONEnablePageFlip(pScreen);
-
- if (info->cursor_offset != 0)
- xf86ForceHWCursor (pScreen, TRUE);
-
#ifdef USE_XAA
/* EXA allocates these areas up front, so it doesn't do the following
* stuff.
*/
- if (info->useEXA)
- return;
-
- /* reserve offscreen area for back and depth buffers and textures */
-
- /* If we still have an area for the back buffer reserved, free it
- * first so we always start with all free offscreen memory, except
- * maybe for Xv
- */
- if (info->backArea) {
- xf86FreeOffscreenArea(info->backArea);
- info->backArea = NULL;
- }
+ if (!info->useEXA) {
+ /* reserve offscreen area for back and depth buffers and textures */
- xf86PurgeUnlockedOffscreenAreas(pScreen);
+ /* If we still have an area for the back buffer reserved, free it
+ * first so we always start with all free offscreen memory, except
+ * maybe for Xv
+ */
+ if (info->backArea) {
+ xf86FreeOffscreenArea(info->backArea);
+ info->backArea = NULL;
+ }
- xf86QueryLargestOffscreenArea(pScreen, &width, &height, 0, 0, 0);
+ xf86PurgeUnlockedOffscreenAreas(pScreen);
- /* Free Xv linear offscreen memory if necessary
- * FIXME: This is hideous. What about telling xv "oh btw you have no memory
- * any more?" -- anholt
- */
- if (height < (info->depthTexLines + info->backLines)) {
- RADEONPortPrivPtr portPriv = info->adaptor->pPortPrivates[0].ptr;
- xf86FreeOffscreenLinear((FBLinearPtr)portPriv->video_memory);
- portPriv->video_memory = NULL;
xf86QueryLargestOffscreenArea(pScreen, &width, &height, 0, 0, 0);
- }
- /* Reserve placeholder area so the other areas will match the
- * pre-calculated offsets
- * FIXME: We may have other locked allocations and thus this would allocate
- * in the wrong place. The XV surface allocations seem likely. -- anholt
- */
- fbarea = xf86AllocateOffscreenArea(pScreen, pScrn->displayWidth,
- height
- - info->depthTexLines
- - info->backLines,
- pScrn->displayWidth,
- NULL, NULL, NULL);
- if (!fbarea)
- xf86DrvMsg(pScreen->myNum, X_ERROR, "Unable to reserve placeholder "
- "offscreen area, you might experience screen corruption\n");
-
- info->backArea = xf86AllocateOffscreenArea(pScreen, pScrn->displayWidth,
- info->backLines,
- pScrn->displayWidth,
- NULL, NULL, NULL);
- if (!info->backArea)
- xf86DrvMsg(pScreen->myNum, X_ERROR, "Unable to reserve offscreen "
- "area for back buffer, you might experience screen "
- "corruption\n");
-
- info->depthTexArea = xf86AllocateOffscreenArea(pScreen,
- pScrn->displayWidth,
- info->depthTexLines,
+ /* Free Xv linear offscreen memory if necessary
+ * FIXME: This is hideous. What about telling xv "oh btw you have no memory
+ * any more?" -- anholt
+ */
+ if (height < (info->depthTexLines + info->backLines)) {
+ RADEONPortPrivPtr portPriv = info->adaptor->pPortPrivates[0].ptr;
+ xf86FreeOffscreenLinear((FBLinearPtr)portPriv->video_memory);
+ portPriv->video_memory = NULL;
+ xf86QueryLargestOffscreenArea(pScreen, &width, &height, 0, 0, 0);
+ }
+
+ /* Reserve placeholder area so the other areas will match the
+ * pre-calculated offsets
+ * FIXME: We may have other locked allocations and thus this would allocate
+ * in the wrong place. The XV surface allocations seem likely. -- anholt
+ */
+ fbarea = xf86AllocateOffscreenArea(pScreen, pScrn->displayWidth,
+ height
+ - info->depthTexLines
+ - info->backLines,
+ pScrn->displayWidth,
+ NULL, NULL, NULL);
+ if (!fbarea)
+ xf86DrvMsg(pScreen->myNum, X_ERROR, "Unable to reserve placeholder "
+ "offscreen area, you might experience screen corruption\n");
+
+ info->backArea = xf86AllocateOffscreenArea(pScreen, pScrn->displayWidth,
+ info->backLines,
pScrn->displayWidth,
NULL, NULL, NULL);
- if (!info->depthTexArea)
- xf86DrvMsg(pScreen->myNum, X_ERROR, "Unable to reserve offscreen "
- "area for depth buffer and textures, you might "
- "experience screen corruption\n");
-
- xf86FreeOffscreenArea(fbarea);
+ if (!info->backArea)
+ xf86DrvMsg(pScreen->myNum, X_ERROR, "Unable to reserve offscreen "
+ "area for back buffer, you might experience screen "
+ "corruption\n");
+
+ info->depthTexArea = xf86AllocateOffscreenArea(pScreen,
+ pScrn->displayWidth,
+ info->depthTexLines,
+ pScrn->displayWidth,
+ NULL, NULL, NULL);
+ if (!info->depthTexArea)
+ xf86DrvMsg(pScreen->myNum, X_ERROR, "Unable to reserve offscreen "
+ "area for depth buffer and textures, you might "
+ "experience screen corruption\n");
+
+ xf86FreeOffscreenArea(fbarea);
+ }
#endif /* USE_XAA */
+
+ info->have3DWindows = 1;
+
+ RADEONChangeSurfaces(pScrn);
+ RADEONEnablePageFlip(pScreen);
+
+ if (info->cursor_offset != 0)
+ xf86ForceHWCursor (pScreen, TRUE);
}
static void RADEONDRITransitionTo2d(ScreenPtr pScreen)