Fix LVDS restore path, and move pipe assignment for outputs to the right place.

This commit is contained in:
Eric Anholt 2006-10-09 14:20:49 -07:00
parent 09e3d10b0f
commit 2591c1fcf1
2 changed files with 53 additions and 43 deletions

View File

@ -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]);

View File

@ -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);
}