diff options
author | Egbert Eich <eich@suse.de> | 2004-01-29 08:08:35 +0000 |
---|---|---|
committer | Egbert Eich <eich@suse.de> | 2004-01-29 08:08:35 +0000 |
commit | 64b129e800d915f0d82a67ce0f8b1850e67012fc (patch) | |
tree | cca7300580523a9ef1b66009aea0f96ea1cc5248 /src/i830_driver.c | |
parent | 64d7bbf0ac060a57761aa2ecf21ddbe8169674c0 (diff) |
Importing vendor version xf86-012804-2330 on Thu Jan 29 00:06:33 PST 2004xf86-4_3_99_903_specialxf86-012804-2330
Diffstat (limited to 'src/i830_driver.c')
-rw-r--r-- | src/i830_driver.c | 38 |
1 files changed, 31 insertions, 7 deletions
diff --git a/src/i830_driver.c b/src/i830_driver.c index 539dcece..aa8dee2e 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.49 2004/01/25 16:57:48 dawes Exp $ */ /************************************************************************** Copyright 2001 VA Linux Systems Inc., Fremont, California. @@ -201,7 +201,8 @@ typedef enum { OPTION_PAGEFLIP, OPTION_XVIDEO, OPTION_VIDEO_KEY, - OPTION_COLOR_KEY + OPTION_COLOR_KEY, + OPTION_VBE_RESTORE } I830Opts; static OptionInfoRec I830BIOSOptions[] = { @@ -213,6 +214,7 @@ 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}, {-1, NULL, OPTV_NONE, {0}, FALSE} }; /* *INDENT-ON* */ @@ -2124,6 +2126,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 +2341,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 +2352,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 +2548,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. |