diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/common.h | 2 | ||||
-rw-r--r-- | src/i810.h | 2 | ||||
-rw-r--r-- | src/i810_accel.c | 69 | ||||
-rw-r--r-- | src/i810_common.h | 2 | ||||
-rw-r--r-- | src/i810_cursor.c | 2 | ||||
-rw-r--r-- | src/i810_dga.c | 2 | ||||
-rw-r--r-- | src/i810_dri.c | 2 | ||||
-rw-r--r-- | src/i810_dri.h | 2 | ||||
-rw-r--r-- | src/i810_driver.c | 49 | ||||
-rw-r--r-- | src/i810_hwmc.c | 2 | ||||
-rw-r--r-- | src/i810_io.c | 2 | ||||
-rw-r--r-- | src/i810_memory.c | 2 | ||||
-rw-r--r-- | src/i810_reg.h | 1 | ||||
-rw-r--r-- | src/i810_video.c | 2 | ||||
-rw-r--r-- | src/i810_wmark.c | 2 | ||||
-rw-r--r-- | src/i830.h | 4 | ||||
-rw-r--r-- | src/i830_accel.c | 50 | ||||
-rw-r--r-- | src/i830_common.h | 2 | ||||
-rw-r--r-- | src/i830_cursor.c | 2 | ||||
-rw-r--r-- | src/i830_dga.c | 2 | ||||
-rw-r--r-- | src/i830_dri.c | 2 | ||||
-rw-r--r-- | src/i830_dri.h | 2 | ||||
-rw-r--r-- | src/i830_driver.c | 65 | ||||
-rw-r--r-- | src/i830_memory.c | 2 | ||||
-rw-r--r-- | src/i830_video.c | 2 | ||||
-rw-r--r-- | src/xvmc/I810XvMC.c | 2 | ||||
-rw-r--r-- | src/xvmc/I810XvMC.h | 2 |
27 files changed, 149 insertions, 131 deletions
diff --git a/src/common.h b/src/common.h index 3d32432c..b5520536 100644 --- a/src/common.h +++ b/src/common.h @@ -257,8 +257,10 @@ extern void I830DPRINTF_stub(const char *filename, int line, * preprocessor symbol, and equal to zero. */ #if 1 +#ifndef I810_DEBUG #define I810_DEBUG 0 #endif +#endif #ifndef I810_DEBUG #warning "Debugging enabled - expect reduced performance" extern int I810_DEBUG; @@ -27,7 +27,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810.h,v 1.42 2003/09/28 20:15:57 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810.h,v 1.41 2003/06/18 13:14:17 dawes Exp $ */ /* * Authors: diff --git a/src/i810_accel.c b/src/i810_accel.c index d8467424..660180d9 100644 --- a/src/i810_accel.c +++ b/src/i810_accel.c @@ -25,7 +25,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_accel.c,v 1.19 2003/04/24 18:00:24 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_accel.c,v 1.21 2004/01/02 20:22:17 dawes Exp $ */ /* * Reformatted with GNU indent (2.2.8), using the following options: @@ -48,47 +48,9 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "xf86_ansic.h" #include "xf86.h" - +#include "xaarop.h" #include "i810.h" -static unsigned int i810Rop[16] = { - 0x00, /* GXclear */ - 0x88, /* GXand */ - 0x44, /* GXandReverse */ - 0xCC, /* GXcopy */ - 0x22, /* GXandInvert */ - 0xAA, /* GXnoop */ - 0x66, /* GXxor */ - 0xEE, /* GXor */ - 0x11, /* GXnor */ - 0x99, /* GXequiv */ - 0x55, /* GXinvert */ - 0xDD, /* GXorReverse */ - 0x33, /* GXcopyInvert */ - 0xBB, /* GXorInverted */ - 0x77, /* GXnand */ - 0xFF /* GXset */ -}; - -static unsigned int i810PatternRop[16] = { - 0x00, /* GXclear */ - 0xA0, /* GXand */ - 0x50, /* GXandReverse */ - 0xF0, /* GXcopy */ - 0x0A, /* GXandInvert */ - 0xAA, /* GXnoop */ - 0x5A, /* GXxor */ - 0xFA, /* GXor */ - 0x05, /* GXnor */ - 0xA5, /* GXequiv */ - 0x55, /* GXinvert */ - 0xF5, /* GXorReverse */ - 0x0F, /* GXcopyInvert */ - 0xAF, /* GXorInverted */ - 0x5F, /* GXnand */ - 0xFF /* GXset */ -}; - static void I810SetupForMono8x8PatternFill(ScrnInfoPtr pScrn, int pattx, int patty, int fg, int bg, int rop, @@ -130,10 +92,7 @@ I810AccelInit(ScreenPtr pScreen) pI810->bufferOffset = 0; infoPtr->Flags = LINEAR_FRAMEBUFFER | OFFSCREEN_PIXMAPS; - /* There is a bit blt bug in 24 bpp. This is a problem, but - * at least without the pixmap cache we can pass the test suite */ - if (pScrn->depth != 24) - infoPtr->Flags |= PIXMAP_CACHE; + infoPtr->Flags |= PIXMAP_CACHE; /* Sync */ @@ -334,7 +293,7 @@ I810SetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop, /* Color blit, p166 */ pI810->BR[13] = (BR13_SOLID_PATTERN | - (i810PatternRop[rop] << 16) | + (XAAPatternROP[rop] << 16) | (pScrn->displayWidth * pI810->cpp)); pI810->BR[16] = color; } @@ -380,7 +339,7 @@ I810SetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir, int rop, if (xdir == -1) pI810->BR[13] |= BR13_RIGHT_TO_LEFT; - pI810->BR[13] |= i810Rop[rop] << 16; + pI810->BR[13] |= XAACopyROP[rop] << 16; pI810->BR[18] = 0; } @@ -401,9 +360,12 @@ I810SubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1, * This was developed empirically so it may not catch all * cases. */ +#define I810_MWIDTH 8 + if ( !(pI810->BR[13] & BR13_RIGHT_TO_LEFT) && (y2 - y1) < 3 - && (y2 - y1) >= 0 && (x2 - x1) <= (w + 4) && (w > 4)) - w = 4; + && (y2 - y1) >= 0 && (x2 - x1) <= (w + I810_MWIDTH) + && (w > I810_MWIDTH)) + w = I810_MWIDTH; do { if (pI810->BR[13] & BR13_PITCH_SIGN_BIT) { @@ -441,7 +403,10 @@ I810SubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1, break; x2 += w; x1 += w; - w = w_back; + if (w_back > I810_MWIDTH) + w = I810_MWIDTH; + else + w = w_back; } while (1); } @@ -460,9 +425,9 @@ I810SetupForMono8x8PatternFill(ScrnInfoPtr pScrn, int pattx, int patty, pI810->BR[18] = bg; pI810->BR[19] = fg; pI810->BR[13] = (pScrn->displayWidth * pI810->cpp); - pI810->BR[13] |= i810PatternRop[rop] << 16; + pI810->BR[13] |= XAAPatternROP[rop] << 16; if (bg == -1) - pI810->BR[13] |= BR13_MONO_TRANSPCY; + pI810->BR[13] |= BR13_MONO_PATN_TRANS; } static void @@ -524,7 +489,7 @@ I810SetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, fg, bg, rop, planemask); pI810->BR[13] = (pScrn->displayWidth * pI810->cpp); - pI810->BR[13] |= i810Rop[rop] << 16; + pI810->BR[13] |= XAACopyROP[rop] << 16; pI810->BR[13] |= (1 << 27); if (bg == -1) pI810->BR[13] |= BR13_MONO_TRANSPCY; diff --git a/src/i810_common.h b/src/i810_common.h index 745b5a50..02e548be 100644 --- a/src/i810_common.h +++ b/src/i810_common.h @@ -25,7 +25,7 @@ * Converted to common header format: * Jens Owen <jens@tungstengraphics.com> * - * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_common.h,v 1.2 2003/09/28 20:15:58 alanh Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_common.h,v 1.1 2002/09/11 00:29:31 dawes Exp $ * */ diff --git a/src/i810_cursor.c b/src/i810_cursor.c index 26023f3f..34e07661 100644 --- a/src/i810_cursor.c +++ b/src/i810_cursor.c @@ -25,7 +25,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_cursor.c,v 1.7 2002/10/30 12:52:17 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_cursor.c,v 1.6 2002/09/11 00:29:31 dawes Exp $ */ /* * Reformatted with GNU indent (2.2.8), using the following options: diff --git a/src/i810_dga.c b/src/i810_dga.c index 0abac2bf..6450e49b 100644 --- a/src/i810_dga.c +++ b/src/i810_dga.c @@ -34,7 +34,7 @@ * with <TAB> characters expanded at 8-column intervals. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dga.c,v 1.6 2003/02/26 04:19:36 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dga.c,v 1.5 2002/09/11 00:29:31 dawes Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" diff --git a/src/i810_dri.c b/src/i810_dri.c index d1dc11b4..3bdc3c1c 100644 --- a/src/i810_dri.c +++ b/src/i810_dri.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c,v 1.42 2003/09/28 20:15:58 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c,v 1.41 2003/09/24 02:43:23 dawes Exp $ */ /* * Reformatted with GNU indent (2.2.8), using the following options: * diff --git a/src/i810_dri.h b/src/i810_dri.h index 11a33112..cfca20a9 100644 --- a/src/i810_dri.h +++ b/src/i810_dri.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.h,v 1.11 2003/09/28 20:15:58 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.h,v 1.10 2002/12/10 01:27:04 dawes Exp $ */ #ifndef _I810_DRI_ #define _I810_DRI_ diff --git a/src/i810_driver.c b/src/i810_driver.c index 62039190..73ddd1b3 100644 --- a/src/i810_driver.c +++ b/src/i810_driver.c @@ -25,7 +25,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c,v 1.95 2003/10/30 18:37:21 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c,v 1.101 2004/01/02 20:15:47 dawes Exp $ */ /* * Reformatted with GNU indent (2.2.8), using the following options: @@ -244,6 +244,8 @@ const char *I810xaaSymbols[] = { "XAACreateInfoRec", "XAADestroyInfoRec", "XAAInit", + "XAACopyROP", + "XAAPatternROP", NULL }; @@ -376,6 +378,7 @@ i810Setup(pointer module, pointer opts, int *errmaj, int *errmin) I810drmSymbols, I810driSymbols, I810shadowSymbols, + driShadowFBSymbols, #endif I810vbeSymbols, vbeOptionalSymbols, I810ddcSymbols, I810int10Symbols, NULL); @@ -852,7 +855,7 @@ I810PreInit(ScrnInfoPtr pScrn, int flags) pScrn->videoRam = 4096; } else { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Less than 6MB of AGP memory" - "is available. Cannot proceed.\n"); + " is available. Cannot proceed.\n"); I810FreeRec(pScrn); return FALSE; } @@ -927,7 +930,8 @@ I810PreInit(ScrnInfoPtr pScrn, int flags) } clockRanges = xnfcalloc(sizeof(ClockRange), 1); clockRanges->next = NULL; - clockRanges->minClock = 12000; /* !!! What's the min clock? !!! */ + /* 9.4MHz appears to be the smallest that works. */ + clockRanges->minClock = 9500; clockRanges->maxClock = pI810->MaxClock; clockRanges->clockIndex = -1; clockRanges->interlaceAllowed = TRUE; @@ -1572,6 +1576,11 @@ I810CalcVCLK(ScrnInfoPtr pScrn, double freq) double err_best = 999999.0; p_best = p = log(MAX_VCO_FREQ / f_target) / log((double)2); + /* Make sure p is within range. */ + if (p_best > 5) { + p_best = p = 5; + } + f_vco = f_target * (1 << p); n = 2; @@ -2213,10 +2222,39 @@ Bool I810SwitchMode(int scrnIndex, DisplayModePtr mode, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + I810Ptr pI810 = I810PTR(pScrn); if (I810_DEBUG & DEBUG_VERBOSE_CURSOR) ErrorF("I810SwitchMode %p %x\n", (void *)mode, flags); +#ifdef XF86DRI + if (pI810->directRenderingEnabled) { + if (I810_DEBUG & DEBUG_VERBOSE_DRI) + ErrorF("calling dri lock\n"); + DRILock(screenInfo.screens[scrnIndex], 0); + pI810->LockHeld = 1; + } +#endif + + if (pI810->AccelInfoRec != NULL) { + I810RefreshRing(pScrn); + I810Sync(pScrn); + pI810->AccelInfoRec->NeedToSync = FALSE; + } + I810Restore(pScrn); + +#ifdef XF86DRI + if (!I810DRIEnter(pScrn)) { + return FALSE; + } + if (pI810->directRenderingEnabled) { + if (I810_DEBUG & DEBUG_VERBOSE_DRI) + ErrorF("calling dri unlock\n"); + DRIUnlock(screenInfo.screens[scrnIndex]); + pI810->LockHeld = 0; + } +#endif + return I810ModeInit(pScrn, mode); } @@ -2350,6 +2388,11 @@ I810CloseScreen(int scrnIndex, ScreenPtr pScreen) XAAInfoRecPtr infoPtr = pI810->AccelInfoRec; if (pScrn->vtSema == TRUE) { + if (pI810->AccelInfoRec != NULL) { + I810RefreshRing(pScrn); + I810Sync(pScrn); + pI810->AccelInfoRec->NeedToSync = FALSE; + } I810Restore(pScrn); vgaHWLock(hwp); } diff --git a/src/i810_hwmc.c b/src/i810_hwmc.c index 525ad361..1fc162ed 100644 --- a/src/i810_hwmc.c +++ b/src/i810_hwmc.c @@ -32,7 +32,7 @@ THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_hwmc.c,v 1.4 2002/09/11 00:29:32 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_hwmc.c,v 1.3 2001/12/04 21:17:56 tsi Exp $ */ #include "xf86.h" diff --git a/src/i810_io.c b/src/i810_io.c index de947dde..a2da7bf6 100644 --- a/src/i810_io.c +++ b/src/i810_io.c @@ -24,7 +24,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_io.c,v 1.5 2002/09/11 00:29:32 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_io.c,v 1.4 2002/01/25 21:56:04 tsi Exp $ */ /* * Reformatted with GNU indent (2.2.8), using the following options: diff --git a/src/i810_memory.c b/src/i810_memory.c index bb67c434..0ff63a5b 100644 --- a/src/i810_memory.c +++ b/src/i810_memory.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_memory.c,v 1.28 2003/09/24 02:43:23 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_memory.c,v 1.27 2002/12/10 01:27:05 dawes Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. diff --git a/src/i810_reg.h b/src/i810_reg.h index c935982a..ef0a9ea1 100644 --- a/src/i810_reg.h +++ b/src/i810_reg.h @@ -497,6 +497,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define BR13_RIGHT_TO_LEFT 0x40000000 #define BR13_LEFT_TO_RIGHT 0x00000000 #define BR13_MONO_TRANSPCY 0x20000000 +#define BR13_MONO_PATN_TRANS 0x10000000 #define BR13_USE_DYN_DEPTH 0x04000000 #define BR13_DYN_8BPP 0x00000000 #define BR13_DYN_16BPP 0x01000000 diff --git a/src/i810_video.c b/src/i810_video.c index 6bd3e134..8d2bdc9a 100644 --- a/src/i810_video.c +++ b/src/i810_video.c @@ -23,7 +23,7 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_video.c,v 1.27 2003/11/11 00:58:18 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_video.c,v 1.26 2003/11/10 18:22:22 tsi Exp $ */ /* * i810_video.c: i810 Xv driver. Based on the mga Xv driver by Mark Vojkovich. diff --git a/src/i810_wmark.c b/src/i810_wmark.c index 9a6bdd34..f124e5f1 100644 --- a/src/i810_wmark.c +++ b/src/i810_wmark.c @@ -25,7 +25,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_wmark.c,v 1.8 2002/10/30 12:52:18 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_wmark.c,v 1.7 2002/09/11 00:29:32 dawes Exp $ */ /* * Reformatted with GNU indent (2.2.8), using the following options: @@ -27,7 +27,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830.h,v 1.11 2003/10/21 04:13:40 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830.h,v 1.12 2004/01/07 03:43:19 dawes Exp $ */ /* * Authors: @@ -302,6 +302,8 @@ typedef struct _I830Rec { int yoffset; int SaveGeneration; + Bool vbeRestoreWorkaround; + Bool displayInfo; } I830Rec; #define I830PTR(p) ((I830Ptr)((p)->driverPrivate)) diff --git a/src/i830_accel.c b/src/i830_accel.c index 63dce22d..64cf365a 100644 --- a/src/i830_accel.c +++ b/src/i830_accel.c @@ -55,48 +55,10 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "xf86_ansic.h" #include "xf86.h" - +#include "xaarop.h" #include "i830.h" #include "i810_reg.h" -static unsigned int i810Rop[16] = { - 0x00, /* GXclear */ - 0x88, /* GXand */ - 0x44, /* GXandReverse */ - 0xCC, /* GXcopy */ - 0x22, /* GXandInvert */ - 0xAA, /* GXnoop */ - 0x66, /* GXxor */ - 0xEE, /* GXor */ - 0x11, /* GXnor */ - 0x99, /* GXequiv */ - 0x55, /* GXinvert */ - 0xDD, /* GXorReverse */ - 0x33, /* GXcopyInvert */ - 0xBB, /* GXorInverted */ - 0x77, /* GXnand */ - 0xFF /* GXset */ -}; - -static unsigned int i810PatternRop[16] = { - 0x00, /* GXclear */ - 0xA0, /* GXand */ - 0x50, /* GXandReverse */ - 0xF0, /* GXcopy */ - 0x0A, /* GXandInvert */ - 0xAA, /* GXnoop */ - 0x5A, /* GXxor */ - 0xFA, /* GXor */ - 0x05, /* GXnor */ - 0xA5, /* GXequiv */ - 0x55, /* GXinvert */ - 0xF5, /* GXorReverse */ - 0x0F, /* GXcopyInvert */ - 0xAF, /* GXorInverted */ - 0x5F, /* GXnand */ - 0xFF /* GXset */ -}; - int I830WaitLpRing(ScrnInfoPtr pScrn, int n, int timeout_millis) { @@ -397,7 +359,7 @@ I830SetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop, ErrorF("I830SetupForFillRectSolid color: %x rop: %x mask: %x\n", color, rop, planemask); - pI830->BR[13] = ((i810PatternRop[rop] << 16) | + pI830->BR[13] = ((XAAPatternROP[rop] << 16) | (pScrn->displayWidth * pI830->cpp)); pI830->BR[16] = color; @@ -453,7 +415,7 @@ I830SetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir, int rop, xdir, ydir, rop, planemask, transparency_color); pI830->BR[13] = (pScrn->displayWidth * pI830->cpp); - pI830->BR[13] |= i810Rop[rop] << 16; + pI830->BR[13] |= XAACopyROP[rop] << 16; switch (pScrn->bitsPerPixel) { case 8: @@ -519,7 +481,7 @@ I830SetupForMono8x8PatternFill(ScrnInfoPtr pScrn, int pattx, int patty, pI830->BR[19] = fg; pI830->BR[13] = (pScrn->displayWidth * pI830->cpp); /* In bytes */ - pI830->BR[13] |= i810PatternRop[rop] << 16; + pI830->BR[13] |= XAAPatternROP[rop] << 16; if (bg == -1) pI830->BR[13] |= (1 << 28); @@ -608,7 +570,7 @@ I830SetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, /* Fill out register values */ pI830->BR[13] = (pScrn->displayWidth * pI830->cpp); - pI830->BR[13] |= i810Rop[rop] << 16; + pI830->BR[13] |= XAACopyROP[rop] << 16; if (bg == -1) pI830->BR[13] |= (1 << 29); @@ -697,7 +659,7 @@ I830SetupForScanlineImageWrite(ScrnInfoPtr pScrn, int rop, /* Fill out register values */ pI830->BR[13] = (pScrn->displayWidth * pI830->cpp); - pI830->BR[13] |= i810Rop[rop] << 16; + pI830->BR[13] |= XAACopyROP[rop] << 16; switch (pScrn->bitsPerPixel) { case 8: diff --git a/src/i830_common.h b/src/i830_common.h index 3367bfc1..816d9840 100644 --- a/src/i830_common.h +++ b/src/i830_common.h @@ -26,7 +26,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_common.h,v 1.2 2002/12/10 01:27:05 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_common.h,v 1.1 2002/09/11 00:29:32 dawes Exp $ */ /* Author: Jeff Hartmann <jhartmann@valinux.com> diff --git a/src/i830_cursor.c b/src/i830_cursor.c index ef9a81ee..9f2baa3a 100644 --- a/src/i830_cursor.c +++ b/src/i830_cursor.c @@ -26,7 +26,7 @@ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_cursor.c,v 1.7 2003/06/18 13:14:17 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_cursor.c,v 1.6 2002/12/18 15:49:01 dawes Exp $ */ /* * Reformatted with GNU indent (2.2.8), using the following options: diff --git a/src/i830_dga.c b/src/i830_dga.c index bb4c103a..8bd570c6 100644 --- a/src/i830_dga.c +++ b/src/i830_dga.c @@ -34,7 +34,7 @@ * with <TAB> characters expanded at 8-column intervals. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dga.c,v 1.3 2003/02/26 04:11:23 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dga.c,v 1.2 2002/11/05 02:01:18 dawes Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" diff --git a/src/i830_dri.c b/src/i830_dri.c index 37e1d1d6..4c9b1a28 100644 --- a/src/i830_dri.c +++ b/src/i830_dri.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c,v 1.16 2003/09/28 20:15:58 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dri.c,v 1.15 2003/06/18 13:14:17 dawes Exp $ */ /************************************************************************** Copyright 2001 VA Linux Systems Inc., Fremont, California. diff --git a/src/i830_dri.h b/src/i830_dri.h index 51a7fdf6..6671c2e2 100644 --- a/src/i830_dri.h +++ b/src/i830_dri.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dri.h,v 1.7 2003/10/21 02:17:52 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dri.h,v 1.6 2003/09/28 20:15:59 alanh Exp $ */ #ifndef _I830_DRI_H #define _I830_DRI_H 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. diff --git a/src/i830_memory.c b/src/i830_memory.c index c038e5d7..19993b23 100644 --- a/src/i830_memory.c +++ b/src/i830_memory.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_memory.c,v 1.10 2003/10/21 02:17:52 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_memory.c,v 1.9 2003/09/24 03:16:54 dawes Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. diff --git a/src/i830_video.c b/src/i830_video.c index f665d74e..70d121e2 100644 --- a/src/i830_video.c +++ b/src/i830_video.c @@ -24,7 +24,7 @@ OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. **************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_video.c,v 1.12 2003/11/10 18:22:22 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_video.c,v 1.11tsi Exp $ */ /* * Reformatted with GNU indent (2.2.8), using the following options: diff --git a/src/xvmc/I810XvMC.c b/src/xvmc/I810XvMC.c index e6731c62..fdafe8cb 100644 --- a/src/xvmc/I810XvMC.c +++ b/src/xvmc/I810XvMC.c @@ -33,7 +33,7 @@ THE USE OR OTHER DEALINGS IN THE SOFTWARE. ** ** ***************************************************************************/ -/* $XFree86: xc/lib/XvMC/hw/i810/I810XvMC.c,v 1.11 2002/11/19 09:35:49 alanh Exp $ */ +/* $XFree86: xc/lib/XvMC/hw/i810/I810XvMC.c,v 1.10 2002/10/30 12:52:01 alanh Exp $ */ #include <stdio.h> #include <stdlib.h> #include <unistd.h> diff --git a/src/xvmc/I810XvMC.h b/src/xvmc/I810XvMC.h index 018c80e9..cfcab88f 100644 --- a/src/xvmc/I810XvMC.h +++ b/src/xvmc/I810XvMC.h @@ -32,7 +32,7 @@ THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * ***************************************************************************/ -/* $XFree86: xc/lib/XvMC/hw/i810/I810XvMC.h,v 1.4 2002/11/19 09:35:49 alanh Exp $ */ +/* $XFree86: xc/lib/XvMC/hw/i810/I810XvMC.h,v 1.3 2002/10/30 12:52:02 alanh Exp $ */ #ifndef I810XVMC_H |