summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@hobbes.virtuousgeek.org>2007-11-08 09:31:08 -0800
committerJesse Barnes <jbarnes@hobbes.virtuousgeek.org>2007-11-08 09:31:08 -0800
commiteecd3ccedee6c4acf101591f7e60673660379e62 (patch)
tree360491dbcdfdf6e4727ec03856f5d37df5a26271
parentb434c1a437c407de88396b219560649c2dae82b2 (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.c16
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));