From 9570cfdc132b0acb1d2b70edc6a3a5a812ef9691 Mon Sep 17 00:00:00 2001 From: Paulo Cesar Pereira de Andrade Date: Tue, 25 Nov 2008 15:07:39 -0200 Subject: Ensure the engine is idle before switching to a virtual terminal. At least in the smi501/502, it may even completely lock in some special cases (like when there is a browser playing some youtube video). The code in SMI_CloseScreen() was almost identical to SMI_LeaveVT(), so it now just call SMI_Leave() if required. --- src/smi_driver.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/smi_driver.c b/src/smi_driver.c index 9a42bc3..2d88a76 100644 --- a/src/smi_driver.c +++ b/src/smi_driver.c @@ -1038,6 +1038,8 @@ SMI_LeaveVT(int scrnIndex, int flags) ENTER(); + SMI_AccelSync(pScrn); + /* Ensure that the rotation BlockHandler is unwrapped, and the shadow pixmaps are deallocated, as the video memory is going to be unmapped. */ @@ -1807,17 +1809,9 @@ SMI_CloseScreen(int scrnIndex, ScreenPtr pScreen) if (pSmi->HwCursor) xf86_cursors_fini(pScreen); - if (pScrn->vtSema) { - if (!IS_MSOC(pSmi)) { - vgaHWPtr hwp = VGAHWPTR(pScrn); - - SMILynx_WriteMode(pScrn, &hwp->SavedReg, pSmi->save); - vgaHWLock(hwp); - } - else - SMI501_WriteMode(pScrn, pSmi->save); - SMI_UnmapMem(pScrn); - } + if (pScrn->vtSema) + /* Restore console mode and unmap framebuffer */ + SMI_LeaveVT(scrnIndex, 0); if (pSmi->XAAInfoRec != NULL) { XAADestroyInfoRec(pSmi->XAAInfoRec); -- cgit v1.2.3