]> git.pld-linux.org Git - packages/Glide_V3-DRI.git/blame - glide-gcc34.patch
- rediffed
[packages/Glide_V3-DRI.git] / glide-gcc34.patch
CommitLineData
3b2270de 1--- glide3x-20010309/h3/minihwc/linhwc.c.dri.orig 2004-04-26 00:29:32.000000000 +0200
2+++ glide3x-20010309/h3/minihwc/linhwc.c.dri 2004-04-27 23:05:40.677616968 +0200
3@@ -304,6 +304,65 @@
4 return FXTRUE;
5 }
6
7+static FxU32
8+hwcBufferLfbAddr(const hwcBoardInfo *bInfo, FxU32 physAddress)
9+{
10+ FxU32 retVal = 0x00UL;
11+
12+ FxU32 tileAddress;
13+ FxU32 tileNumber;
14+ FxU32 tileOffset;
15+ FxU32 tileXOffset;
16+ FxU32 tileScanline;
17+ FxU32 tileRow;
18+ FxU32 lfbAddress;
19+ FxU32 lfbYOffset;
20+ /*
21+ * This is the tile aperture stride. It is always 4096 for V3.
22+ */
23+ FxU32 lfbBufferStride = 0x1000;
24+
25+ if (bInfo->vidInfo.tiled) {
26+ GDBG_INFO(80, "\tphysAddress: 0x%08lx\n",physAddress);
27+
28+ /* Compute address in tile space */
29+ tileAddress = physAddress - driInfo.backOffset;
30+ GDBG_INFO(80, "\ttileAddress: 0x%08lx\n",tileAddress);
31+
32+ /* Compute tile number we're in (each tile is 4K bytes) */
33+ tileNumber = tileAddress >> 12;
34+ GDBG_INFO(80, "\ttileNumber: 0x%08lx (%d)\n",tileNumber,tileNumber);
35+
36+ /* Compute base tile row we're in */
37+ tileRow = tileNumber / bInfo->buffInfo.bufStrideInTiles;
38+ GDBG_INFO(80, "\ttileRow: %d (stride = %d)\n",tileNumber,bInfo->buffInfo.bufStrideInTiles);
39+
40+ /* Compute offset within the tile */
41+ tileOffset = tileAddress - (tileNumber << 12);
42+ GDBG_INFO(80, "\ttileOffset: 0x%08lx\n",tileOffset);
43+
44+ /* Compute scanline within the tile */
45+ tileScanline = tileOffset >> 7;
46+ GDBG_INFO(80, "\ttileScanline: 0x%08lx\n",tileScanline);
47+
48+ /* Compute tile X offset within the row */
49+ tileXOffset = tileNumber - (tileRow * bInfo->buffInfo.bufStrideInTiles);
50+ GDBG_INFO(80, "\ttileXOffset: %d\n",tileXOffset);
51+
52+ /* Compute Y offset in LFB space */
53+ lfbYOffset = (tileRow * 32 + tileScanline);
54+
55+ /* Compute LFB address of tile start */
56+ lfbAddress = driInfo.backOffset + lfbYOffset * lfbBufferStride + tileXOffset * 128;
57+
58+ GDBG_INFO(80, "\tlfbAddress: %08lx\n", lfbAddress);
59+ retVal = lfbAddress;
60+ } else {
61+ retVal = physAddress;
62+ }
63+ return retVal;
64+}
65+
66 FxBool
67 hwcAllocBuffers(hwcBoardInfo *bInfo, FxU32 nColBuffers, FxU32 nAuxBuffers)
68 {
69@@ -620,64 +679,7 @@
70 * boundaries will cause the tiled lfb access to be off by a page so
71 * we add in the width of a page (HWC_TILED_BUFFER_X_ADJUST) here.
72 */
73-static FxU32
74-hwcBufferLfbAddr(const hwcBoardInfo *bInfo, FxU32 physAddress)
75-{
76- FxU32 retVal = 0x00UL;
77-
78- FxU32 tileAddress;
79- FxU32 tileNumber;
80- FxU32 tileOffset;
81- FxU32 tileXOffset;
82- FxU32 tileScanline;
83- FxU32 tileRow;
84- FxU32 lfbAddress;
85- FxU32 lfbYOffset;
86- /*
87- * This is the tile aperture stride. It is always 4096 for V3.
88- */
89- FxU32 lfbBufferStride = 0x1000;
90-
91- if (bInfo->vidInfo.tiled) {
92- GDBG_INFO(80, "\tphysAddress: 0x%08lx\n",physAddress);
93-
94- /* Compute address in tile space */
95- tileAddress = physAddress - driInfo.backOffset;
96- GDBG_INFO(80, "\ttileAddress: 0x%08lx\n",tileAddress);
97-
98- /* Compute tile number we're in (each tile is 4K bytes) */
99- tileNumber = tileAddress >> 12;
100- GDBG_INFO(80, "\ttileNumber: 0x%08lx (%d)\n",tileNumber,tileNumber);
101
102- /* Compute base tile row we're in */
103- tileRow = tileNumber / bInfo->buffInfo.bufStrideInTiles;
104- GDBG_INFO(80, "\ttileRow: %d (stride = %d)\n",tileNumber,bInfo->buffInfo.bufStrideInTiles);
105-
106- /* Compute offset within the tile */
107- tileOffset = tileAddress - (tileNumber << 12);
108- GDBG_INFO(80, "\ttileOffset: 0x%08lx\n",tileOffset);
109-
110- /* Compute scanline within the tile */
111- tileScanline = tileOffset >> 7;
112- GDBG_INFO(80, "\ttileScanline: 0x%08lx\n",tileScanline);
113-
114- /* Compute tile X offset within the row */
115- tileXOffset = tileNumber - (tileRow * bInfo->buffInfo.bufStrideInTiles);
116- GDBG_INFO(80, "\ttileXOffset: %d\n",tileXOffset);
117-
118- /* Compute Y offset in LFB space */
119- lfbYOffset = (tileRow * 32 + tileScanline);
120-
121- /* Compute LFB address of tile start */
122- lfbAddress = driInfo.backOffset + lfbYOffset * lfbBufferStride + tileXOffset * 128;
123-
124- GDBG_INFO(80, "\tlfbAddress: %08lx\n", lfbAddress);
125- retVal = lfbAddress;
126- } else {
127- retVal = physAddress;
128- }
129- return retVal;
130-}
131 FxU32
132 hwcInitAGPFifo(hwcBoardInfo *bInfo, FxBool enableHoleCounting)
133 {
This page took 0.062014 seconds and 4 git commands to generate.