diff options
author | Eric Anholt <anholt@FreeBSD.org> | 2006-06-26 12:54:30 +0200 |
---|---|---|
committer | Eric Anholt <anholt@FreeBSD.org> | 2006-06-26 12:54:30 +0200 |
commit | f113e9002cf53510e30984f816d44b06f1e71216 (patch) | |
tree | f21e40b3430cd65aa0acce2026c117e0061e8b15 | |
parent | 0e5cda3796ba0164496f0814eb57d1dfa7ab9257 (diff) |
Fix the plane/pipe disabling and turn off missing outputs when no longer DDCed.
-rw-r--r-- | src/i830_display.c | 8 | ||||
-rw-r--r-- | src/i830_modes.c | 10 |
2 files changed, 15 insertions, 3 deletions
diff --git a/src/i830_display.c b/src/i830_display.c index 4719cef2..05b7655b 100644 --- a/src/i830_display.c +++ b/src/i830_display.c @@ -633,8 +633,6 @@ i830DisableUnusedFunctions(ScrnInfoPtr pScrn) I830Ptr pI830 = I830PTR(pScrn); int outputsA, outputsB; - return; - outputsA = pI830->operatingDevices & 0xff; outputsB = (pI830->operatingDevices >> 8) & 0xff; @@ -644,7 +642,7 @@ i830DisableUnusedFunctions(ScrnInfoPtr pScrn) if ((outputsA & PIPE_CRT_ACTIVE) == 0 && (outputsB & PIPE_CRT_ACTIVE) == 0) { - CARD32 adpa = INREG(adpa); + CARD32 adpa = INREG(ADPA); if (adpa & ADPA_DAC_ENABLE) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Disabling CRT output\n"); @@ -704,6 +702,8 @@ i830DisableUnusedFunctions(ScrnInfoPtr pScrn) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Disabling DPLL A\n"); OUTREG(DPLL_A, dpll & ~DPLL_VCO_ENABLE); } + + memset(&pI830->pipeCurMode[0], 0, sizeof(pI830->pipeCurMode[0])); } if (!pI830->planeEnabled[1]) { @@ -729,6 +729,8 @@ i830DisableUnusedFunctions(ScrnInfoPtr pScrn) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Disabling DPLL B\n"); OUTREG(DPLL_B, dpll & ~DPLL_VCO_ENABLE); } + + memset(&pI830->pipeCurMode[1], 0, sizeof(pI830->pipeCurMode[1])); } } diff --git a/src/i830_modes.c b/src/i830_modes.c index fe28c7a8..a43fa617 100644 --- a/src/i830_modes.c +++ b/src/i830_modes.c @@ -603,7 +603,9 @@ I830ReprobePipeModeList(ScrnInfoPtr pScrn, int pipe) int i; int outputs; DisplayModePtr pMode; + Bool had_modes; + had_modes = (pI830->pipeModes[pipe] != NULL); while (pI830->pipeModes[pipe] != NULL) xf86DeleteMode(&pI830->pipeModes[pipe], pI830->pipeModes[pipe]); @@ -650,6 +652,14 @@ I830ReprobePipeModeList(ScrnInfoPtr pScrn, int pipe) { I830xf86SetModeCrtc(pMode, INTERLACE_HALVE_V); } + if (had_modes && pI830->pipeModes[pipe] == NULL) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Failed to DDC pipe %d, disabling output\n", pipe); + if (pipe == 0) + pI830->operatingDevices &= ~0x00ff; + else + pI830->operatingDevices &= ~0xff00; + } } else { ErrorF("don't know how to get modes for this device.\n"); } |