--- glide3x-20010309/h3/minihwc/linhwc.c.dri.orig 2004-04-26 00:29:32.000000000 +0200 +++ glide3x-20010309/h3/minihwc/linhwc.c.dri 2004-04-27 23:05:40.677616968 +0200 @@ -304,6 +304,65 @@ return FXTRUE; } +static FxU32 +hwcBufferLfbAddr(const hwcBoardInfo *bInfo, FxU32 physAddress) +{ + FxU32 retVal = 0x00UL; + + FxU32 tileAddress; + FxU32 tileNumber; + FxU32 tileOffset; + FxU32 tileXOffset; + FxU32 tileScanline; + FxU32 tileRow; + FxU32 lfbAddress; + FxU32 lfbYOffset; + /* + * This is the tile aperture stride. It is always 4096 for V3. + */ + FxU32 lfbBufferStride = 0x1000; + + if (bInfo->vidInfo.tiled) { + GDBG_INFO(80, "\tphysAddress: 0x%08lx\n",physAddress); + + /* Compute address in tile space */ + tileAddress = physAddress - driInfo.backOffset; + GDBG_INFO(80, "\ttileAddress: 0x%08lx\n",tileAddress); + + /* Compute tile number we're in (each tile is 4K bytes) */ + tileNumber = tileAddress >> 12; + GDBG_INFO(80, "\ttileNumber: 0x%08lx (%d)\n",tileNumber,tileNumber); + + /* Compute base tile row we're in */ + tileRow = tileNumber / bInfo->buffInfo.bufStrideInTiles; + GDBG_INFO(80, "\ttileRow: %d (stride = %d)\n",tileNumber,bInfo->buffInfo.bufStrideInTiles); + + /* Compute offset within the tile */ + tileOffset = tileAddress - (tileNumber << 12); + GDBG_INFO(80, "\ttileOffset: 0x%08lx\n",tileOffset); + + /* Compute scanline within the tile */ + tileScanline = tileOffset >> 7; + GDBG_INFO(80, "\ttileScanline: 0x%08lx\n",tileScanline); + + /* Compute tile X offset within the row */ + tileXOffset = tileNumber - (tileRow * bInfo->buffInfo.bufStrideInTiles); + GDBG_INFO(80, "\ttileXOffset: %d\n",tileXOffset); + + /* Compute Y offset in LFB space */ + lfbYOffset = (tileRow * 32 + tileScanline); + + /* Compute LFB address of tile start */ + lfbAddress = driInfo.backOffset + lfbYOffset * lfbBufferStride + tileXOffset * 128; + + GDBG_INFO(80, "\tlfbAddress: %08lx\n", lfbAddress); + retVal = lfbAddress; + } else { + retVal = physAddress; + } + return retVal; +} + FxBool hwcAllocBuffers(hwcBoardInfo *bInfo, FxU32 nColBuffers, FxU32 nAuxBuffers) { @@ -620,64 +679,7 @@ * boundaries will cause the tiled lfb access to be off by a page so * we add in the width of a page (HWC_TILED_BUFFER_X_ADJUST) here. */ -static FxU32 -hwcBufferLfbAddr(const hwcBoardInfo *bInfo, FxU32 physAddress) -{ - FxU32 retVal = 0x00UL; - - FxU32 tileAddress; - FxU32 tileNumber; - FxU32 tileOffset; - FxU32 tileXOffset; - FxU32 tileScanline; - FxU32 tileRow; - FxU32 lfbAddress; - FxU32 lfbYOffset; - /* - * This is the tile aperture stride. It is always 4096 for V3. - */ - FxU32 lfbBufferStride = 0x1000; - - if (bInfo->vidInfo.tiled) { - GDBG_INFO(80, "\tphysAddress: 0x%08lx\n",physAddress); - - /* Compute address in tile space */ - tileAddress = physAddress - driInfo.backOffset; - GDBG_INFO(80, "\ttileAddress: 0x%08lx\n",tileAddress); - - /* Compute tile number we're in (each tile is 4K bytes) */ - tileNumber = tileAddress >> 12; - GDBG_INFO(80, "\ttileNumber: 0x%08lx (%d)\n",tileNumber,tileNumber); - /* Compute base tile row we're in */ - tileRow = tileNumber / bInfo->buffInfo.bufStrideInTiles; - GDBG_INFO(80, "\ttileRow: %d (stride = %d)\n",tileNumber,bInfo->buffInfo.bufStrideInTiles); - - /* Compute offset within the tile */ - tileOffset = tileAddress - (tileNumber << 12); - GDBG_INFO(80, "\ttileOffset: 0x%08lx\n",tileOffset); - - /* Compute scanline within the tile */ - tileScanline = tileOffset >> 7; - GDBG_INFO(80, "\ttileScanline: 0x%08lx\n",tileScanline); - - /* Compute tile X offset within the row */ - tileXOffset = tileNumber - (tileRow * bInfo->buffInfo.bufStrideInTiles); - GDBG_INFO(80, "\ttileXOffset: %d\n",tileXOffset); - - /* Compute Y offset in LFB space */ - lfbYOffset = (tileRow * 32 + tileScanline); - - /* Compute LFB address of tile start */ - lfbAddress = driInfo.backOffset + lfbYOffset * lfbBufferStride + tileXOffset * 128; - - GDBG_INFO(80, "\tlfbAddress: %08lx\n", lfbAddress); - retVal = lfbAddress; - } else { - retVal = physAddress; - } - return retVal; -} FxU32 hwcInitAGPFifo(hwcBoardInfo *bInfo, FxBool enableHoleCounting) { --- glide3x-20010309/h3/glide3/src/gaa.c.org 2006-12-23 11:51:47.967058500 +0100 +++ glide3x-20010309/h3/glide3/src/gaa.c 2006-12-23 12:04:56.144316500 +0100 @@ -614,7 +614,7 @@ e = pointers; if (mode) e = *(float **)e; - (float *)pointers += stride; + pointers += stride; ptX = FARRAY(e, gc->state.vData.vertexInfo.offset); ptY = FARRAY(e, gc->state.vData.vertexInfo.offset+4); @@ -715,7 +715,7 @@ if (mode) e = *(float **)e; oow = 1.0f / FARRAY(e, gc->state.vData.wInfo.offset); - (float *)pointers += stride; + pointers += stride; ptX = FARRAY(e, gc->state.vData.vertexInfo.offset) *oow*gc->state.Viewport.hwidth+gc->state.Viewport.ox; @@ -837,9 +837,9 @@ v1 = *(float **)v1; v2 = *(float **)v2; } - (float *)pointers += stride; + pointers += stride; if (ltype == GR_LINES) - (float *)pointers += stride; + pointers += stride; /* draw from low Y to high Y */ if (FARRAY(v2, gc->state.vData.vertexInfo.offset+4) < FARRAY(v1, gc->state.vData.vertexInfo.offset+4)) { @@ -1018,9 +1018,9 @@ v1 = *(float **)v1; v2 = *(float **)v2; } - (float *)pointers += stride; + pointers += stride; if (ltype == GR_LINES) - (float *)pointers += stride; + pointers += stride; owa = oowa = 1.0f / FARRAY(v1, gc->state.vData.wInfo.offset); owb = oowb = 1.0f / FARRAY(v2, gc->state.vData.wInfo.offset); } @@ -1032,7 +1032,7 @@ v1 = *(float **)v1; v2 = *(float **)v2; } - (float *)pointers += stride; + pointers += stride; owb = oowb = 1.0f / FARRAY(v2, gc->state.vData.wInfo.offset); } @@ -1366,7 +1366,7 @@ b = *(float **)b; c = *(float **)c; } - (float *)pointers += stride*3; + pointers += stride*3; /* move culling test to here */ { @@ -1540,7 +1540,7 @@ b = *(float **)b; c = *(float **)c; } - (float *)pointers += stride*3; + pointers += stride*3; oowa = 1.0f / FARRAY(a, gc->state.vData.wInfo.offset); oowb = 1.0f / FARRAY(b, gc->state.vData.wInfo.offset); oowc = 1.0f / FARRAY(c, gc->state.vData.wInfo.offset); @@ -1705,7 +1705,7 @@ if (type == kSetupFan) { v[0] = (mode == 0) ? pointers : *(float **)pointers; while (sCount--) { - (float *)pointers += stride; + pointers += stride; if (mode) { v[1] = *(float **)pointers; v[2] = *((float **)pointers+1); @@ -1747,7 +1747,7 @@ _grAADrawTriangles(1, type, 3, v); else _grAAVpDrawTriangles(1, type, 3, v); - (float *)pointers += stride; + pointers += stride; flip = ~flip; } flip = ~flip; --- glide3x-20010309/h3/glide3/src/gdraw.c.org 2006-12-23 12:08:15.640784250 +0100 +++ glide3x-20010309/h3/glide3/src/gdraw.c 2006-12-23 12:09:03.163754250 +0100 @@ -403,7 +403,7 @@ vPtr = pointers; if (mode) vPtr = *(float **)vPtr; - (float *)pointers += stride; + pointers += stride; GDBG_INFO_MORE(gc->myLevel, "(%f %f)\n", FARRAY(vPtr,gc->state.vData.vertexInfo.offset), @@ -492,7 +492,7 @@ if (mode) vPtr = *(float **)vPtr; oow = 1.0f / FARRAY(vPtr, gc->state.vData.wInfo.offset); - (float *)pointers += stride; + pointers += stride; { FxU32 x, y; @@ -617,9 +617,9 @@ a = *(float **)a; b = *(float **)b; } - (float *)pointers += stride; + pointers += stride; if (ltype == GR_LINES) - (float *)pointers += stride; + pointers += stride; /* ** compute absolute deltas and draw from low Y to high Y @@ -779,7 +779,7 @@ a = *(float **)a; b = *(float **)b; } - (float *)pointers += stride; + pointers += stride; owa = oowa = 1.0f / FARRAY(a, gc->state.vData.wInfo.offset); owb = oowb = 1.0f / FARRAY(b, gc->state.vData.wInfo.offset); pointers += stride; @@ -782,7 +782,7 @@ (float *)pointers += stride; owa = oowa = 1.0f / FARRAY(a, gc->state.vData.wInfo.offset); owb = oowb = 1.0f / FARRAY(b, gc->state.vData.wInfo.offset); - (float *)pointers += stride; + pointers += stride; } else { owa = oowa = oowb; @@ -792,7 +792,7 @@ a = *(float **)a; b = *(float **)b; } - (float *)pointers += stride; + pointers += stride; owb = oowb = 1.0f / FARRAY(b, gc->state.vData.wInfo.offset); } fay = tmp1 = FARRAY(a, gc->state.vData.vertexInfo.offset+4) @@ -944,7 +944,7 @@ vPtr = pointers; if (mode) vPtr = *(float **)vPtr; - (float *)pointers += stride; + pointers += stride; i = gc->tsuDataList[dataElem]; @@ -984,7 +984,7 @@ *oow*gc->state.Viewport.hwidth + gc->state.Viewport.ox); TRI_SETF(FARRAY(vPtr, 4) *oow*gc->state.Viewport.hheight + gc->state.Viewport.oy); - (float *)pointers += stride; + pointers += stride; TRI_VP_SETFS(vPtr,oow); } --- glide3x-20010309/h3/glide3/src/gstrip.c.org 2006-12-23 12:13:50.669722250 +0100 +++ glide3x-20010309/h3/glide3/src/gstrip.c 2006-12-23 12:14:04.282573000 +0100 @@ -188,7 +188,7 @@ vPtr = pointers; if (mode) vPtr = *(float **)vPtr; - (float *)pointers += stride; + pointers += stride; TRI_SETF(FARRAY(vPtr, 0)); dataElem = 0; @@ -228,7 +228,7 @@ *oow*gc->state.Viewport.hwidth + gc->state.Viewport.ox); TRI_SETF(FARRAY(vPtr, 4) *oow*gc->state.Viewport.hheight + gc->state.Viewport.oy); - (float *)pointers += stride; + pointers += stride; TRI_VP_SETFS(vPtr, oow); } --- glide3x-20010309/h3/glide3/src/distrip.c.org 2006-12-23 12:18:36.047557250 +0100 +++ glide3x-20010309/h3/glide3/src/distrip.c 2006-12-23 12:18:46.088184750 +0100 @@ -450,7 +450,7 @@ else { while ((int)Count >= 3) { grDrawTriangle(*(float **)pointers, *((float **)pointers+1), *((float **)pointers+2)); - (float *)pointers += 3; + pointers += 3; Count -= 3; } }