diff options
author | Eric Anholt <anholt@freebsd.org> | 2004-06-16 09:23:18 +0000 |
---|---|---|
committer | Eric Anholt <anholt@freebsd.org> | 2004-06-16 09:23:18 +0000 |
commit | c5b1972b50a6dbe57c67d3cc88ae010386b908a6 (patch) | |
tree | 932a901b031e8e68c15870965a99f571a73301c3 /src | |
parent | 41eba03d0d62fe03a7b437c9c4914016c3125141 (diff) | |
download | xorg-driver-xf86-video-intel-c5b1972b50a6dbe57c67d3cc88ae010386b908a6.tar.gz |
DRI XFree86-4_3_99_12-merge importDRI-XFree86-4_3_99_12-merge
Diffstat (limited to 'src')
-rw-r--r-- | src/common.h | 20 | ||||
-rw-r--r-- | src/i810.h | 4 | ||||
-rw-r--r-- | src/i810_accel.c | 69 | ||||
-rw-r--r-- | src/i810_cursor.c | 2 | ||||
-rw-r--r-- | src/i810_dga.c | 2 | ||||
-rw-r--r-- | src/i810_dri.c | 84 | ||||
-rw-r--r-- | src/i810_driver.c | 115 | ||||
-rw-r--r-- | src/i810_hwmc.c | 2 | ||||
-rw-r--r-- | src/i810_io.c | 2 | ||||
-rw-r--r-- | src/i810_memory.c | 6 | ||||
-rw-r--r-- | src/i810_reg.h | 1 | ||||
-rw-r--r-- | src/i810_video.c | 34 | ||||
-rw-r--r-- | src/i810_wmark.c | 2 | ||||
-rw-r--r-- | src/i830.h | 11 | ||||
-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.h | 4 | ||||
-rw-r--r-- | src/i830_driver.c | 256 | ||||
-rw-r--r-- | src/i830_memory.c | 42 | ||||
-rw-r--r-- | src/i830_video.c | 40 |
22 files changed, 238 insertions, 514 deletions
diff --git a/src/common.h b/src/common.h index b5520536..9dbea332 100644 --- a/src/common.h +++ b/src/common.h @@ -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/common.h,v 1.9 2003/09/24 02:43:23 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/common.h,v 1.7 2003/06/18 13:14:17 dawes Exp $ */ /* * Authors: @@ -79,11 +79,7 @@ extern const char *I810vbeSymbols[]; extern const char *I810ddcSymbols[]; extern const char *I810fbSymbols[]; extern const char *I810xaaSymbols[]; -#ifdef XF86DRI -extern const char *I810driSymbols[]; -extern const char *I810drmSymbols[]; extern const char *I810shadowSymbols[]; -#endif extern void I830DPRINTF_stub(const char *filename, int line, const char *function, const char *fmt, ...); @@ -115,8 +111,7 @@ extern void I830DPRINTF_stub(const char *filename, int line, #define OUT_RING(n) do { \ if (I810_DEBUG & DEBUG_VERBOSE_RING) \ - ErrorF( "OUT_RING %lx: %x, (mask %x)\n", \ - (unsigned long)(outring), (unsigned int)(n), ringmask); \ + ErrorF( "OUT_RING %x: %x, (mask %x)\n", outring, n, ringmask); \ *(volatile unsigned int *)(virt + outring) = n; \ outring += 4; \ outring &= ringmask; \ @@ -232,24 +227,21 @@ extern void I830DPRINTF_stub(const char *filename, int line, #define OUTREG8(addr, val) do { \ *(volatile CARD8 *)(RecPtr->MMIOBase + (addr)) = (val); \ if (I810_DEBUG&DEBUG_VERBOSE_OUTREG) { \ - ErrorF("OUTREG8(0x%lx, 0x%lx) in %s\n", (unsigned long)(addr), \ - (unsigned long)(val), FUNCTION_NAME); \ + ErrorF("OUTREG8(0x%x, 0x%x) in %s\n", addr, val, FUNCTION_NAME); \ } \ } while (0) #define OUTREG16(addr, val) do { \ *(volatile CARD16 *)(RecPtr->MMIOBase + (addr)) = (val); \ if (I810_DEBUG&DEBUG_VERBOSE_OUTREG) { \ - ErrorF("OUTREG16(0x%lx, 0x%lx) in %s\n", (unsigned long)(addr), \ - (unsigned long)(val), FUNCTION_NAME); \ + ErrorF("OUTREG16(0x%x, 0x%x) in %s\n", addr, val, FUNCTION_NAME); \ } \ } while (0) #define OUTREG(addr, val) do { \ *(volatile CARD32 *)(RecPtr->MMIOBase + (addr)) = (val); \ if (I810_DEBUG&DEBUG_VERBOSE_OUTREG) { \ - ErrorF("OUTREG(0x%lx, 0x%lx) in %s\n", (unsigned long)(addr), \ - (unsigned long)(val), FUNCTION_NAME); \ + ErrorF("OUTREG(0x%x, 0x%x) in %s\n", addr, val, FUNCTION_NAME); \ } \ } while (0) @@ -257,10 +249,8 @@ 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; @@ -264,13 +264,9 @@ typedef struct _I810Rec { #define I810_SELECT_BACK 1 #define I810_SELECT_DEPTH 2 -#ifdef XF86DRI extern Bool I810DRIScreenInit(ScreenPtr pScreen); extern void I810DRICloseScreen(ScreenPtr pScreen); extern Bool I810DRIFinishScreenInit(ScreenPtr pScreen); -extern Bool I810DRILeave(ScrnInfoPtr pScrn); -extern Bool I810DRIEnter(ScrnInfoPtr pScrn); -#endif extern Bool I810InitDma(ScrnInfoPtr pScrn); extern Bool I810CleanupDma(ScrnInfoPtr pScrn); diff --git a/src/i810_accel.c b/src/i810_accel.c index 660180d9..d8467424 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.21 2004/01/02 20:22:17 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_accel.c,v 1.19 2003/04/24 18:00:24 eich Exp $ */ /* * Reformatted with GNU indent (2.2.8), using the following options: @@ -48,9 +48,47 @@ 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, @@ -92,7 +130,10 @@ I810AccelInit(ScreenPtr pScreen) pI810->bufferOffset = 0; infoPtr->Flags = LINEAR_FRAMEBUFFER | OFFSCREEN_PIXMAPS; - infoPtr->Flags |= PIXMAP_CACHE; + /* 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; /* Sync */ @@ -293,7 +334,7 @@ I810SetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop, /* Color blit, p166 */ pI810->BR[13] = (BR13_SOLID_PATTERN | - (XAAPatternROP[rop] << 16) | + (i810PatternRop[rop] << 16) | (pScrn->displayWidth * pI810->cpp)); pI810->BR[16] = color; } @@ -339,7 +380,7 @@ I810SetupForScreenToScreenCopy(ScrnInfoPtr pScrn, int xdir, int ydir, int rop, if (xdir == -1) pI810->BR[13] |= BR13_RIGHT_TO_LEFT; - pI810->BR[13] |= XAACopyROP[rop] << 16; + pI810->BR[13] |= i810Rop[rop] << 16; pI810->BR[18] = 0; } @@ -360,12 +401,9 @@ 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 + I810_MWIDTH) - && (w > I810_MWIDTH)) - w = I810_MWIDTH; + && (y2 - y1) >= 0 && (x2 - x1) <= (w + 4) && (w > 4)) + w = 4; do { if (pI810->BR[13] & BR13_PITCH_SIGN_BIT) { @@ -403,10 +441,7 @@ I810SubsequentScreenToScreenCopy(ScrnInfoPtr pScrn, int x1, int y1, break; x2 += w; x1 += w; - if (w_back > I810_MWIDTH) - w = I810_MWIDTH; - else - w = w_back; + w = w_back; } while (1); } @@ -425,9 +460,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] |= XAAPatternROP[rop] << 16; + pI810->BR[13] |= i810PatternRop[rop] << 16; if (bg == -1) - pI810->BR[13] |= BR13_MONO_PATN_TRANS; + pI810->BR[13] |= BR13_MONO_TRANSPCY; } static void @@ -489,7 +524,7 @@ I810SetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, fg, bg, rop, planemask); pI810->BR[13] = (pScrn->displayWidth * pI810->cpp); - pI810->BR[13] |= XAACopyROP[rop] << 16; + pI810->BR[13] |= i810Rop[rop] << 16; pI810->BR[13] |= (1 << 27); if (bg == -1) pI810->BR[13] |= BR13_MONO_TRANSPCY; diff --git a/src/i810_cursor.c b/src/i810_cursor.c index 34e07661..26023f3f 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.6 2002/09/11 00:29:31 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_cursor.c,v 1.7 2002/10/30 12:52:17 alanh 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 6450e49b..0abac2bf 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.5 2002/09/11 00:29:31 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dga.c,v 1.6 2003/02/26 04:19:36 dawes Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" diff --git a/src/i810_dri.c b/src/i810_dri.c index 3bdc3c1c..06bb0f14 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.41 2003/09/24 02:43:23 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c,v 1.40 2003/07/09 01:45:23 dawes Exp $ */ /* * Reformatted with GNU indent (2.2.8), using the following options: * @@ -522,7 +522,7 @@ I810DRIScreenInit(ScreenPtr pScreen) drmAgpAlloc(pI810->drmSubFD, 4096 * 1024, 1, NULL, &dcacheHandle); pI810->dcacheHandle = dcacheHandle; - xf86DrvMsg(pScreen->myNum, X_INFO, "[agp] dcacheHandle : 0x%lx\n", + xf86DrvMsg(pScreen->myNum, X_INFO, "[agp] dcacheHandle : %p\n", dcacheHandle); #define Elements(x) sizeof(x)/sizeof(*x) @@ -1424,83 +1424,3 @@ static void I810DRITransitionTo2d(ScreenPtr pScreen) } pI810->have3DWindows = 0; } - -Bool -I810DRILeave(ScrnInfoPtr pScrn) -{ - I810Ptr pI810 = I810PTR(pScrn); - - if (pI810->directRenderingEnabled) { - if (pI810->dcacheHandle != 0) - if (drmAgpUnbind(pI810->drmSubFD, pI810->dcacheHandle) != 0) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR,"%s\n",strerror(errno)); - return FALSE; - } - if (pI810->backHandle != 0) - if (drmAgpUnbind(pI810->drmSubFD, pI810->backHandle) != 0) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR,"%s\n",strerror(errno)); - return FALSE; - } - if (pI810->zHandle != 0) - if (drmAgpUnbind(pI810->drmSubFD, pI810->zHandle) != 0) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR,"%s\n",strerror(errno)); - return FALSE; - } - if (pI810->sysmemHandle != 0) - if (drmAgpUnbind(pI810->drmSubFD, pI810->sysmemHandle) != 0) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR,"%s\n",strerror(errno)); - return FALSE; - } - if (pI810->xvmcHandle != 0) - if (drmAgpUnbind(pI810->drmSubFD, pI810->xvmcHandle) != 0) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR,"%s\n",strerror(errno)); - return FALSE; - } - if (pI810->cursorHandle != 0) - if (drmAgpUnbind(pI810->drmSubFD, pI810->cursorHandle) != 0) { - xf86DrvMsg(pScrn->scrnIndex, X_ERROR,"%s\n",strerror(errno)); - return FALSE; - } - if (pI810->agpAcquired == TRUE) - drmAgpRelease(pI810->drmSubFD); - pI810->agpAcquired = FALSE; - } - return TRUE; -} - -Bool -I810DRIEnter(ScrnInfoPtr pScrn) -{ - I810Ptr pI810 = I810PTR(pScrn); - - if (pI810->directRenderingEnabled) { - - if (pI810->agpAcquired == FALSE) - drmAgpAcquire(pI810->drmSubFD); - pI810->agpAcquired = TRUE; - if (pI810->dcacheHandle != 0) - if (drmAgpBind(pI810->drmSubFD, pI810->dcacheHandle, - pI810->DepthOffset) != 0) - return FALSE; - if (pI810->backHandle != 0) - if (drmAgpBind(pI810->drmSubFD, pI810->backHandle, - pI810->BackOffset) != 0) - return FALSE; - if (pI810->zHandle != 0) - if (drmAgpBind(pI810->drmSubFD, pI810->zHandle, - pI810->DepthOffset) != 0) - return FALSE; - if (pI810->sysmemHandle != 0) - if (drmAgpBind(pI810->drmSubFD, pI810->sysmemHandle, 0) != 0) - return FALSE; - if (pI810->xvmcHandle != 0) - if (drmAgpBind(pI810->drmSubFD, pI810->xvmcHandle, - pI810->MC.Start) != 0) - return FALSE; - if (pI810->cursorHandle != 0) - if (drmAgpBind(pI810->drmSubFD, pI810->cursorHandle, - pI810->CursorStart) != 0) - return FALSE; - } - return TRUE; -} diff --git a/src/i810_driver.c b/src/i810_driver.c index 0d07f296..25a60f9d 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.101 2004/01/02 20:15:47 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c,v 1.87 2003/08/23 15:03:01 dawes Exp $ */ /* * Reformatted with GNU indent (2.2.8), using the following options: @@ -96,8 +96,8 @@ static void I810FreeScreen(int scrnIndex, int flags); static void I810DisplayPowerManagementSet(ScrnInfoPtr pScrn, int PowerManagermentMode, int flags); -static ModeStatus I810ValidMode(int scrnIndex, DisplayModePtr mode, - Bool verbose, int flags); +static int I810ValidMode(int scrnIndex, DisplayModePtr mode, Bool + verbose, int flags); #endif /* I830_ONLY */ @@ -243,9 +243,8 @@ const char *I810int10Symbols[] = { const char *I810xaaSymbols[] = { "XAACreateInfoRec", "XAADestroyInfoRec", + "XAAFillSolidRects", "XAAInit", - "XAACopyROP", - "XAAPatternROP", NULL }; @@ -256,8 +255,10 @@ const char *I810ramdacSymbols[] = { NULL }; +#ifndef I830_ONLY +#ifdef XFree86LOADER #ifdef XF86DRI -const char *I810drmSymbols[] = { +static const char *drmSymbols[] = { "drmAddBufs", "drmAddMap", "drmAgpAcquire", @@ -266,7 +267,6 @@ const char *I810drmSymbols[] = { "drmAgpEnable", "drmAgpFree", "drmAgpRelease", - "drmAgpUnbind", "drmAuthMagic", "drmCommandWrite", "drmCreateContext", @@ -281,7 +281,7 @@ const char *I810drmSymbols[] = { }; -const char *I810driSymbols[] = { +static const char *driSymbols[] = { "DRICloseScreen", "DRICreateInfoRec", "DRIDestroyInfoRec", @@ -295,6 +295,9 @@ const char *I810driSymbols[] = { NULL }; +#endif +#endif + #ifdef XF86DRI static const char *driShadowFBSymbols[] = { @@ -347,7 +350,7 @@ static XF86ModuleVersionInfo i810VersRec = { MODULEVENDORSTRING, MODINFOSTRING1, MODINFOSTRING2, - XORG_VERSION_CURRENT, + XF86_VERSION_CURRENT, I810_MAJOR_VERSION, I810_MINOR_VERSION, I810_PATCHLEVEL, ABI_CLASS_VIDEODRV, ABI_VIDEODRV_VERSION, @@ -375,10 +378,10 @@ i810Setup(pointer module, pointer opts, int *errmaj, int *errmin) LoaderRefSymLists(I810vgahwSymbols, I810fbSymbols, I810xaaSymbols, I810ramdacSymbols, #ifdef XF86DRI - I810drmSymbols, - I810driSymbols, - I810shadowSymbols, + drmSymbols, + driSymbols, driShadowFBSymbols, + I810shadowSymbols, #endif I810vbeSymbols, vbeOptionalSymbols, I810ddcSymbols, I810int10Symbols, NULL); @@ -855,7 +858,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; } @@ -930,8 +933,7 @@ I810PreInit(ScrnInfoPtr pScrn, int flags) } clockRanges = xnfcalloc(sizeof(ClockRange), 1); clockRanges->next = NULL; - /* 9.4MHz appears to be the smallest that works. */ - clockRanges->minClock = 9500; + clockRanges->minClock = 12000; /* !!! What's the min clock? !!! */ clockRanges->maxClock = pI810->MaxClock; clockRanges->clockIndex = -1; clockRanges->interlaceAllowed = TRUE; @@ -1066,15 +1068,6 @@ I810PreInit(ScrnInfoPtr pScrn, int flags) pI810->numSurfaces = 0; } -#ifdef XF86DRI - /* Load the dri module if requested. */ - if (xf86ReturnOptValBool(pI810->Options, OPTION_DRI, FALSE)) { - if (xf86LoadSubModule(pScrn, "dri")) { - xf86LoaderReqSymLists(I810driSymbols, I810drmSymbols, NULL); - } - } -#endif - /* We won't be using the VGA access after the probe */ I810SetMMIOAccess(pI810); xf86SetOperatingState(resVgaIo, pI810->pEnt->index, ResUnusedOpr); @@ -1411,20 +1404,13 @@ DoRestore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, I810RegPtr i810Reg, /* Setting the OVRACT Register for video overlay */ { CARD32 LCD_TV_Control = INREG(LCD_TV_C); - CARD32 TV_HTotal = INREG(LCD_TV_HTOTAL); - CARD32 ActiveStart, ActiveEnd; - if((LCD_TV_Control & LCD_TV_ENABLE) - && !(LCD_TV_Control & LCD_TV_VGAMOD) - && TV_HTotal) { - ActiveStart = ((TV_HTotal >> 16) & 0xfff) - 31; - ActiveEnd = (TV_HTotal & 0x3ff) - 31; - } else { - ActiveStart = i810Reg->OverlayActiveStart; - ActiveEnd = i810Reg->OverlayActiveEnd; + if(!(LCD_TV_Control & LCD_TV_ENABLE) + || (LCD_TV_Control & LCD_TV_VGAMOD)) { + OUTREG(LCD_TV_OVRACT, + (i810Reg->OverlayActiveEnd << 16) + | i810Reg->OverlayActiveStart); } - OUTREG(LCD_TV_OVRACT, - (ActiveEnd << 16) | ActiveStart); } /* Turn on DRAM Refresh */ @@ -1576,11 +1562,6 @@ 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; @@ -1610,7 +1591,7 @@ I810CalcVCLK(ScrnInfoPtr pScrn, double freq) i810Reg->VideoClk2_DivisorSel = (p_best << 4); xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 3, - "Setting dot clock to %.1f MHz " "[ 0x%x 0x%x 0x%x ] " + "Setting dot clock to %.1lf MHz " "[ 0x%x 0x%x 0x%x ] " "[ %d %d %d ]\n", CALC_VCLK(m_best, n_best, p_best), i810Reg->VideoClk2_M, i810Reg->VideoClk2_N, i810Reg->VideoClk2_DivisorSel, m_best, n_best, p_best); @@ -2222,38 +2203,9 @@ 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 + ErrorF("I810SwitchMode %p %x\n", mode, flags); return I810ModeInit(pScrn, mode); } @@ -2265,7 +2217,6 @@ I810AdjustFrame(int scrnIndex, int x, int y, int flags) I810Ptr pI810 = I810PTR(pScrn); vgaHWPtr hwp = VGAHWPTR(pScrn); int Base; - #if 1 if (pI810->showCache) { int lastline = pI810->FbMapSize / @@ -2322,13 +2273,10 @@ I810EnterVT(int scrnIndex, int flags) if (I810_DEBUG & DEBUG_VERBOSE_DRI) ErrorF("\n\nENTER VT\n"); - if (!I810BindGARTMemory(pScrn)) { + if (!I810BindGARTMemory(pScrn)) return FALSE; - } + #ifdef XF86DRI - if (!I810DRIEnter(pScrn)) { - return FALSE; - } if (pI810->directRenderingEnabled) { if (I810_DEBUG & DEBUG_VERBOSE_DRI) ErrorF("calling dri unlock\n"); @@ -2371,10 +2319,6 @@ I810LeaveVT(int scrnIndex, int flags) if (!I810UnbindGARTMemory(pScrn)) return; -#ifdef XF86DRI - if (!I810DRILeave(pScrn)) - return; -#endif vgaHWLock(hwp); } @@ -2388,11 +2332,6 @@ 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); } @@ -2453,7 +2392,7 @@ I810FreeScreen(int scrnIndex, int flags) vgaHWFreeHWRec(xf86Screens[scrnIndex]); } -static ModeStatus +static int I810ValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags) { if (mode->Flags & V_INTERLACE) { diff --git a/src/i810_hwmc.c b/src/i810_hwmc.c index 1fc162ed..525ad361 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.3 2001/12/04 21:17:56 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_hwmc.c,v 1.4 2002/09/11 00:29:32 dawes Exp $ */ #include "xf86.h" diff --git a/src/i810_io.c b/src/i810_io.c index a2da7bf6..de947dde 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.4 2002/01/25 21:56:04 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_io.c,v 1.5 2002/09/11 00:29:32 dawes 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 0ff63a5b..5efa23a9 100644 --- a/src/i810_memory.c +++ b/src/i810_memory.c @@ -149,7 +149,7 @@ I810AllocateGARTMemory(ScrnInfoPtr pScrn) pI810->DcacheKey = key; if (!xf86BindGARTMemory(pScrn->scrnIndex, key, tom)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Allocation of %ld bytes for DCACHE failed\n", size); + "Allocation of %d bytes for DCACHE failed\n", size); pI810->DcacheKey = -1; } else { pI810->DcacheMem.Start = tom; @@ -159,7 +159,7 @@ I810AllocateGARTMemory(ScrnInfoPtr pScrn) } } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "No physical memory available for %ld bytes of DCACHE\n", + "No physical memory available for %d bytes of DCACHE\n", size); pI810->DcacheKey = -1; } @@ -188,7 +188,7 @@ I810AllocateGARTMemory(ScrnInfoPtr pScrn) pI810->HwcursKey = key; if (!xf86BindGARTMemory(pScrn->scrnIndex, key, tom)) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Allocation of %ld bytes for HW cursor failed\n", size); + "Allocation of %d bytes for HW cursor failed\n", size); pI810->HwcursKey = -1; } else { pI810->CursorPhysical = physical; diff --git a/src/i810_reg.h b/src/i810_reg.h index ef0a9ea1..c935982a 100644 --- a/src/i810_reg.h +++ b/src/i810_reg.h @@ -497,7 +497,6 @@ 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 8d2bdc9a..2855178c 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.26 2003/11/10 18:22:22 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_video.c,v 1.24 2003/09/08 14:25:29 eich Exp $ */ /* * i810_video.c: i810 Xv driver. Based on the mga Xv driver by Mark Vojkovich. @@ -420,7 +420,7 @@ I810SetupImageVideo(ScreenPtr pScreen) pPriv->currentBuf = 0; /* gotta uninit this someplace */ - REGION_NULL(pScreen, &pPriv->clip); + REGION_INIT(pScreen, &pPriv->clip, NullBox, 0); pI810->adaptor = adapt; @@ -765,9 +765,9 @@ I810DisplayVideo( } else { overlay->OV0CONF = 0; /* two 720 pixel line buffers */ } - + overlay->SHEIGHT = height | (height << 15); - overlay->DWINPOS = (dstBox->y1 << 16) | (dstBox->x1); + overlay->DWINPOS = (dstBox->y1 << 16) | dstBox->x1; overlay->DWINSZ = ((dstBox->y2 - dstBox->y1) << 16) | (dstBox->x2 - dstBox->x1); @@ -991,18 +991,14 @@ I810PutImage( dstBox.y2 = drw_y + drw_h; I810ClipVideo(&dstBox, &x1, &x2, &y1, &y2, - REGION_EXTENTS(pScrn->pScreen, clipBoxes), width, height); - + REGION_EXTENTS(pScreen, clipBoxes), width, height); + if((x1 >= x2) || (y1 >= y2)) return Success; - /* - * Fix for 4 pixel granularity of AdjustFrame - * unless boarder is clipped by frame - */ - dstBox.x1 -= (pScrn->frameX0 & - ((dstBox.x1 == pScrn->frameX0) ? ~0x0UL : ~0x3UL)); - dstBox.x2 -= (pScrn->frameX0 & ~0x3); - dstBox.y1 -= pScrn->frameY0; + + dstBox.x1 -= pScrn->frameX0; + dstBox.x2 -= pScrn->frameX0; + dstBox.y1 -= pScrn->frameY0; dstBox.y2 -= pScrn->frameY0; switch(id) { @@ -1083,6 +1079,7 @@ I810PutImage( xf86XVFillKeyHelper(pScrn->pScreen, pPriv->colorKey, clipBoxes); } + I810DisplayVideo(pScrn, id, width, height, dstPitch, x1, y1, x2, y2, &dstBox, src_w, src_h, drw_w, drw_h); @@ -1339,13 +1336,8 @@ I810DisplaySurface( REGION_EXTENTS(screenInfo.screens[0], clipBoxes), surface->width, surface->height); - /* - * Fix for 4 pixel granularity of AdjustFrame - * unless boarder is clipped by frame - */ - dstBox.x1 -= (pScrn->frameX0 & - ((dstBox.x1 == pScrn->frameX0) ? ~0x0UL : ~0x3UL)); - dstBox.x2 -= (pScrn->frameX0 & ~0x3); + dstBox.x1 -= pScrn->frameX0; + dstBox.x2 -= pScrn->frameX0; dstBox.y1 -= pScrn->frameY0; dstBox.y2 -= pScrn->frameY0; diff --git a/src/i810_wmark.c b/src/i810_wmark.c index f124e5f1..9a6bdd34 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.7 2002/09/11 00:29:32 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i810_wmark.c,v 1.8 2002/10/30 12:52:18 alanh 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.12 2004/01/07 03:43:19 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830.h,v 1.9 2003/09/03 15:32:26 dawes Exp $ */ /* * Authors: @@ -147,7 +147,6 @@ typedef struct _I830Rec { unsigned long TotalVideoRam; I830MemRange StolenMemory; /* pre-allocated memory */ unsigned long BIOSMemorySize; /* min stolen pool size */ - int BIOSMemSizeLoc; /* These change according to what has been allocated. */ long FreeMemory; @@ -183,7 +182,6 @@ typedef struct _I830Rec { Bool NeedRingBufferLow; Bool allowPageFlip; - Bool disableTiling; int auxPitch; int auxPitchBits; @@ -301,9 +299,6 @@ typedef struct _I830Rec { int xoffset; int yoffset; - int SaveGeneration; - Bool vbeRestoreWorkaround; - Bool displayInfo; } I830Rec; #define I830PTR(p) ((I830Ptr)((p)->driverPrivate)) @@ -400,9 +395,5 @@ extern void I830ChangeFrontbuffer(ScrnInfoPtr pScrn,int buffer); #define ALLOCATE_DRY_RUN 0x80000000 -/* Chipset registers for VIDEO BIOS memory RW access */ -#define _855_DRAM_RW_CONTROL 0x58 -#define _845_DRAM_RW_CONTROL 0x90 -#define DRAM_WRITE 0x33330000 #endif /* _I830_H_ */ diff --git a/src/i830_accel.c b/src/i830_accel.c index 64cf365a..63dce22d 100644 --- a/src/i830_accel.c +++ b/src/i830_accel.c @@ -55,10 +55,48 @@ 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) { @@ -359,7 +397,7 @@ I830SetupForSolidFill(ScrnInfoPtr pScrn, int color, int rop, ErrorF("I830SetupForFillRectSolid color: %x rop: %x mask: %x\n", color, rop, planemask); - pI830->BR[13] = ((XAAPatternROP[rop] << 16) | + pI830->BR[13] = ((i810PatternRop[rop] << 16) | (pScrn->displayWidth * pI830->cpp)); pI830->BR[16] = color; @@ -415,7 +453,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] |= XAACopyROP[rop] << 16; + pI830->BR[13] |= i810Rop[rop] << 16; switch (pScrn->bitsPerPixel) { case 8: @@ -481,7 +519,7 @@ I830SetupForMono8x8PatternFill(ScrnInfoPtr pScrn, int pattx, int patty, pI830->BR[19] = fg; pI830->BR[13] = (pScrn->displayWidth * pI830->cpp); /* In bytes */ - pI830->BR[13] |= XAAPatternROP[rop] << 16; + pI830->BR[13] |= i810PatternRop[rop] << 16; if (bg == -1) pI830->BR[13] |= (1 << 28); @@ -570,7 +608,7 @@ I830SetupForScanlineCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, /* Fill out register values */ pI830->BR[13] = (pScrn->displayWidth * pI830->cpp); - pI830->BR[13] |= XAACopyROP[rop] << 16; + pI830->BR[13] |= i810Rop[rop] << 16; if (bg == -1) pI830->BR[13] |= (1 << 29); @@ -659,7 +697,7 @@ I830SetupForScanlineImageWrite(ScrnInfoPtr pScrn, int rop, /* Fill out register values */ pI830->BR[13] = (pScrn->displayWidth * pI830->cpp); - pI830->BR[13] |= XAACopyROP[rop] << 16; + pI830->BR[13] |= i810Rop[rop] << 16; switch (pScrn->bitsPerPixel) { case 8: diff --git a/src/i830_common.h b/src/i830_common.h index 816d9840..3367bfc1 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.1 2002/09/11 00:29:32 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_common.h,v 1.2 2002/12/10 01:27:05 dawes Exp $ */ /* Author: Jeff Hartmann <jhartmann@valinux.com> diff --git a/src/i830_cursor.c b/src/i830_cursor.c index 9f2baa3a..ef9a81ee 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.6 2002/12/18 15:49:01 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_cursor.c,v 1.7 2003/06/18 13:14:17 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 8bd570c6..bb4c103a 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.2 2002/11/05 02:01:18 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dga.c,v 1.3 2003/02/26 04:11:23 dawes Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" diff --git a/src/i830_dri.h b/src/i830_dri.h index 6671c2e2..69a4f678 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.6 2003/09/28 20:15:59 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_dri.h,v 1.5 2002/12/10 01:27:05 dawes Exp $ */ #ifndef _I830_DRI_H #define _I830_DRI_H @@ -125,7 +125,7 @@ typedef struct _I830SAREA { unsigned int TexState3[I830_TEX_SETUP_SIZE]; unsigned int TexBlendState3[I830_TEXBLEND_SIZE]; unsigned int TexBlendStateWordsUsed3; - + unsigned int StippleState[I830_STP_SETUP_SIZE]; } I830SAREARec, *I830SAREAPtr; diff --git a/src/i830_driver.c b/src/i830_driver.c index a96ada52..5f5c36d6 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.50 2004/02/20 00:06:00 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_driver.c,v 1.36 2003/09/03 15:32:26 dawes Exp $ */ /************************************************************************** Copyright 2001 VA Linux Systems Inc., Fremont, California. @@ -202,8 +202,8 @@ typedef enum { OPTION_XVIDEO, OPTION_VIDEO_KEY, OPTION_COLOR_KEY, - OPTION_VBE_RESTORE, - OPTION_DISPLAY_INFO + OPTION_STRETCH, + OPTION_CENTER } I830Opts; static OptionInfoRec I830BIOSOptions[] = { @@ -215,8 +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}, + {OPTION_STRETCH, "Stretch", OPTV_BOOLEAN, {0}, FALSE}, + {OPTION_CENTER, "Center", OPTV_BOOLEAN, {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE} }; /* *INDENT-ON* */ @@ -790,26 +790,18 @@ I830DetectDisplayDevice(ScrnInfoPtr pScrn) I830Ptr pI830 = I830PTR(pScrn); int pipe, n; DisplayType 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], + + 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); - } } } @@ -1071,97 +1063,6 @@ SaveBIOSMemSize(ScrnInfoPtr pScrn) return FALSE; } -/* - * TweakMemorySize() tweaks the BIOS image to set the correct size. - * Original implementation by Christian Zietz in a stand-alone tool. - */ -static CARD32 -TweakMemorySize(ScrnInfoPtr pScrn, CARD32 newsize, Bool preinit) -{ -#define SIZE 0x10000 -#define _855_IDOFFSET (-23) -#define _845_IDOFFSET (-19) - - const char *MAGICstring = "Total time for VGA POST:"; - const int len = strlen(MAGICstring); - I830Ptr pI830 = I830PTR(pScrn); - char *position; - char *biosAddr; - CARD32 oldsize; - CARD32 oldpermission; - CARD32 ret = 0; - int i,j = 0; - PCITAG tag =pciTag(0,0,0); - int reg = IS_845G(pI830) ? _845_DRAM_RW_CONTROL : _855_DRAM_RW_CONTROL; - - if(!pI830->PciInfo - || !(pI830->PciInfo->chipType == PCI_CHIP_845_G - || pI830->PciInfo->chipType == PCI_CHIP_I855_GM - || pI830->PciInfo->chipType == PCI_CHIP_I865_G)) - return 0; - - if (!pI830->pVbe) - return 0; - - biosAddr = xf86int10Addr(pI830->pVbe->pInt10, - pI830->pVbe->pInt10->BIOSseg << 4); - - if (!pI830->BIOSMemSizeLoc) { - - if (!preinit) - return 0; - - /* Search for MAGIC string */ - for (i = 0; i < SIZE; i++) { - if (biosAddr[i] == MAGICstring[j]) { - if (++j == len) - break; - } else { - i -= j; - j = 0; - } - } - if (j < len) return 0; - - pI830->BIOSMemSizeLoc = (i - j + 1 + (IS_845G(pI830) - ? _845_IDOFFSET : _855_IDOFFSET)); - } - - position = biosAddr + pI830->BIOSMemSizeLoc; - oldsize = *(CARD32 *)position; - ret = oldsize - (3 << 16); - /* verify that register really contains current size */ - if (preinit && ((oldsize) >> 16) - 3 != pI830->vbeInfo->TotalMemory) - return 0; - - oldpermission = pciReadLong(tag, reg); - pciWriteLong(tag, reg, 0x33330000); - - *(CARD32 *)position = newsize + (3 << 16); - if (preinit) { - /* reinitialize VBE for new size */ - VBEFreeVBEInfo(pI830->vbeInfo); - vbeFree(pI830->pVbe); - pI830->pVbe = VBEInit(NULL, pI830->pEnt->index); - pI830->vbeInfo = VBEGetVBEInfo(pI830->pVbe); - - /* verify that change was successful */ - if (pI830->vbeInfo->TotalMemory * 64 * 1024 != pI830->newBIOSMemSize){ - ret = 0; - *(CARD32 *)position = oldsize; - } else { - pI830->BIOSMemorySize = KB(pI830->vbeInfo->TotalMemory * 64); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Tweak BIOS image to %d kB VideoRAM\n", - (int)(pI830->BIOSMemorySize / 1024)); - } - } - - pciWriteLong(tag, reg, oldpermission); - - return ret; -} - static void RestoreBIOSMemSize(ScrnInfoPtr pScrn) { @@ -1170,9 +1071,6 @@ RestoreBIOSMemSize(ScrnInfoPtr pScrn) DPRINTF(PFX, "RestoreBIOSMemSize\n"); - if (TweakMemorySize(pScrn, pI830->saveBIOSMemSize,FALSE)) - return; - if (!pI830->overrideBIOSMemSize) return; @@ -1195,7 +1093,7 @@ static void SetBIOSMemSize(ScrnInfoPtr pScrn, int newSize) { I830Ptr pI830 = I830PTR(pScrn); - unsigned long swf1; + CARD32 swf1; Bool mapped; DPRINTF(PFX, "SetBIOSMemSize: %d kB\n", newSize / 1024); @@ -1211,7 +1109,7 @@ SetBIOSMemSize(ScrnInfoPtr pScrn, int newSize) #endif if ((IS_I830(pI830) || IS_845G(pI830)) && pI830->useSWF1) { - unsigned long newSWF1; + CARD32 newSWF1; /* Need MMIO access here. */ mapped = (pI830->MMIOBase != NULL); @@ -1224,10 +1122,10 @@ SetBIOSMemSize(ScrnInfoPtr pScrn, int newSize) newSWF1 = 8; swf1 = INREG(SWF1); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Before: SWF1 is 0x%08lx\n", swf1); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Before: SWF1 is 0x%08x\n", swf1); swf1 &= ~0x0f; swf1 |= (newSWF1 & 0x0f); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "After: SWF1 is 0x%08lx\n", swf1); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "After: SWF1 is 0x%08x\n", swf1); OUTREG(SWF1, swf1); if (!mapped) I830UnmapMMIO(pScrn); @@ -1345,7 +1243,6 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int flags) return FALSE; pI830 = I830PTR(pScrn); - pI830->SaveGeneration = -1; pI830->pEnt = pEnt; if (pI830->pEnt->location.type != BUS_PCI) @@ -1558,7 +1455,7 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int flags) /* Sanity check: compare with what the BIOS thinks. */ if (pI830->vbeInfo->TotalMemory != pI830->StolenMemory.Size / 1024 / 64) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "Detected stolen memory (%ld kB) doesn't match what the BIOS" + "Detected stolen memory (%d kB) doesn't match what the BIOS" " reports (%d kB)\n", ROUND_DOWN_TO(pI830->StolenMemory.Size / 1024, 64), pI830->vbeInfo->TotalMemory * 64); @@ -1662,7 +1559,7 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int flags) "VideoRam reduced to %d kByte (limited to aperture size)\n", pScrn->videoRam); } - + if (mem > 0) { /* * If the reserved (BIOS accessible) memory is less than the desired @@ -1689,11 +1586,13 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int flags) else pI830->newBIOSMemSize = KB(ROUND_DOWN_TO(pScrn->videoRam - reserve, 64)); + if (pI830->vbeInfo->TotalMemory * 64 < pI830->newBIOSMemSize / 1024) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Will attempt to tell the BIOS that there is " "%d kB VideoRAM\n", pI830->newBIOSMemSize / 1024); + if (SaveBIOSMemSize(pScrn)) { pI830->overrideBIOSMemSize = TRUE; SetBIOSMemSize(pScrn, pI830->newBIOSMemSize); @@ -1706,22 +1605,17 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int flags) pI830->BIOSMemorySize = KB(pI830->vbeInfo->TotalMemory * 64); xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "BIOS now sees %ld kB VideoRAM\n", + "BIOS now sees %d kB VideoRAM\n", pI830->BIOSMemorySize / 1024); - } else if ((pI830->saveBIOSMemSize - = TweakMemorySize(pScrn, pI830->newBIOSMemSize, TRUE)) != 0) - pI830->overrideBIOSMemSize = TRUE; - else { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "BIOS view of memory size can't be changed " - "(this is not an error).\n"); + } else { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "BIOS view of memory size can't be changed " + "(this is not an error).\n"); } } } - pVbe = pI830->pVbe; - - xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Pre-allocated VideoRAM: %ld kByte\n", + xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Pre-allocated VideoRAM: %d kByte\n", pI830->StolenMemory.Size / 1024); xf86DrvMsg(pScrn->scrnIndex, from, "VideoRAM: %d kByte\n", pScrn->videoRam); pI830->TotalVideoRam = KB(pScrn->videoRam); @@ -1780,7 +1674,7 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int flags) else pI830->CursorNeedsPhysical = FALSE; - /* Force ring buffer to be in low memory for the 845G and later. */ + /* Force ring buffer to be in low memory for the 845G. */ if (IS_845G(pI830) || IS_I85X(pI830) || IS_I865G(pI830)) pI830->NeedRingBufferLow = TRUE; @@ -1828,15 +1722,6 @@ 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"); @@ -2035,7 +1920,7 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Allocation with DRI tiling enabled would " "exceed the\n" - "\tmemory aperture size (%ld kB) by %ld kB.\n" + "\tmemory aperture size (%d kB) by %d kB.\n" "\tReduce VideoRam amount to avoid this!\n", pI830->FbMapSize / 1024, -pI830->MemoryAperture.Size / 1024); @@ -2059,7 +1944,6 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int flags) * Tiling can't be enabled. Check if there's enough memory for DRI * without tiling. */ - pI830->disableTiling = TRUE; I830ResetAllocations(pScrn, 0); if (I830Allocate2DMemory(pScrn, ALLOCATE_DRY_RUN | ALLOC_INITIAL) && I830Allocate3DMemory(pScrn, ALLOCATE_DRY_RUN | ALLOC_NO_TILING)) { @@ -2075,7 +1959,7 @@ I830BIOSPreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Allocation with DRI enabled would " "exceed the\n" - "\tmemory aperture size (%ld kB) by %ld kB.\n" + "\tmemory aperture size (%d kB) by %d kB.\n" "\tReduce VideoRam amount to avoid this!\n", pI830->FbMapSize / 1024, -pI830->MemoryAperture.Size / 1024); @@ -2149,25 +2033,7 @@ 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) && - !pI830->directRenderingDisabled) { - if (xf86LoadSubModule(pScrn, "dri")) { - xf86LoaderReqSymLists(I810driSymbols, I810drmSymbols, NULL); - } - } - if (!pI830->directRenderingDisabled) { if (!xf86LoadSubModule(pScrn, "shadow")) { PreInitCleanup(pScrn); @@ -2194,26 +2060,26 @@ CheckInheritedState(ScrnInfoPtr pScrn) /* Check first for page table errors */ temp = INREG(PGE_ERR); if (temp != 0) { - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "PGTBL_ER is 0x%08lx\n", temp); + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "PGTBL_ER is 0x%08x\n", temp); errors++; } temp = INREG(PGETBL_CTL); if (!(temp & 1)) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "PGTBL_CTL (0x%08lx) indicates GTT is disabled\n", temp); + "PGTBL_CTL (0x%08x) indicates GTT is disabled\n", temp); errors++; } temp = INREG(LP_RING + RING_LEN); if (temp & 1) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "PRB0_CTL (0x%08lx) indicates ring buffer enabled\n", temp); + "PRB0_CTL (0x%08x) indicates ring buffer enabled\n", temp); errors++; } head = INREG(LP_RING + RING_HEAD); tail = INREG(LP_RING + RING_TAIL); if ((tail & I830_TAIL_MASK) != (head & I830_HEAD_MASK)) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "PRB0_HEAD (0x%08lx) and PRB0_TAIL (0x%08lx) indicate " + "PRB0_HEAD (0x%08x) and PRB0_TAIL (0x%08x) indicate " "ring buffer not flushed\n", head, tail); errors++; } @@ -2298,7 +2164,7 @@ SetRingRegs(ScrnInfoPtr pScrn) if ((pI830->LpRing.mem.Start & I830_RING_START_MASK) != pI830->LpRing.mem.Start) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "I830SetRingRegs: Ring buffer start (%lx) violates its " + "I830SetRingRegs: Ring buffer start (%x) violates its " "mask (%x)\n", pI830->LpRing.mem.Start, I830_RING_START_MASK); } /* Don't care about the old value. Reserved bits must be zero anyway. */ @@ -2308,7 +2174,7 @@ SetRingRegs(ScrnInfoPtr pScrn) if (((pI830->LpRing.mem.Size - 4096) & I830_RING_NR_PAGES) != pI830->LpRing.mem.Size - 4096) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "I830SetRingRegs: Ring buffer size - 4096 (%lx) violates its " + "I830SetRingRegs: Ring buffer size - 4096 (%x) violates its " "mask (%x)\n", pI830->LpRing.mem.Size - 4096, I830_RING_NR_PAGES); } @@ -2364,18 +2230,21 @@ 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 */ /* - * This save/restore method doesn't work for 845G BIOS, or for some - * other platforms. Enable it in all cases. - */ - /* + * XXX If it's fixed in production versions, this could be removed. + * * KW: This may have been because of the behaviour I've found on my * board: The 'save' command actually modifies the interrupt * registers, turning off the irq & breaking the kernel module * behaviour. */ - if (!pI830->vbeRestoreWorkaround) { + if (!I845G_VBE_WORKAROUND || !IS_845G(pI830)) { CARD16 imr = INREG16(IMR); CARD16 ier = INREG16(IER); CARD16 hwstam = INREG16(HWSTAM); @@ -2571,22 +2440,6 @@ 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. @@ -2690,10 +2543,10 @@ I830VESASetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode) * Print out the PIPEACONF and PIPEBCONF registers. */ temp = INREG(PIPEACONF); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "PIPEACONF is 0x%08lx\n", temp); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "PIPEACONF is 0x%08x\n", temp); if (IS_MOBILE(pI830)) { temp = INREG(PIPEBCONF); - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "PIPEBCONF is 0x%08lx\n", temp); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "PIPEBCONF is 0x%08x\n", temp); } #if PRINT_MODE_INFO @@ -2738,7 +2591,7 @@ I830VESASetMode(ScrnInfoPtr pScrn, DisplayModePtr pMode) if (temp / pI830->cpp != pScrn->displayWidth) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, "Correcting plane %c stride (%d -> %d)\n", PIPE_NAME(i), - (int)(temp / pI830->cpp), pScrn->displayWidth); + temp / pI830->cpp, pScrn->displayWidth); OUTREG(stridereg, pScrn->displayWidth * pI830->cpp); /* Trigger update */ temp = INREG(basereg); @@ -3036,8 +2889,7 @@ I830BIOSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) * first, then re-initialise the VBE information. */ pI830->pVbe = VBEInit(NULL, pI830->pEnt->index); - if (!TweakMemorySize(pScrn, pI830->newBIOSMemSize,FALSE)) - SetBIOSMemSize(pScrn, pI830->newBIOSMemSize); + SetBIOSMemSize(pScrn, pI830->newBIOSMemSize); if (!pI830->pVbe) return FALSE; pI830->vbeInfo = VBEGetVBEInfo(pI830->pVbe); @@ -3136,13 +2988,9 @@ I830BIOSScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) if (pI830->directRenderingEnabled) pI830->directRenderingEnabled = I830DRIScreenInit(pScreen); - if (pI830->directRenderingEnabled) { - pI830->directRenderingEnabled = - I830Allocate3DMemory(pScrn, - pI830->disableTiling ? ALLOC_NO_TILING : 0); - if (!pI830->directRenderingEnabled) + if (pI830->directRenderingEnabled) + if (!(pI830->directRenderingEnabled = I830Allocate3DMemory(pScrn, 0))) I830DRICloseScreen(pScreen); - } #else pI830->directRenderingEnabled = FALSE; @@ -3398,6 +3246,7 @@ I830BIOSEnterVT(int scrnIndex, int flags) { ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; I830Ptr pI830 = I830PTR(pScrn); + static int SaveGeneration = -1; DPRINTF(PFX, "Enter VT\n"); @@ -3405,15 +3254,14 @@ I830BIOSEnterVT(int scrnIndex, int flags) return FALSE; CheckInheritedState(pScrn); - if (!TweakMemorySize(pScrn, pI830->newBIOSMemSize,FALSE)) - SetBIOSMemSize(pScrn, pI830->newBIOSMemSize); + SetBIOSMemSize(pScrn, pI830->newBIOSMemSize); /* * Only save state once per server generation since that's what most * drivers do. Could change this to save state at each VT enter. */ - if (pI830->SaveGeneration != serverGeneration) { - pI830->SaveGeneration = serverGeneration; + if (SaveGeneration != serverGeneration) { + SaveGeneration = serverGeneration; SaveHWState(pScrn); } ResetState(pScrn, FALSE); @@ -3625,7 +3473,7 @@ I830BIOSCloseScreen(int scrnIndex, ScreenPtr pScreen) return (*pScreen->CloseScreen) (scrnIndex, pScreen); } -static ModeStatus +static int I830ValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags) { if (mode->Flags & V_INTERLACE) { @@ -3711,5 +3559,3 @@ I830InitpScrn(ScrnInfoPtr pScrn) pScrn->ValidMode = I830ValidMode; pScrn->PMEvent = I830PMEvent; } - - diff --git a/src/i830_memory.c b/src/i830_memory.c index 19993b23..d3e52501 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.9 2003/09/24 03:16:54 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_memory.c,v 1.7 2003/06/18 13:14:19 dawes Exp $ */ /************************************************************************** Copyright 1998-1999 Precision Insight, Inc., Cedar Park, Texas. @@ -279,7 +279,7 @@ AllocateRingBuffer(ScrnInfoPtr pScrn, int flags) return FALSE; } xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, verbosity, - "%sAllocated %ld kB for the ring buffer at 0x%lx\n", s, + "%sAllocated %d kB for the ring buffer at 0x%x\n", s, alloced / 1024, pI830->LpRing.mem.Start); pI830->LpRing.tail_mask = pI830->LpRing.mem.Size - 1; return TRUE; @@ -335,8 +335,8 @@ AllocateOverlay(ScrnInfoPtr pScrn, int flags) /* This failure isn't fatal. */ } else { xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, verbosity, - "%sAllocated %ld kB for Overlay registers at 0x%lx " - "(0x%08lx).\n", s, + "%sAllocated %d kB for Overlay registers at 0x%x " + "(0x%08x).\n", s, alloced / 1024, pI830->OverlayMem.Start, pI830->OverlayMem.Physical); } @@ -503,7 +503,7 @@ I830Allocate2DMemory(ScrnInfoPtr pScrn, const int flags) size = lineSize * (pScrn->virtualY + cacheLines); size = ROUND_TO_PAGE(size); xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, verbosity, - "%sInitial framebuffer allocation size: %ld kByte\n", s, + "%sInitial framebuffer allocation size: %d kByte\n", s, size / 1024); alloced = I830AllocVidMem(pScrn, &(pI830->FrontBuffer), &(pI830->StolenPool), size, align, @@ -547,7 +547,7 @@ I830Allocate2DMemory(ScrnInfoPtr pScrn, const int flags) xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Internal error in I830Allocate2DMemory():\n\t" "Framebuffer isn't the last allocation at the bottom" - " of StolenPool\n\t(%lx != %lx).\n", + " of StolenPool\n\t(%x != %x).\n", pI830->FrontBuffer.End, pI830->StolenPool.Free.Start); return FALSE; @@ -564,10 +564,10 @@ I830Allocate2DMemory(ScrnInfoPtr pScrn, const int flags) pI830->StolenPool.Free.Size += pI830->FrontBuffer.Size; pI830->StolenPool.Free.Start -= pI830->FrontBuffer.Size; xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, verbosity, - "%sUpdated framebuffer allocation size from %ld " - "to %ld kByte\n", s, oldsize / 1024, maxFb / 1024); + "%sUpdated framebuffer allocation size from %d " + "to %d kByte\n", s, oldsize / 1024, maxFb / 1024); xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, verbosity, - "%sUpdated pixmap cache from %ld scanlines to %ld " + "%sUpdated pixmap cache from %d scanlines to %d " "scanlines\n", s, oldsize / lineSize - pScrn->virtualY, maxFb / lineSize - pScrn->virtualY); @@ -636,10 +636,10 @@ I830Allocate2DMemory(ScrnInfoPtr pScrn, const int flags) } } else { xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, verbosity, - "%sAllocated %ld kB for HW cursor at 0x%lx", s, + "%sAllocated %d kB for HW cursor at 0x%x", s, alloced / 1024, pI830->CursorMem.Start); if (pI830->CursorNeedsPhysical) - xf86ErrorFVerb(verbosity, " (0x%08lx)", pI830->CursorMem.Physical); + xf86ErrorFVerb(verbosity, " (0x%08x)", pI830->CursorMem.Physical); xf86ErrorFVerb(verbosity, "\n"); } } @@ -675,7 +675,7 @@ I830Allocate2DMemory(ScrnInfoPtr pScrn, const int flags) return FALSE; } xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, verbosity, - "%sAllocated %ld kB for the scratch buffer at 0x%lx\n", s, + "%sAllocated %d kB for the scratch buffer at 0x%x\n", s, alloced / 1024, pI830->Scratch.Start); } return TRUE; @@ -806,7 +806,7 @@ I830Allocate3DMemory(ScrnInfoPtr pScrn, const int flags) return FALSE; } xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, verbosity, - "%sAllocated %ld kB for the back buffer at 0x%lx.\n", s, + "%sAllocated %d kB for the back buffer at 0x%x.\n", s, alloced / 1024, pI830->BackBuffer.Start); /* Depth Buffer -- same size as the back buffer */ @@ -844,7 +844,7 @@ I830Allocate3DMemory(ScrnInfoPtr pScrn, const int flags) return FALSE; } xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, verbosity, - "%sAllocated %ld kB for the depth buffer at 0x%lx.\n", s, + "%sAllocated %d kB for the depth buffer at 0x%x.\n", s, alloced / 1024, pI830->DepthBuffer.Start); /* Space for logical context. 32k is fine for right now. */ @@ -862,7 +862,7 @@ I830Allocate3DMemory(ScrnInfoPtr pScrn, const int flags) return FALSE; } xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, verbosity, - "%sAllocated %ld kB for the logical context at 0x%lx.\n", s, + "%sAllocated %d kB for the logical context at 0x%x.\n", s, alloced / 1024, pI830->ContextMem.Start); /* @@ -886,7 +886,7 @@ I830Allocate3DMemory(ScrnInfoPtr pScrn, const int flags) return FALSE; } xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, verbosity, - "%sAllocated %ld kB for the DMA buffers at 0x%lx.\n", s, + "%sAllocated %d kB for the DMA buffers at 0x%x.\n", s, alloced / 1024, pI830->BufferMem.Start); } else { if (!dryrun) { @@ -912,7 +912,7 @@ I830Allocate3DMemory(ScrnInfoPtr pScrn, const int flags) if (size < KB(512)) { if (!dryrun) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, - "Less than %ld kBytes for texture space.\n", size / 1024); + "Less than %d kBytes for texture space.\n", size / 1024); } return FALSE; } @@ -927,7 +927,7 @@ I830Allocate3DMemory(ScrnInfoPtr pScrn, const int flags) return FALSE; } xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, verbosity, - "%sAllocated %ld kB for textures at 0x%lx\n", s, + "%sAllocated %d kB for textures at 0x%x\n", s, alloced / 1024, pI830->TexMem.Start); return TRUE; @@ -1052,7 +1052,7 @@ FixOffset(ScrnInfoPtr pScrn, I830MemRange *mem) } #endif xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "%p: Memory at offset 0x%08lx, size %ld kBytes\n", (void *)mem, + "%p: Memory at offset 0x%08x, size %d kBytes\n", mem, mem->Start, mem->Size / 1024); return TRUE; } @@ -1108,7 +1108,7 @@ SetFence(ScrnInfoPtr pScrn, int nr, unsigned int start, unsigned int pitch, if (nr < 0 || nr > 7) { xf86DrvMsg(X_WARNING, pScrn->scrnIndex, - "SetFence: fence %d out of range\n", nr); + "SetFence: fence %d out of range\n"); return; } @@ -1298,7 +1298,7 @@ I830SetupMemoryTiling(ScrnInfoPtr pScrn) "MakeTiles failed for the back buffer.\n"); } } - + } #endif /* XF86DRI */ diff --git a/src/i830_video.c b/src/i830_video.c index 70d121e2..3d7b0349 100644 --- a/src/i830_video.c +++ b/src/i830_video.c @@ -1,6 +1,6 @@ #define VIDEO_DEBUG 0 /*************************************************************************** - + Copyright 2000 Intel Corporation. All Rights Reserved. Permission is hereby granted, free of charge, to any person obtaining a @@ -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.11tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/i810/i830_video.c,v 1.8 2003/06/18 13:14:19 dawes Exp $ */ /* * Reformatted with GNU indent (2.2.8), using the following options: @@ -631,15 +631,11 @@ I830SetupImageVideo(ScreenPtr pScreen) } /* gotta uninit this someplace */ - REGION_NULL(pScreen, &pPriv->clip); + REGION_INIT(pScreen, &pPriv->clip, NullBox, 0); pI830->adaptor = adapt; - /* - * Initialise pPriv->refreshOK. Set it to TRUE here so that a warning will - * be generated if I830VideoSwitchModeAfter() sets it to FALSE. - */ - pPriv->refreshOK = TRUE; + /* Initialise pPriv->refreshOK */ I830VideoSwitchModeAfter(pScrn, pScrn->currentMode); pI830->BlockHandler = pScreen->BlockHandler; @@ -989,7 +985,7 @@ UpdateCoeff(int taps, double fCutoff, Bool isHoriz, Bool isY, coeffPtr pCoeff) SetCoeffRegs(&coeffs[i][tap2Fix], mantSize + 2, pCoeff, pos); else SetCoeffRegs(&coeffs[i][tap2Fix], mantSize, pCoeff, pos); - + sum = 0.0; for (j = 0; j < taps; j++) sum += coeffs[i][j]; @@ -1151,7 +1147,7 @@ I830DisplayVideo(ScrnInfoPtr pScrn, int id, short width, short height, scaleChanged = TRUE; overlay->YRGBSCALE = newval; } - + newval = (xscaleIntUV << 16) | ((xscaleFractUV & 0xFFF) << 3) | ((yscaleFractUV & 0xFFF) << 20); if (newval != overlay->UVSCALE) { @@ -1166,14 +1162,14 @@ I830DisplayVideo(ScrnInfoPtr pScrn, int id, short width, short height, } /* Recalculate coefficients if the scaling changed. */ - + /* * Only Horizontal coefficients so far. */ if (scaleChanged) { double fCutoffY; double fCutoffUV; - + fCutoffY = xscaleFract / 4096.0; fCutoffUV = xscaleFractUV / 4096.0; @@ -1252,13 +1248,8 @@ I830AllocateMemory(ScrnInfoPtr pScrn, FBLinearPtr linear, int size) { ScreenPtr pScreen; FBLinearPtr new_linear; - int bytespp = pScrn->bitsPerPixel >> 3; DPRINTF(PFX, "I830AllocateMemory\n"); - - /* convert size in bytes into number of pixels */ - size = (size + bytespp - 1) / bytespp; - if (linear) { if (linear->size >= size) return linear; @@ -1795,9 +1786,6 @@ I830VideoSwitchModeBefore(ScrnInfoPtr pScrn, DisplayModePtr mode) if (pixrate > pPriv->maxRate && pPriv->refreshOK) { I830StopVideo(pScrn, pPriv, TRUE); pPriv->refreshOK = FALSE; - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "Disabling XVideo output because the mode pixel rate (%d MHz)\n" - "\texceeds the hardware limit (%d MHz).\n", pixrate, pPriv->maxRate); } } @@ -1819,16 +1807,6 @@ I830VideoSwitchModeAfter(ScrnInfoPtr pScrn, DisplayModePtr mode) mode->VRefresh = 60; pixrate = (mode->HDisplay * mode->VDisplay * mode->VRefresh) / 1000000; - if (pPriv->refreshOK && pixrate > pPriv->maxRate) { - pPriv->refreshOK = FALSE; - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "Disabling XVideo output because the mode pixel rate (%d MHz)\n" - "\texceeds the hardware limit (%d MHz)\n", pixrate, pPriv->maxRate); - } else if (!pPriv->refreshOK && pixrate <= pPriv->maxRate) { - pPriv->refreshOK = TRUE; - xf86DrvMsg(pScrn->scrnIndex, X_WARNING, - "Enabling XVideo output (mode pixel rate %d MHz is within limits).\n", - pixrate); - } + pPriv->refreshOK = (pixrate <= pPriv->maxRate); } |