summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@airlied-rhel5.(none)>2010-04-21 11:06:33 +1000
committerDave Airlie <airlied@airlied-rhel5.(none)>2010-04-21 11:06:33 +1000
commit2be77547cae98a438384a00de37452b468f67a3d (patch)
treed7751a083634c47f7da94e3ddd57ddc903edf769
parentafdf4b66df748cf6abdfd9e54e5f2beb8ff6a47b (diff)
intel-2.2.1-vga-disable.patch
-rw-r--r--src/i830_display.c33
1 files changed, 31 insertions, 2 deletions
diff --git a/src/i830_display.c b/src/i830_display.c
index aa6087e0..8632bf13 100644
--- a/src/i830_display.c
+++ b/src/i830_display.c
@@ -664,6 +664,36 @@ i830_use_fb_compression(xf86CrtcPtr crtc)
return TRUE;
}
+static void
+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;
+
+ /*
+ 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);
+ i830WaitForVblank(pScrn);
+
+}
+
/**
* Sets the power management mode of the pipe and plane.
*
@@ -786,8 +816,7 @@ i830_crtc_dpms(xf86CrtcPtr crtc, int mode)
}
/* Disable the VGA plane that we never use. */
- OUTREG(VGACNTRL, VGA_DISP_DISABLE);
- i830WaitForVblank(pScrn);
+ i830_disable_vga_plane (crtc);
break;
}