summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2006-10-09 14:20:49 -0700
committerEric Anholt <eric@anholt.net>2006-10-09 14:20:49 -0700
commit2591c1fcf15608d96031be4760cf08534461ca34 (patch)
treed4ee94c32c41dbbde47407216ed772d3eb4dc1ec
parent09e3d10b0ff69d180467fa9099d12da08e4f681b (diff)
Fix LVDS restore path, and move pipe assignment for outputs to the right place.
-rw-r--r--src/i830_driver.c89
-rw-r--r--src/i830_lvds.c7
2 files changed, 53 insertions, 43 deletions
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 3a278fb0..1f53915a 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1668,45 +1668,6 @@ I830PreInit(ScrnInfoPtr pScrn, int flags)
pI830->MonType1 |= PIPE_CRT;
}
- /* Perform the pipe assignment of outputs. This code shouldn't exist,
- * but for now we're supporting the existing MonitorLayout configuration
- * scheme.
- */
- for (i = 0; i < pI830->num_outputs; i++) {
- pI830->output[i].disabled = FALSE;
-
- switch (pI830->output[i].type) {
- case I830_OUTPUT_LVDS:
- if (pI830->MonType1 & PIPE_LFP)
- pI830->output[i].pipe = 0;
- else if (pI830->MonType2 & PIPE_LFP)
- pI830->output[i].pipe = 1;
- else
- pI830->output[i].disabled = TRUE;
- break;
- case I830_OUTPUT_ANALOG:
- if (pI830->MonType1 & PIPE_CRT)
- pI830->output[i].pipe = 0;
- else if (pI830->MonType2 & PIPE_CRT)
- pI830->output[i].pipe = 1;
- else
- pI830->output[i].disabled = TRUE;
- break;
- case I830_OUTPUT_DVO:
- case I830_OUTPUT_SDVO:
- if (pI830->MonType1 & PIPE_DFP)
- pI830->output[i].pipe = 0;
- else if (pI830->MonType2 & PIPE_DFP)
- pI830->output[i].pipe = 1;
- else
- pI830->output[i].disabled = TRUE;
- break;
- default:
- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unhandled output type\n");
- break;
- }
- }
-
/* Check for attached SDVO outputs. Assume that they're flat panels for
* now. Though really, it's just a name at the moment, since we don't
* treat different SDVO outputs differently.
@@ -1766,6 +1727,48 @@ I830PreInit(ScrnInfoPtr pScrn, int flags)
pI830->Clone = TRUE;
}
+
+ /* Perform the pipe assignment of outputs. This code shouldn't exist,
+ * but for now we're supporting the existing MonitorLayout configuration
+ * scheme.
+ */
+ for (i = 0; i < pI830->num_outputs; i++) {
+ pI830->output[i].disabled = FALSE;
+
+ switch (pI830->output[i].type) {
+ case I830_OUTPUT_LVDS:
+ if (pI830->MonType1 & PIPE_LFP)
+ pI830->output[i].pipe = 0;
+ else if (pI830->MonType2 & PIPE_LFP)
+ pI830->output[i].pipe = 1;
+ else
+ pI830->output[i].disabled = TRUE;
+ break;
+ case I830_OUTPUT_ANALOG:
+ if (pI830->MonType1 & PIPE_CRT)
+ pI830->output[i].pipe = 0;
+ else if (pI830->MonType2 & PIPE_CRT)
+ pI830->output[i].pipe = 1;
+ else
+ pI830->output[i].disabled = TRUE;
+ break;
+ case I830_OUTPUT_DVO:
+ case I830_OUTPUT_SDVO:
+ if (pI830->MonType1 & PIPE_DFP)
+ pI830->output[i].pipe = 0;
+ else if (pI830->MonType2 & PIPE_DFP)
+ pI830->output[i].pipe = 1;
+ else
+ pI830->output[i].disabled = TRUE;
+ break;
+ default:
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unhandled output type\n");
+ break;
+ }
+ }
+
+
+
pI830->CloneRefresh = 60; /* default to 60Hz */
if (xf86GetOptValInteger(pI830->Options, OPTION_CLONE_REFRESH,
&(pI830->CloneRefresh))) {
@@ -2703,6 +2706,10 @@ RestoreHWState(ScrnInfoPtr pScrn)
}
}
+ for (i = 0; i < pI830->num_outputs; i++) {
+ pI830->output[i].restore(pScrn, &pI830->output[i]);
+ }
+
if (IS_I965G(pI830)) {
OUTREG(DSPASURF, pI830->saveDSPABASE);
OUTREG(DSPBSURF, pI830->saveDSPBBASE);
@@ -2719,10 +2726,6 @@ RestoreHWState(ScrnInfoPtr pScrn)
OUTREG(DSPACNTR, pI830->saveDSPACNTR);
OUTREG(DSPBCNTR, pI830->saveDSPBCNTR);
- for (i = 0; i < pI830->num_outputs; i++) {
- pI830->output[i].restore(pScrn, &pI830->output[i]);
- }
-
for(i = 0; i < 7; i++) {
OUTREG(SWF0 + (i << 2), pI830->saveSWF[i]);
OUTREG(SWF00 + (i << 2), pI830->saveSWF[i+7]);
diff --git a/src/i830_lvds.c b/src/i830_lvds.c
index 23fc0a77..186d33b5 100644
--- a/src/i830_lvds.c
+++ b/src/i830_lvds.c
@@ -117,6 +117,10 @@ i830_lvds_restore(ScrnInfoPtr pScrn, I830OutputPtr output)
OUTREG(PFIT_CONTROL, pI830->savePFIT_CONTROL);
OUTREG(LVDS, pI830->saveLVDS);
OUTREG(PP_CONTROL, pI830->savePP_CONTROL);
+ if (pI830->savePP_CONTROL & POWER_TARGET_ON)
+ i830SetLVDSPanelPower(pScrn, TRUE);
+ else
+ i830SetLVDSPanelPower(pScrn, FALSE);
}
static void
@@ -159,6 +163,9 @@ i830_lvds_post_set_mode(ScrnInfoPtr pScrn, I830OutputPtr output,
*/
OUTREG(LVDS, INREG(LVDS) | LVDS_PORT_EN | LVDS_PIPEB_SELECT);
+ /* Re-enable the PLL */
+ OUTREG(FPB0, INREG(FPB0) | DPLL_VCO_ENABLE);
+
i830SetLVDSPanelPower(pScrn, TRUE);
}