diff options
author | Roland Scheidegger <sroland@student.ethz.ch> | 2005-09-27 23:55:15 +0000 |
---|---|---|
committer | Roland Scheidegger <sroland@student.ethz.ch> | 2005-09-27 23:55:15 +0000 |
commit | 09a66e9ed23536af8b17210b32676135aad81986 (patch) | |
tree | de7fcadc72b300a755a667e95286dde21e7731c0 | |
parent | a15f75dce05306a7e8b90e9e63f74fd55e1f556c (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.c | 129 |
1 files changed, 64 insertions, 65 deletions
diff --git a/src/radeon_dri.c b/src/radeon_dri.c index 05a7169..57c5b15 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) |