summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@airlied-rhel5.(none)>2010-04-21 11:06:49 +1000
committerDave Airlie <airlied@airlied-rhel5.(none)>2010-04-21 11:06:49 +1000
commita3da29fb5642c94190eab177da358e6c6e3fc31d (patch)
tree26e30d534a9958566853b31ec47337c60179bf0e
parent81bba167f6ad7989a98e1c2dfc40209d436449a9 (diff)
intel-2.2.1-g4x-vga-plane-fix.patch
-rw-r--r--src/i830_display.c38
1 files changed, 20 insertions, 18 deletions
diff --git a/src/i830_display.c b/src/i830_display.c
index 8632bf13..28680c7b 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -669,29 +669,31 @@ i830_disable_vga_plane (xf86CrtcPtr crtc)
{
ScrnInfoPtr pScrn = crtc->scrn;
I830Ptr pI830 = I830PTR(pScrn);
- uint32_t vgacntrl = INREG(VGACNTRL);
uint8_t sr01;
- if (vgacntrl & VGA_DISP_DISABLE)
- return;
+ /*
+ * Bug #17235: G4X machine needs following steps
+ * before disable VGA.
+ * - set bit 5 of SR01;
+ * - Wait 30us;
+ * - disable vga plane;
+ * - restore SR01;
+ */
+ if (IS_G4X(pI830)) {
+ OUTREG8(SRX, 1);
+ sr01 = INREG8(SRX + 1);
+ OUTREG8(SRX + 1, sr01 | (1 << 5));
+ usleep(30);
+ }
- /*
- Set bit 5 of SR01;
- Wait 30us;
- */
- OUTREG8(SRX, 1);
- sr01 = INREG8(SRX + 1);
- OUTREG8(SRX + 1, sr01 | (1 << 5));
- usleep(30);
- /* disable center mode on 965GM and G4X platform */
- if (IS_I965GM(pI830) || IS_G4X(pI830))
- vgacntrl &= ~(3 << 24);
-
- vgacntrl |= VGA_DISP_DISABLE;
-
- OUTREG(VGACNTRL, vgacntrl);
+ OUTREG(VGACNTRL, VGA_DISP_DISABLE);
i830WaitForVblank(pScrn);
+ /* restore SR01 */
+ if (IS_G4X(pI830)) {
+ OUTREG8(SRX, 1);
+ OUTREG8(SRX + 1, sr01);
+ }
}
/**