summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2008-06-10 11:31:22 -0700
committerZhenyu Wang <zhenyu.z.wang@intel.com>2008-06-12 13:56:55 +0800
commitd3df74ebb0b61cda347e5e4754f2fc8a4c3110b0 (patch)
tree906dc006feacb31e3c1093190e849027bc22d1b2 /src
parent9d767d62fec724079178844915cd3feb9df93c7e (diff)
Set up/restore PWRCTXA from enter/leavevt not server start/exit.
This should improve behavior in the presence of VT switching, but also avoids a crash on X exit from writing the register after unmapping mmio.
Diffstat (limited to 'src')
-rw-r--r--src/i830.h1
-rw-r--r--src/i830_driver.c15
2 files changed, 10 insertions, 6 deletions
diff --git a/src/i830.h b/src/i830.h
index a96fa5b5..def693fb 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -649,6 +649,7 @@ typedef struct _I830Rec {
uint32_t saveRENCLK_GATE_D2;
uint32_t saveDSPCLK_GATE_D;
uint32_t saveRAMCLK_GATE_D;
+ uint32_t savePWRCTXA;
enum last_3d *last_3d;
diff --git a/src/i830_driver.c b/src/i830_driver.c
index cff1fe82..563d167f 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -2069,6 +2069,9 @@ SaveHWState(ScrnInfoPtr pScrn)
pI830->saveRAMCLK_GATE_D = INREG(RAMCLK_GATE_D);
}
+ if (IS_I965GM(pI830) || IS_IGD_GM(pI830))
+ pI830->savePWRCTXA = INREG(PWRCTXA);
+
if (IS_MOBILE(pI830) && !IS_I830(pI830))
pI830->saveLVDS = INREG(LVDS);
pI830->savePFIT_CONTROL = INREG(PFIT_CONTROL);
@@ -2134,6 +2137,9 @@ RestoreHWState(ScrnInfoPtr pScrn)
OUTREG(RAMCLK_GATE_D, pI830->saveRAMCLK_GATE_D);
}
+ if (IS_I965GM(pI830) || IS_IGD_GM(pI830))
+ OUTREG(PWRCTXA, pI830->savePWRCTXA);
+
/*
* Pipe regs
* To restore the saved state, we first need to program the PLL regs,
@@ -2846,9 +2852,6 @@ I830ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv)
return FALSE;
}
- if (pI830->power_context)
- OUTREG(PWRCTXA, pI830->power_context->offset | PWRCTX_EN);
-
I830UnmapMMIO(pScrn);
i830_fixup_mtrrs(pScrn);
@@ -3304,6 +3307,9 @@ I830EnterVT(int scrnIndex, int flags)
i830_init_clock_gating(pScrn);
+ if (pI830->power_context)
+ OUTREG(PWRCTXA, pI830->power_context->offset | PWRCTX_EN);
+
/* Clear the framebuffer */
memset(pI830->FbBase + pScrn->fbOffset, 0,
pScrn->virtualY * pScrn->displayWidth * pI830->cpp);
@@ -3459,9 +3465,6 @@ I830CloseScreen(int scrnIndex, ScreenPtr pScreen)
}
#endif
- if (IS_I965GM(pI830) || IS_IGD_GM(pI830))
- OUTREG(PWRCTXA, 0);
-
if (I830IsPrimary(pScrn)) {
xf86GARTCloseScreen(scrnIndex);