summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Airlie <airlied@airlied-rhel5.(none)>2010-04-21 11:07:27 +1000
committerDave Airlie <airlied@airlied-rhel5.(none)>2010-04-21 11:07:27 +1000
commit8067369c94ef349aeb10c284af08b59ddcbc1bca (patch)
tree67b9ae971158b5a3f2c35b1c61e01bdef77fbe9c
parent8745fa9db5a13c82105929dad4d9274de84c2d48 (diff)
intel-2.2.1-ironlake-int10-hack.patch
-rw-r--r--src/i830.h4
-rw-r--r--src/i830_driver.c31
2 files changed, 35 insertions, 0 deletions
diff --git a/src/i830.h b/src/i830.h
index 9735be59..4ec02ab1 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -636,6 +636,10 @@ typedef struct _I830Rec {
/** Enables logging of debug output related to mode switching. */
Bool debug_modes;
unsigned int quirk_flag;
+
+ /* ironlake vt restore hack */
+ xf86Int10InfoPtr int10;
+ int int10Mode;
} I830Rec;
#define I830PTR(p) ((I830Ptr)((p)->driverPrivate))
diff --git a/src/i830_driver.c b/src/i830_driver.c
index a0092ec8..59c4c7b4 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -1773,6 +1773,25 @@ I830PreInit(ScrnInfoPtr pScrn, int flags)
xf86LoaderReqSymLists(I810ramdacSymbols, NULL);
}
+ /* console hack, stolen from G80 */
+ if (IS_IGDNG(pI830)) {
+ pI830->int10 = xf86InitInt10(pEnt->index);
+ if (pI830->int10) {
+ pI830->int10->num = 0x10;
+ pI830->int10->ax = 0x4f03;
+ pI830->int10->bx =
+ pI830->int10->cx =
+ pI830->int10->dx = 0;
+ xf86ExecX86int10(pI830->int10);
+ pI830->int10Mode = pI830->int10->bx & 0x3fff;
+ xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
+ "Console VGA mode is 0x%x\n", pI830->int10Mode);
+ } else {
+ xf86DrvMsg(pScrn->scrnIndex, X_WARNING,
+ "Failed int10 setup, VT switch won't work\n");
+ }
+ }
+
i830CompareRegsToSnapshot(pScrn, "After PreInit");
I830UnmapMMIO(pScrn);
@@ -2344,6 +2363,18 @@ RestoreHWState(ScrnInfoPtr pScrn)
OUTREG(PIPEASTAT, INREG(PIPEASTAT) | FIFO_UNDERRUN);
OUTREG(PIPEBSTAT, INREG(PIPEBSTAT) | FIFO_UNDERRUN);
+ /* console restore hack */
+ if (IS_IGDNG(pI830) && pI830->int10 && pI830->int10Mode) {
+ xf86Int10InfoPtr int10 = pI830->int10;
+
+ /* Use int10 to restore the console mode */
+ int10->num = 0x10;
+ int10->ax = 0x4f02;
+ int10->bx = pI830->int10Mode | 0x8000;
+ int10->cx = int10->dx = 0;
+ xf86ExecX86int10(int10);
+ }
+
vgaHWRestore(pScrn, vgaReg, VGA_SR_FONTS);
vgaHWLock(hwp);