summaryrefslogtreecommitdiff
path: root/src/i830_display.c
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@hobbes.virtuousgeek.org>2008-01-09 09:47:38 -0800
committerJesse Barnes <jbarnes@hobbes.virtuousgeek.org>2008-01-09 09:47:38 -0800
commit3c22ed633be2ac96eea7bc533839e956f1f31b84 (patch)
tree42d41b357f1e035f20a94a621b94d85c95c0f380 /src/i830_display.c
parentd3b41bcf231a6ffd289c128c06aa619f554a776c (diff)
Add pipe A force enable quirk
On some platforms, the firmware may read & write GPU registers on lid close, suspend/resume time or during various SMM events. If one of the graphics pipes is disabled at that time, the GPU may hang due to the programming dependencies of the various registers. This patch adds a quirk to force the driver to keep pipe A enabled if necessary, through user configuration in xorg.conf or via a platform specific quirk. Leaving the pipe enabled comes at a power cost however, so the quirk should only be enabled when strictly necessary. Fixes https://bugs.freedesktop.org/show_bug.cgi?id=11432.
Diffstat (limited to 'src/i830_display.c')
-rw-r--r--src/i830_display.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/i830_display.c b/src/i830_display.c
index 0e426249..d16871d4 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -724,6 +724,10 @@ i830_crtc_dpms(xf86CrtcPtr crtc, int mode)
/* Give the overlay scaler a chance to disable if it's on this pipe */
i830_crtc_dpms_video(crtc, FALSE);
+ /* May need to leave pipe A on */
+ if ((pipe == 0) && (pI830->quirk_flag & QUIRK_PIPEA_FORCE))
+ return;
+
/* Disable the VGA plane that we never use */
OUTREG(VGACNTRL, VGA_DISP_DISABLE);
@@ -1176,14 +1180,6 @@ i830_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
i830PrintPll("chosen", &clock);
}
- if (dpll & DPLL_VCO_ENABLE)
- {
- OUTREG(fp_reg, fp);
- OUTREG(dpll_reg, dpll & ~DPLL_VCO_ENABLE);
- POSTING_READ(dpll_reg);
- usleep(150);
- }
-
/* The LVDS pin pair needs to be on before the DPLLs are enabled.
* This is an exception to the general rule that mode_set doesn't turn
* things on.
@@ -1192,6 +1188,14 @@ i830_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
{
CARD32 lvds = INREG(LVDS);
+ if (dpll & DPLL_VCO_ENABLE)
+ {
+ OUTREG(fp_reg, fp);
+ OUTREG(dpll_reg, dpll & ~DPLL_VCO_ENABLE);
+ POSTING_READ(dpll_reg);
+ usleep(150);
+ }
+
lvds |= LVDS_PORT_EN | LVDS_A0A2_CLKA_POWER_UP | LVDS_PIPEB_SELECT;
/* Set the B0-B3 data pairs corresponding to whether we're going to
* set the DPLLs for dual-channel mode or not.