summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Simmons <jsimmons@infradead.org>2012-03-23 18:01:12 -0400
committerJames Simmons <jsimmons@infradead.org>2012-03-23 18:01:12 -0400
commit01cad2ac4d8d5b59474bd5f209621ea3b9d95bfa (patch)
tree4001d3e1b887e572bf683fb0b21c7276404ee87a
parentde380d662c9edc151814adfec9f96fe491bc2c11 (diff)
Fixed the crash that happened when you logged out of the session. It wass both initialize and restoring the video state on the call to EnterVT which locked up the system. This fix also restored the DMA command buffer
-rw-r--r--src/via_driver.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/via_driver.c b/src/via_driver.c
index 5595bfe..b73cba2 100644
--- a/src/via_driver.c
+++ b/src/via_driver.c
@@ -343,23 +343,20 @@ VIAEnterVT(int scrnIndex, int flags)
if (!xf86SetDesiredModes(pScrn))
return FALSE;
- /* Restore/Init video status. */
- if (flags && pVia->directRenderingType != DRI_2)
- viaInitVideo(pScrn->pScreen);
-
- if (!pVia->IsSecondary)
- viaRestoreVideo(pScrn);
+ if (!flags) {
+ /* Restore video status. */
+ if (!pVia->IsSecondary)
+ viaRestoreVideo(pScrn);
#ifdef XF86DRI
- if (pVia->directRenderingType == DRI_1) {
- kickVblank(pScrn);
- VIADRIRingBufferInit(pScrn);
- viaDRIOffscreenRestore(pScrn);
-
- if (!flags)
+ if (pVia->directRenderingType == DRI_1) {
+ kickVblank(pScrn);
+ VIADRIRingBufferInit(pScrn);
+ viaDRIOffscreenRestore(pScrn);
DRIUnlock(screenInfo.screens[scrnIndex]);
- }
+ }
#endif
+ }
return TRUE;
}
@@ -1854,9 +1851,12 @@ VIAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
if (!VIAEnterVT(scrnIndex, 1))
return FALSE;
- if (pVia->directRenderingType != DRI_2)
+ if (pVia->directRenderingType != DRI_2) {
UMSAccelSetup(pScrn);
+ viaInitVideo(pScrn->pScreen);
+ }
+
if (serverGeneration == 1)
xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options);