diff options
author | Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> | 2004-03-17 20:30:42 +0000 |
---|---|---|
committer | Alexander Gottwald <alexander.gottwald@s1999.tu-chemnitz.de> | 2004-03-17 20:30:42 +0000 |
commit | 25be4f99b4d3aa328177584df9808a23fabe74f4 (patch) | |
tree | 44a767546075981208dcfb359d73ea27c073a7fd /src/i830_driver.c | |
parent | 46bac6d7ad1c5be6b98f8646bcb4eed5aa93e469 (diff) |
merge with XORG-RELEASE-1 (tag XORG-CYGWIN-LAST-MERGE)CYGWIN-RELEASE-1-MERGE
Diffstat (limited to 'src/i830_driver.c')
-rw-r--r-- | src/i830_driver.c | 65 |
1 files changed, 54 insertions, 11 deletions
diff --git a/src/i830_driver.c b/src/i830_driver.c index 539dcece..e504342f 100644 --- a/src/i830_driver.c +++ b/src/i830_driver.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_driver.c,v 1.47 2003/11/03 14:47:28 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_driver.c,v 1.50 2004/02/20 00:06:00 alanh Exp $ */ /************************************************************************** Copyright 2001 VA Linux Systems Inc., Fremont, California. @@ -201,7 +201,9 @@ typedef enum { OPTION_PAGEFLIP, OPTION_XVIDEO, OPTION_VIDEO_KEY, - OPTION_COLOR_KEY + OPTION_COLOR_KEY, + OPTION_VBE_RESTORE, + OPTION_DISPLAY_INFO } I830Opts; static OptionInfoRec I830BIOSOptions[] = { @@ -213,6 +215,8 @@ static OptionInfoRec I830BIOSOptions[] = { {OPTION_XVIDEO, "XVideo", OPTV_BOOLEAN, {0}, TRUE}, {OPTION_COLOR_KEY, "ColorKey", OPTV_INTEGER, {0}, FALSE}, {OPTION_VIDEO_KEY, "VideoKey", OPTV_INTEGER, {0}, FALSE}, + {OPTION_VBE_RESTORE, "VBERestore", OPTV_BOOLEAN, {0}, FALSE}, + {OPTION_DISPLAY_INFO,"DisplayInfo", OPTV_BOOLEAN, {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE} }; /* *INDENT-ON* */ @@ -786,18 +790,26 @@ I830DetectDisplayDevice(ScrnInfoPtr pScrn) I830Ptr pI830 = I830PTR(pScrn); int pipe, n; DisplayType i; - - for (i = 0; i < NumKnownDisplayTypes; i++) { - if (GetDisplayInfo(pScrn, 1 << i, &pI830->displayAttached[i], + + /* This seems to lockup some Dell BIOS'. So it's on option to turn on */ + if (pI830->displayInfo) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Broken BIOSes cause the system to hang here.\n" + "\t If you encounter this problem please add \n" + "\t\t Option \"DisplayInfo\" \"FALSE\"\n" + "\t to the Device section of your XF86Config file.\n"); + for (i = 0; i < NumKnownDisplayTypes; i++) { + if (GetDisplayInfo(pScrn, 1 << i, &pI830->displayAttached[i], &pI830->displayPresent[i], &pI830->displaySize[i].x2, &pI830->displaySize[i].y2)) { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Display Info: %s: attached: %s, present: %s, size: " "(%d,%d)\n", displayDevices[i], BOOLTOSTRING(pI830->displayAttached[i]), BOOLTOSTRING(pI830->displayPresent[i]), pI830->displaySize[i].x2, pI830->displaySize[i].y2); + } } } @@ -1812,6 +1824,15 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%d display pipe%s available.\n", pI830->availablePipes, pI830->availablePipes > 1 ? "s" : ""); + pI830->displayInfo = TRUE; + from = X_DEFAULT; + if (!xf86ReturnOptValBool(pI830->Options, OPTION_DISPLAY_INFO, TRUE)) { + from = X_CONFIG; + pI830->displayInfo = FALSE; + } + xf86DrvMsg(pScrn->scrnIndex, from, "Display Info: %s.\n", + pI830->displayInfo ? "enabled" : "disabled"); + if (!I830DetectDisplayDevice(pScrn)) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Couldn't detect display devices.\n"); @@ -2124,6 +2145,16 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int flags) VBEFreeVBEInfo(pI830->vbeInfo); vbeFree(pVbe); + /* Use the VBE mode restore workaround by default. */ + pI830->vbeRestoreWorkaround = TRUE; + from = X_DEFAULT; + if (xf86ReturnOptValBool(pI830->Options, OPTION_VBE_RESTORE, FALSE)) { + pI830->vbeRestoreWorkaround = FALSE; + from = X_CONFIG; + } + xf86DrvMsg(pScrn->scrnIndex, from, "VBE Restore workaround: %s.\n", + pI830->vbeRestoreWorkaround ? "enabled" : "disabled"); + #if defined(XF86DRI) /* Load the dri module if requested. */ if (xf86ReturnOptValBool(pI830->Options, OPTION_DRI, FALSE) && @@ -2329,10 +2360,6 @@ SaveHWState(ScrnInfoPtr pScrn) vgaHWUnlock(hwp); vgaHWSave(pScrn, vgaReg, VGA_SR_FONTS); -#ifndef I845G_VBE_WORKAROUND -#define I845G_VBE_WORKAROUND 1 -#endif - pVesa = pI830->vesa; /* * This save/restore method doesn't work for 845G BIOS, or for some @@ -2344,7 +2371,7 @@ SaveHWState(ScrnInfoPtr pScrn) * registers, turning off the irq & breaking the kernel module * behaviour. */ - if (!I845G_VBE_WORKAROUND) { + if (!pI830->vbeRestoreWorkaround) { CARD16 imr = INREG16(IMR); CARD16 ier = INREG16(IER); CARD16 hwstam = INREG16(HWSTAM); @@ -2540,6 +2567,22 @@ I830VESASetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode) } /* + * Test if the extendedRefresh BIOS function is supported. + */ + if (pI830->useExtendedRefresh && !pI830->vesa->useDefaultRefresh && + (mode & (1 << 11)) && data && data->data && data->block) { + if (!SetRefreshRate(pScrn, mode, 60)) { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "BIOS call 0x5f05 not supported, " + "setting refresh with VBE 3 method.\n"); + pI830->useExtendedRefresh = FALSE; + pI830->enableDisplays = FALSE; + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Not using BIOS call 0x5f64 to enable displays.\n"); + } + } + + /* * The BIOS may not set a scanline pitch that would require more video * memory than it's aware of. We check for this later, and set it * explicitly if necessary. |