diff options
author | Thomas Hellström <thomas@shipmail.org> | 2006-12-06 11:47:06 +0000 |
---|---|---|
committer | Thomas Hellström <thomas@shipmail.org> | 2006-12-06 11:47:06 +0000 |
commit | 6287adc6a76a87b961eeb2428518028428714fa3 (patch) | |
tree | 29fda8a6cdd7b0607c62a58b47fc7293a9171082 /unichrome | |
parent | cfdd308776e142fda9d9214ed07e6f067bcf43c7 (diff) |
Now that we initialize the 3D engine every time we write
mode, make sure this is done before setting up VQ and AGP
so that those settings persist. The GPU will be unstable
otherwise.
Also fix some code comments.
Diffstat (limited to 'unichrome')
-rw-r--r-- | unichrome/via_driver.c | 14 | ||||
-rw-r--r-- | unichrome/via_vbe.c | 12 |
2 files changed, 10 insertions, 16 deletions
diff --git a/unichrome/via_driver.c b/unichrome/via_driver.c index 3823a50..25e54b3 100644 --- a/unichrome/via_driver.c +++ b/unichrome/via_driver.c @@ -1675,8 +1675,7 @@ static void VIALeaveVT(int scrnIndex, int flags) viaAccelSync(pScrn); /* - * Next line apparently helps fix 3D hang on VT switch. - * No idea why. Taken from VIA's binary drivers. + * A soft reset helps fix 3D hang on VT switch. */ hwp->writeSeq(hwp, 0x1A, pVia->SavedReg.SR1A | 0x40); @@ -2384,19 +2383,18 @@ VIAWriteMode(ScrnInfoPtr pScrn, DisplayModePtr mode) pScrn->vtSema = TRUE; - /* FIXME - need DRI lock And engine idle */ if (!pVia->IsSecondary) ViaModePrimary(pScrn, mode); else ViaModeSecondary(pScrn, mode); /* Enable the graphics engine. */ - if (!pVia->NoAccel) - viaInitialize2DEngine(pScrn); - + if (!pVia->NoAccel) { #if defined(XF86DRI) || defined(VIA_HAVE_EXA) - VIAInitialize3DEngine(pScrn); + VIAInitialize3DEngine(pScrn); #endif + viaInitialize2DEngine(pScrn); + } VIAAdjustFrame(pScrn->scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); return TRUE; @@ -2422,7 +2420,7 @@ static Bool VIACloseScreen(int scrnIndex, ScreenPtr pScreen) viaAccelSync(pScrn); - /* Fix 3D Hang after X restart */ + /* A soft reset Fixes 3D Hang after X restart */ hwp->writeSeq(hwp, 0x1A, pVia->SavedReg.SR1A | 0x40); diff --git a/unichrome/via_vbe.c b/unichrome/via_vbe.c index acea863..70fddfb 100644 --- a/unichrome/via_vbe.c +++ b/unichrome/via_vbe.c @@ -158,16 +158,12 @@ ViaVbeSetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode) pScrn->vtSema = TRUE; - /* - * FIXME: Take DRI lock and wait for engine idle here. - */ - - if (!pVia->NoAccel) - viaInitialize2DEngine(pScrn); - + if (!pVia->NoAccel) { #ifdef XF86DRI || defined(VIA_HAVE_EXA) - VIAInitialize3DEngine(pScrn); + VIAInitialize3DEngine(pScrn); #endif + viaInitialize2DEngine(pScrn); + } ViaVbeAdjustFrame(pScrn->scrnIndex, pScrn->frameX0, pScrn->frameY0, 0); |