diff options
author | Jesse Barnes <jbarnes@hobbes.virtuousgeek.org> | 2007-11-08 09:31:08 -0800 |
---|---|---|
committer | Jesse Barnes <jbarnes@hobbes.virtuousgeek.org> | 2007-11-08 09:31:08 -0800 |
commit | eecd3ccedee6c4acf101591f7e60673660379e62 (patch) | |
tree | 360491dbcdfdf6e4727ec03856f5d37df5a26271 | |
parent | b434c1a437c407de88396b219560649c2dae82b2 (diff) |
Check DPLL status before writing PIPEnCONF regs
If the DPLL isn't enabled or is in VGA mode, writing the PIPEnCONF registers
may cause a hang or crash. So ensure the DPLL is in the proper state before
writing them.
Another excellent fix from Peter Clifton.
-rw-r--r-- | src/i830_driver.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/i830_driver.c b/src/i830_driver.c index 488232da..53c7845e 100644 --- a/src/i830_driver.c +++ b/src/i830_driver.c @@ -2052,7 +2052,13 @@ RestoreHWState(ScrnInfoPtr pScrn) OUTREG(DSPASURF, pI830->saveDSPASURF); OUTREG(DSPATILEOFF, pI830->saveDSPATILEOFF); } - OUTREG(PIPEACONF, pI830->savePIPEACONF); + /* + * Make sure the DPLL is active and not in VGA mode or the + * write of PIPEnCONF may cause a crash + */ + if ((pI830->saveDPLL_B & DPLL_VCO_ENABLE) && + (pI830->saveDPLL_B & DPLL_VGA_MODE_DIS)) + OUTREG(PIPEACONF, pI830->savePIPEACONF); i830WaitForVblank(pScrn); OUTREG(DSPACNTR, pI830->saveDSPACNTR); OUTREG(DSPABASE, INREG(DSPABASE)); @@ -2092,7 +2098,13 @@ RestoreHWState(ScrnInfoPtr pScrn) OUTREG(DSPBSURF, pI830->saveDSPBSURF); OUTREG(DSPBTILEOFF, pI830->saveDSPBTILEOFF); } - OUTREG(PIPEBCONF, pI830->savePIPEBCONF); + + /* + * See PIPEnCONF note above + */ + if ((pI830->saveDPLL_B & DPLL_VCO_ENABLE) && + (pI830->saveDPLL_B & DPLL_VGA_MODE_DIS)) + OUTREG(PIPEBCONF, pI830->savePIPEBCONF); i830WaitForVblank(pScrn); OUTREG(DSPBCNTR, pI830->saveDSPBCNTR); OUTREG(DSPBBASE, INREG(DSPBBASE)); |