summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@gmail.com>2008-12-16 02:39:49 +0100
committerPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-12-17 17:16:02 -0200
commit5a07709ae41600bc02205753c64d764f11838240 (patch)
treecbe02d712f6b8a388d7eb20842607c28c1e70bf4
parent47bcfb505886d16ff864f26a9cfa5f43b5da710e (diff)
Fix crashes when switching VTs with EXA enabled.
Call ModifyPixmapHeader on SMI_EnterVT to update the screen pixmap address tracked by EXA. Set memoryBase in the ExaDriverRec to NULL when switching out: some pixmap could get allocated near the former aperture address and it could be erroneously considered as being in offscreen memory.
-rw-r--r--src/smi_crtc.c9
-rw-r--r--src/smi_driver.c8
2 files changed, 13 insertions, 4 deletions
diff --git a/src/smi_crtc.c b/src/smi_crtc.c
index 49354ea..0ff4390 100644
--- a/src/smi_crtc.c
+++ b/src/smi_crtc.c
@@ -209,12 +209,13 @@ SMI_CrtcConfigResize(ScrnInfoPtr pScrn,
pSmi->FBOffset = fbArea->offset;
pScrn->fbOffset = pSmi->FBOffset + pSmi->fbMapOffset;
+ pScrn->pScreen->ModifyPixmapHeader(pScrn->pScreen->GetScreenPixmap(pScrn->pScreen),
+ -1,-1,-1,-1,-1, pSmi->FBBase + pSmi->FBOffset);
+
if(pScrn->pixmapPrivate.ptr)
- /* Framebuffer access is disabled */
+ /* The pixmap devPrivate just set may be overwritten by
+ xf86EnableDisableFBAccess */
pScrn->pixmapPrivate.ptr = pSmi->FBBase + pSmi->FBOffset;
- else
- pScrn->pScreen->ModifyPixmapHeader(pScrn->pScreen->GetScreenPixmap(pScrn->pScreen),
- -1,-1,-1,-1,-1, pSmi->FBBase + pSmi->FBOffset);
/* Modify the screen pitch */
pScrn->displayWidth = aligned_pitch / pSmi->Bpp;
diff --git a/src/smi_driver.c b/src/smi_driver.c
index b23b291..a3b0589 100644
--- a/src/smi_driver.c
+++ b/src/smi_driver.c
@@ -1016,7 +1016,10 @@ SMI_EnterVT(int scrnIndex, int flags)
pSmi->Save(pScrn);
/* FBBase may have changed after remapping the memory */
+ pScrn->pScreen->ModifyPixmapHeader(pScrn->pScreen->GetScreenPixmap(pScrn->pScreen),
+ -1,-1,-1,-1,-1, pSmi->FBBase + pSmi->FBOffset);
pScrn->pixmapPrivate.ptr=pSmi->FBBase + pSmi->FBOffset;
+
if(pSmi->useEXA)
pSmi->EXADriverPtr->memoryBase=pSmi->FBBase;
@@ -1060,6 +1063,11 @@ SMI_LeaveVT(int scrnIndex, int flags)
unmapped. */
xf86RotateCloseScreen(pScrn->pScreen);
+ /* Pixmaps that by chance get allocated near the former aperture
+ address shouldn't be considered offscreen. */
+ if(pSmi->useEXA)
+ pSmi->EXADriverPtr->memoryBase=NULL;
+
/* Clear frame buffer */
memset(pSmi->FBBase, 0, pSmi->videoRAMBytes);