diff options
author | keithw <keithw> | 2000-02-28 05:09:03 +0000 |
---|---|---|
committer | keithw <keithw> | 2000-02-28 05:09:03 +0000 |
commit | c0d628708d3f3075a98ce301ec38e75a764c1546 (patch) | |
tree | 4d9532e3dfcca324546445b12e5da583ace2726b | |
parent | bd04427a9561e1c4b52d22b110593f986b8174f4 (diff) |
Don't export visuals with no depth (for performer town)i810-20000227-driver-merge
Debugging and cleanup.
4 files changed, 81 insertions, 48 deletions
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.h b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.h index 8f09ba382..c08a51a18 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.h +++ b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810.h @@ -313,7 +313,7 @@ extern void I810EmitInvarientState(ScrnInfoPtr pScrn); /* To remove all debugging, make sure I810_DEBUG is defined as a * preprocessor symbol, and equal to zero. */ -#define I810_DEBUG 0 +/* #define I810_DEBUG 0 */ #ifndef I810_DEBUG #warning "Debugging enabled - expect reduced performance" extern int I810_DEBUG; diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_accel.c b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_accel.c index 4cef52d95..bb09037c8 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_accel.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_accel.c @@ -160,6 +160,7 @@ I810AccelInit( ScreenPtr pScreen ) infoPtr->SubsequentScreenToScreenCopy = I810SubsequentScreenToScreenCopy; } + /* 8x8 pattern fills */ { @@ -221,7 +222,6 @@ I810AccelInit( ScreenPtr pScreen ) /* Possible todo: Image writes w/ non-GXCOPY rop. */ - I810SelectBuffer(pScrn, I810_FRONT); return XAAInit(pScreen, infoPtr); @@ -237,15 +237,18 @@ I810WaitLpRing( ScrnInfoPtr pScrn, int n, int timeout_millis ) int start = 0; int now = 0; int last_head = 0; - + int first = 0; + /* If your system hasn't moved the head pointer in 2 seconds, I'm going to * call it crashed. */ if (timeout_millis == 0) timeout_millis = 2000; - if (I810_DEBUG & DEBUG_VERBOSE_ACCEL) + if (I810_DEBUG & DEBUG_VERBOSE_ACCEL) { ErrorF( "I810WaitLpRing %d\n", n); + first = GetTimeInMillis(); + } while (ring->space < n) { @@ -260,6 +263,9 @@ I810WaitLpRing( ScrnInfoPtr pScrn, int n, int timeout_millis ) iters++; now = GetTimeInMillis(); if ( start == 0 || now < start || ring->head != last_head) { + if (I810_DEBUG & DEBUG_VERBOSE_ACCEL) + if (now > start) + ErrorF( "space: %d wanted %d\n", ring->space, n ); start = now; last_head = ring->head; } else if ( now - start > timeout_millis ) { @@ -278,6 +284,15 @@ I810WaitLpRing( ScrnInfoPtr pScrn, int n, int timeout_millis ) ; } + if (I810_DEBUG & DEBUG_VERBOSE_ACCEL) + { + now = GetTimeInMillis(); + if (now - first) { + ErrorF("Elapsed %d ms\n", now - first); + ErrorF( "space: %d wanted %d\n", ring->space, n ); + } + } + return iters; } @@ -292,7 +307,14 @@ I810Sync( ScrnInfoPtr pScrn ) #ifdef XF86DRI /* VT switching tries to do this. */ - if (!pI810->LockHeld) return; + if (!pI810->LockHeld) { + ErrorF("\n\n\nLOCK NOT HELD\n\n\n"); + return; + } + + +/* if (pI810->directRenderingEnabled) */ +/* DRIUnlockLockQueiscent( pScrn->pScreen ); */ #endif /* Send a flush instruction and then wait till the ring is empty. @@ -301,7 +323,7 @@ I810Sync( ScrnInfoPtr pScrn ) */ { BEGIN_LP_RING(2); - OUT_RING( INST_PARSER_CLIENT | INST_OP_FLUSH ); + OUT_RING( INST_PARSER_CLIENT | INST_OP_FLUSH | INST_FLUSH_MAP_CACHE ); OUT_RING( 0 ); /* pad to quadword */ ADVANCE_LP_RING(); } @@ -575,7 +597,7 @@ I810EmitFlush( ScrnInfoPtr pScrn ) I810Ptr pI810 = I810PTR(pScrn); BEGIN_LP_RING(2); - OUT_RING( INST_PARSER_CLIENT | INST_OP_FLUSH ); + OUT_RING( INST_PARSER_CLIENT | INST_OP_FLUSH | INST_FLUSH_MAP_CACHE); OUT_RING( 0 ); ADVANCE_LP_RING(); } @@ -627,9 +649,9 @@ I810EmitInvarientState(ScrnInfoPtr pScrn) I810Ptr pI810 = I810PTR(pScrn); BEGIN_LP_RING( 8 ); - OUT_RING( INST_PARSER_CLIENT | INST_OP_FLUSH ); + OUT_RING( INST_PARSER_CLIENT | INST_OP_FLUSH | INST_FLUSH_MAP_CACHE ); OUT_RING( GFX_CMD_CONTEXT_SEL | CS_UPDATE_USE | CS_USE_CTX0 ); - OUT_RING( INST_PARSER_CLIENT | INST_OP_FLUSH ); + OUT_RING( INST_PARSER_CLIENT | INST_OP_FLUSH | INST_FLUSH_MAP_CACHE); OUT_RING( 0 ); diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c index b64cd6266..fbe79e877 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c @@ -114,12 +114,12 @@ I810InitVisualConfigs(ScreenPtr pScreen) pConfigs[0].vid = -1; pConfigs[0].class = -1; pConfigs[0].rgba = TRUE; - pConfigs[0].redSize = 8; - pConfigs[0].greenSize = 8; - pConfigs[0].blueSize = 8; - pConfigs[0].redMask = 0x00FF0000; - pConfigs[0].greenMask = 0x0000FF00; - pConfigs[0].blueMask = 0x000000FF; + pConfigs[0].redSize = 5; + pConfigs[0].greenSize = 6; + pConfigs[0].blueSize = 5; + pConfigs[0].redMask = 0x0000F800; + pConfigs[0].greenMask = 0x000007E0; + pConfigs[0].blueMask = 0x0000001F; pConfigs[0].alphaMask = 0; pConfigs[0].accumRedSize = 0; pConfigs[0].accumGreenSize = 0; @@ -128,7 +128,7 @@ I810InitVisualConfigs(ScreenPtr pScreen) pConfigs[0].doubleBuffer = FALSE; pConfigs[0].stereo = FALSE; pConfigs[0].bufferSize = 16; - pConfigs[0].depthSize = 0; + pConfigs[0].depthSize = 16; pConfigs[0].stencilSize = 0; pConfigs[0].auxBuffers = 0; pConfigs[0].level = 0; @@ -143,12 +143,12 @@ I810InitVisualConfigs(ScreenPtr pScreen) pConfigs[1].vid = -1; pConfigs[1].class = -1; pConfigs[1].rgba = TRUE; - pConfigs[1].redSize = 8; - pConfigs[1].greenSize = 8; - pConfigs[1].blueSize = 8; - pConfigs[1].redMask = 0x00FF0000; - pConfigs[1].greenMask = 0x0000FF00; - pConfigs[1].blueMask = 0x000000FF; + pConfigs[1].redSize = 5; + pConfigs[1].greenSize = 6; + pConfigs[1].blueSize = 5; + pConfigs[1].redMask = 0x0000F800; + pConfigs[1].greenMask = 0x000007E0; + pConfigs[1].blueMask = 0x0000001F; pConfigs[1].alphaMask = 0; pConfigs[1].accumRedSize = 0; pConfigs[1].accumGreenSize = 0; @@ -172,12 +172,12 @@ I810InitVisualConfigs(ScreenPtr pScreen) pConfigs[2].vid = -1; pConfigs[2].class = -1; pConfigs[2].rgba = TRUE; - pConfigs[2].redSize = 8; - pConfigs[2].greenSize = 8; - pConfigs[2].blueSize = 8; - pConfigs[2].redMask = 0x00FF0000; - pConfigs[2].greenMask = 0x0000FF00; - pConfigs[2].blueMask = 0x000000FF; + pConfigs[2].redSize = 5; + pConfigs[2].greenSize = 6; + pConfigs[2].blueSize = 5; + pConfigs[2].redMask = 0x0000F800; + pConfigs[2].greenMask = 0x000007E0; + pConfigs[2].blueMask = 0x0000001F; pConfigs[2].alphaMask = 0; pConfigs[2].accumRedSize = 0; pConfigs[2].accumGreenSize = 0; @@ -186,7 +186,7 @@ I810InitVisualConfigs(ScreenPtr pScreen) pConfigs[2].doubleBuffer = TRUE; pConfigs[2].stereo = FALSE; pConfigs[2].bufferSize = 16; - pConfigs[2].depthSize = 0; + pConfigs[2].depthSize = 16; pConfigs[2].stencilSize = 0; pConfigs[2].auxBuffers = 0; pConfigs[2].level = 0; @@ -201,12 +201,12 @@ I810InitVisualConfigs(ScreenPtr pScreen) pConfigs[3].vid = -1; pConfigs[3].class = -1; pConfigs[3].rgba = TRUE; - pConfigs[3].redSize = 8; - pConfigs[3].greenSize = 8; - pConfigs[3].blueSize = 8; - pConfigs[3].redMask = 0x00FF0000; - pConfigs[3].greenMask = 0x0000FF00; - pConfigs[3].blueMask = 0x000000FF; + pConfigs[3].redSize = 5; + pConfigs[3].greenSize = 6; + pConfigs[3].blueSize = 5; + pConfigs[3].redMask = 0x0000F800; + pConfigs[3].greenMask = 0x000007E0; + pConfigs[3].blueMask = 0x0000001F; pConfigs[3].alphaMask = 0; pConfigs[3].accumRedSize = 0; pConfigs[3].accumGreenSize = 0; @@ -269,6 +269,10 @@ Bool I810DRIScreenInit(ScreenPtr pScreen) return FALSE; } + +/* pDRIInfo->wrap.ValidateTree = 0; */ +/* pDRIInfo->wrap.PostValidateTree = 0; */ + pI810->pDRIInfo = pDRIInfo; pI810->LockHeld = 0; @@ -429,7 +433,9 @@ Bool I810DRIScreenInit(ScreenPtr pScreen) if (dcacheHandle != 0) { /* The Z buffer is always aligned to the 48 mb mark in the aperture */ - ErrorF("dcacheHandle : %p, aligned to : %lx\n", dcacheHandle, 48*1024*1024); + ErrorF("dcacheHandle : %p, aligned to : %lx\n", + dcacheHandle, 48*1024*1024); + if(drmAgpBind(pI810->drmSubFD, dcacheHandle, 48*1024*1024) == 0) { xf86memset (&pI810->DcacheMem, 0, sizeof(I810MemRange)); xf86DrvMsg(pScrn->scrnIndex, X_INFO, @@ -437,8 +443,12 @@ Bool I810DRIScreenInit(ScreenPtr pScreen) pI810->DcacheMem.Start = 48*1024*1024; pI810->DcacheMem.Size = 1024 * 4096; pI810->DcacheMem.End = pI810->DcacheMem.Start + pI810->DcacheMem.Size; - if(I810AllocLow(&(pI810->DepthBuffer), &(pI810->DcacheMem), back_size) == FALSE) { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Depth buffer allocation failed\n"); + if (!I810AllocLow(&(pI810->DepthBuffer), + &(pI810->DcacheMem), + back_size)) + { + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Depth buffer allocation failed\n"); DRICloseScreen(pScreen); return FALSE; } @@ -451,8 +461,7 @@ Bool I810DRIScreenInit(ScreenPtr pScreen) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "GART: no dcache memory found\n"); } - agpHandle = drmAgpAlloc(pI810->drmSubFD, back_size, 0, - NULL); + agpHandle = drmAgpAlloc(pI810->drmSubFD, back_size, 0, NULL); pI810->backHandle = agpHandle; if(agpHandle != 0) { @@ -464,7 +473,8 @@ Bool I810DRIScreenInit(ScreenPtr pScreen) pI810->BackBuffer.Start = 56*1024*1024; pI810->BackBuffer.Size = back_size; - pI810->BackBuffer.End = pI810->BackBuffer.Start + pI810->BackBuffer.Size; + pI810->BackBuffer.End = (pI810->BackBuffer.Start + + pI810->BackBuffer.Size); } else { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Unable to bind backbuffer\n"); DRICloseScreen(pScreen); @@ -484,16 +494,18 @@ Bool I810DRIScreenInit(ScreenPtr pScreen) pI810->zHandle = agpHandle; if(agpHandle != 0) { - ErrorF("agpHandle : %p, aligned to : %lx\n", dcacheHandle, 48*1024*1024); + ErrorF("agpHandle : %p, aligned to : %lx\n", dcacheHandle, + 48*1024*1024); if(drmAgpBind(pI810->drmSubFD, agpHandle, 48*1024*1024) == 0) { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "Bound depthbuffer memory\n"); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Bound depthbuffer memory\n"); pI810->DepthBuffer.Start = 48*1024*1024; pI810->DepthBuffer.Size = back_size; - pI810->DepthBuffer.End = pI810->DepthBuffer.Start + pI810->DepthBuffer.Size; + pI810->DepthBuffer.End = (pI810->DepthBuffer.Start + + pI810->DepthBuffer.Size); } else { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Unable to bind depthbuffer\n"); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, + "Unable to bind depthbuffer\n"); DRICloseScreen(pScreen); return FALSE; } diff --git a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c index 7939d1001..bb36a31d4 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c @@ -1567,7 +1567,7 @@ I810AllocateFront(ScrnInfoPtr pScrn) { pScrn->virtualX); xf86memset( &(pI810->LpRing), 0, sizeof( I810RingBuffer ) ); - if(I810AllocLow( &(pI810->LpRing.mem), &(pI810->SysMem), 4*4096 )) { + if(I810AllocLow( &(pI810->LpRing.mem), &(pI810->SysMem), 16*4096 )) { if (I810_DEBUG & DEBUG_VERBOSE_MEMORY) ErrorF( "ring buffer at local %lx\n", @@ -1751,7 +1751,6 @@ I810ScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) { pScrn->virtualX, pScrn->virtualY); - if (!xf86InitFBManager(pScreen, &(pI810->FbMemBox))) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to init memory manager\n"); |