summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@mandolin.keithp.com>2006-11-02 13:42:17 -0800
committerKeith Packard <keithp@mandolin.keithp.com>2006-11-02 13:44:59 -0800
commit56f6d4f1bb67f447500af3f4f7fa557c3e887baa (patch)
tree97ea65114249256280951447c99b2e8212d84d26
parentf22d9bcc25aea19ba38d35282367b591fd1b7ca0 (diff)
Disable the panel fitter when not using it. Cleans up SDVO DVI output.
The panel fitter appears to exist on the 965 hardware (at least) and causes troubles with DVI output over SDVO when enabled. This patch checks to see if the panel fitter is pointing at the pipe being configured and disables it unconditionally in that case. The LVDS driver will configure it correctly if necessary afterwards.
-rw-r--r--src/i830_display.c10
-rw-r--r--src/i830_driver.c4
-rw-r--r--src/i830_lvds.c2
3 files changed, 14 insertions, 2 deletions
diff --git a/src/i830_display.c b/src/i830_display.c
index b3019f80..4716e865 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -607,6 +607,16 @@ i830PipeSetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode, int pipe)
pI830->output[i].post_set_mode(pScrn, &pI830->output[i], pMode);
}
+ /*
+ * If the panel fitter is stuck on our pipe, turn it off
+ * the LVDS output will whack it correctly if it needs it
+ */
+ if (((INREG(PFIT_CONTROL) >> 29) & 0x3) == pipe)
+ OUTREG(PFIT_CONTROL, 0);
+
+ OUTREG(PFIT_PGM_RATIOS, 0x10001000);
+ OUTREG(DSPARB, (47 << 0) | (95 << 7));
+
OUTREG(htot_reg, htot);
OUTREG(hblank_reg, hblank);
OUTREG(hsync_reg, hsync);
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 779037b0..4fb8ac26 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -2308,6 +2308,8 @@ SaveHWState(ScrnInfoPtr pScrn)
pI830->saveSWF[15] = INREG(SWF31);
pI830->saveSWF[16] = INREG(SWF32);
+ pI830->savePFIT_CONTROL = INREG(PFIT_CONTROL);
+
for (i = 0; i < pI830->num_outputs; i++) {
if (pI830->output[i].save != NULL)
pI830->output[i].save(pScrn, &pI830->output[i]);
@@ -2426,6 +2428,8 @@ RestoreHWState(ScrnInfoPtr pScrn)
OUTREG(SWF31, pI830->saveSWF[15]);
OUTREG(SWF32, pI830->saveSWF[16]);
+ OUTREG(PFIT_CONTROL, pI830->savePFIT_CONTROL);
+
i830CompareRegsToSnapshot(pScrn);
return TRUE;
diff --git a/src/i830_lvds.c b/src/i830_lvds.c
index 7b9fe634..ea45420f 100644
--- a/src/i830_lvds.c
+++ b/src/i830_lvds.c
@@ -86,7 +86,6 @@ i830_lvds_save(ScrnInfoPtr pScrn, I830OutputPtr output)
{
I830Ptr pI830 = I830PTR(pScrn);
- pI830->savePFIT_CONTROL = INREG(PFIT_CONTROL);
pI830->savePP_ON = INREG(LVDSPP_ON);
pI830->savePP_OFF = INREG(LVDSPP_OFF);
pI830->saveLVDS = INREG(LVDS);
@@ -115,7 +114,6 @@ i830_lvds_restore(ScrnInfoPtr pScrn, I830OutputPtr output)
OUTREG(LVDSPP_ON, pI830->savePP_ON);
OUTREG(LVDSPP_OFF, pI830->savePP_OFF);
OUTREG(PP_CYCLE, pI830->savePP_CYCLE);
- OUTREG(PFIT_CONTROL, pI830->savePFIT_CONTROL);
OUTREG(LVDS, pI830->saveLVDS);
OUTREG(PP_CONTROL, pI830->savePP_CONTROL);
if (pI830->savePP_CONTROL & POWER_TARGET_ON)