xf86-video-intel: src/i830_display.c
Jesse Barnes
jbarnes at kemper.freedesktop.org
Tue Sep 30 12:54:15 PDT 2008
src/i830_display.c | 48 +++++++++++++++++++++++++++++-------------------
1 file changed, 29 insertions(+), 19 deletions(-)
New commits:
commit 497b7420c4a76df553ed53322a390a1c754ce30c
Author: Olivier Fourdan <fourdan at xfce.org>
Date: Tue Sep 30 12:53:11 2008 -0700
Fix ordering of VGA vs. plane disable
From the Intel 965 Programmerâs Reference Manual, volume 3,
chapter 2.2.2 "Mode Switch Programming Sequence".
The disable sequence should be:
- Disable planes (VGA or hires)
- Disable pipe
- Disable VGA display in 0x71400 bit 31
This patch implements that order plus waits for a vblank at the end.
Fixes bug #17756.
diff --git a/src/i830_display.c b/src/i830_display.c
index ed49fb0..0632f3a 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -857,27 +857,31 @@ 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);
- /* Disable the VGA plane that we never use */
- OUTREG(VGACNTRL, VGA_DISP_DISABLE);
+ /*
+ * The documentation says :
+ * - Disable planes (VGA or hires)
+ * - Disable pipe
+ * - Disable VGA display
+ */
- /* May need to leave pipe A on */
- if ((pipe != 0) || !(pI830->quirk_flag & QUIRK_PIPEA_FORCE))
+ /* Disable display plane */
+ temp = INREG(dspcntr_reg);
+ if ((temp & DISPLAY_PLANE_ENABLE) != 0)
{
- /* Disable display plane */
- temp = INREG(dspcntr_reg);
- if ((temp & DISPLAY_PLANE_ENABLE) != 0)
- {
- OUTREG(dspcntr_reg, temp & ~DISPLAY_PLANE_ENABLE);
- /* Flush the plane changes */
- OUTREG(dspbase_reg, INREG(dspbase_reg));
- POSTING_READ(dspbase_reg);
- }
+ OUTREG(dspcntr_reg, temp & ~DISPLAY_PLANE_ENABLE);
+ /* Flush the plane changes */
+ OUTREG(dspbase_reg, INREG(dspbase_reg));
+ POSTING_READ(dspbase_reg);
+ }
- if (!IS_I9XX(pI830)) {
- /* Wait for vblank for the disable to take effect */
- i830WaitForVblank(pScrn);
- }
+ if (!IS_I9XX(pI830)) {
+ /* Wait for vblank for the disable to take effect */
+ i830WaitForVblank(pScrn);
+ }
+ /* May need to leave pipe A on */
+ if ((pipe != 0) || !(pI830->quirk_flag & QUIRK_PIPEA_FORCE))
+ {
/* Next, disable display pipes */
temp = INREG(pipeconf_reg);
if ((temp & PIPEACONF_ENABLE) != 0) {
@@ -893,9 +897,15 @@ i830_crtc_dpms(xf86CrtcPtr crtc, int mode)
OUTREG(dpll_reg, temp & ~DPLL_VCO_ENABLE);
POSTING_READ(dpll_reg);
}
+
+ /* Wait for the clocks to turn off. */
+ usleep(150);
}
- /* Wait for the clocks to turn off. */
- usleep(150);
+
+ /* Disable the VGA plane that we never use. */
+ OUTREG(VGACNTRL, VGA_DISP_DISABLE);
+ i830WaitForVblank(pScrn);
+
break;
}
More information about the xorg-commit
mailing list