]>
Commit | Line | Data |
---|---|---|
088a79c9 | 1 | diff -ur xc.orig/programs/Xserver/hw/xfree86/common/compiler.h xc/programs/Xserver/hw/xfree86/common/compiler.h |
2 | --- xc.orig/programs/Xserver/hw/xfree86/common/compiler.h Fri Dec 8 22:58:34 2000 | |
3 | +++ xc/programs/Xserver/hw/xfree86/common/compiler.h Sun Mar 18 17:23:33 2001 | |
4 | @@ -1514,19 +1514,17 @@ | |
5 | /* Changed to kill noise generated by gcc's -Wcast-align */ | |
6 | #define MMIO_IN8(base, offset) (*xf86ReadMmio8)(base, offset) | |
7 | #define MMIO_IN16(base, offset) (*xf86ReadMmio16)(base, offset) | |
8 | -# if defined (JENSEN_SUPPORT) | |
9 | #define MMIO_IN32(base, offset) (*xf86ReadMmio32)(base, offset) | |
10 | +# if defined (JENSEN_SUPPORT) | |
11 | #define MMIO_OUT32(base, offset, val) \ | |
12 | (*xf86WriteMmio32)((CARD32)(val), base, offset) | |
13 | #define MMIO_ONB32(base, offset, val) \ | |
14 | (*xf86WriteMmioNB32)((CARD32)(val), base, offset) | |
15 | # else | |
16 | -#define MMIO_IN32(base, offset) \ | |
17 | - *(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset)) | |
18 | #define MMIO_OUT32(base, offset, val) \ | |
19 | do { \ | |
20 | - *(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset)) = (val); \ | |
21 | write_mem_barrier(); \ | |
22 | + *(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset)) = (val); \ | |
23 | } while (0) | |
24 | #define MMIO_ONB32(base, offset, val) \ | |
25 | *(volatile CARD32 *)(void *)(((CARD8*)(base)) + (offset)) = (val) | |
26 | diff -ur xc.orig/programs/Xserver/hw/xfree86/drivers/ati/r128_accel.c xc/programs/Xserver/hw/xfree86/drivers/ati/r128_accel.c | |
27 | --- xc.orig/programs/Xserver/hw/xfree86/drivers/ati/r128_accel.c Mon Dec 4 19:55:22 2000 | |
28 | +++ xc/programs/Xserver/hw/xfree86/drivers/ati/r128_accel.c Sun Apr 1 20:51:03 2001 | |
29 | @@ -838,6 +838,7 @@ | |
30 | if (info->scanline_direct) return; | |
31 | --info->scanline_h; | |
32 | while (left) { | |
33 | + write_mem_barrier(); | |
34 | if (left <= 8) { | |
35 | /* Last scanline - finish write to DATA_LAST */ | |
36 | if (info->scanline_h == 0) { | |
37 | @@ -980,6 +981,7 @@ | |
38 | if (info->scanline_direct) return; | |
39 | --info->scanline_h; | |
40 | while (left) { | |
41 | + write_mem_barrier(); | |
42 | if (left <= 8) { | |
43 | /* Last scanline - finish write to DATA_LAST */ | |
44 | if (info->scanline_h == 0) { | |
45 | diff -ur xc.orig/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c | |
46 | --- xc.orig/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c Sat Mar 17 17:57:15 2001 | |
47 | +++ xc/programs/Xserver/hw/xfree86/drivers/ati/r128_driver.c Sun Mar 18 16:51:29 2001 | |
48 | @@ -1016,8 +1016,8 @@ | |
49 | if (!xf86LoadSubModule(pScrn, "ddc")) return FALSE; | |
50 | xf86LoaderReqSymLists(ddcSymbols, NULL); | |
51 | ||
52 | -#if defined(__powerpc__) | |
53 | - /* Int10 is broken on PPC */ | |
54 | +#if defined(__powerpc__) || defined(__alpha__) | |
55 | + /* Int10 is broken on PPC and some Alphas */ | |
56 | return TRUE; | |
57 | #else | |
58 | if (xf86LoadSubModule(pScrn, "vbe")) { | |
59 | @@ -1156,7 +1156,8 @@ | |
60 | static Bool R128PreInitInt10(ScrnInfoPtr pScrn) | |
61 | { | |
62 | R128InfoPtr info = R128PTR(pScrn); | |
63 | -#if 1 | |
64 | +#if 1 && !defined(__alpha__) | |
65 | + /* int10 is broken on some Alphas */ | |
66 | if (xf86LoadSubModule(pScrn, "int10")) { | |
67 | xf86Int10InfoPtr pInt; | |
68 | xf86DrvMsg(pScrn->scrnIndex,X_INFO,"initializing int10\n"); | |
69 | diff -ur xc.orig/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c | |
70 | --- xc.orig/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c Wed Nov 29 11:42:11 2000 | |
71 | +++ xc/programs/Xserver/hw/xfree86/drivers/ati/radeon_accel.c Fri Mar 23 16:20:46 2001 | |
72 | @@ -585,7 +585,13 @@ | |
73 | info->scanline_h = h; | |
74 | info->scanline_words = (w + 31) >> 5; | |
75 | ||
76 | - if ((info->scanline_words * h) <= 9) { | |
77 | +#ifdef __alpha__ | |
78 | + /* always indirect for Alpha */ | |
79 | + if (0) | |
80 | +#else | |
81 | + if ((info->scanline_words * h) <= 9) | |
82 | +#endif | |
83 | + { | |
84 | /* Turn on direct for less than 9 dword colour expansion */ | |
85 | info->scratch_buffer[0] | |
86 | = (unsigned char *)(ADDRREG(RADEON_HOST_DATA_LAST) | |
87 | @@ -621,6 +627,7 @@ | |
88 | if (info->scanline_direct) return; | |
89 | --info->scanline_h; | |
90 | while (left) { | |
91 | + write_mem_barrier(); | |
92 | if (left <= 8) { | |
93 | /* Last scanline - finish write to DATA_LAST */ | |
94 | if (info->scanline_h == 0) { | |
95 | @@ -699,7 +706,13 @@ | |
96 | info->scanline_h = h; | |
97 | info->scanline_words = (w * info->scanline_bpp + 31) >> 5; | |
98 | ||
99 | - if ((info->scanline_words * h) <= 9) { | |
100 | +#ifdef __alpha__ | |
101 | + /* always indirect for Alpha */ | |
102 | + if (0) | |
103 | +#else | |
104 | + if ((info->scanline_words * h) <= 9) | |
105 | +#endif | |
106 | + { | |
107 | /* Turn on direct for less than 9 dword colour expansion */ | |
108 | info->scratch_buffer[0] | |
109 | = (unsigned char *)(ADDRREG(RADEON_HOST_DATA_LAST) | |
110 | @@ -735,6 +748,7 @@ | |
111 | if (info->scanline_direct) return; | |
112 | --info->scanline_h; | |
113 | while (left) { | |
114 | + write_mem_barrier(); | |
115 | if (left <= 8) { | |
116 | /* Last scanline - finish write to DATA_LAST */ | |
117 | if (info->scanline_h == 0) { | |
118 | diff -ur xc.orig/programs/Xserver/hw/xfree86/drivers/glint/dualmx_accel.c xc/programs/Xserver/hw/xfree86/drivers/glint/dualmx_accel.c | |
119 | --- xc.orig/programs/Xserver/hw/xfree86/drivers/glint/dualmx_accel.c Sat Jun 24 14:19:54 2000 | |
120 | +++ xc/programs/Xserver/hw/xfree86/drivers/glint/dualmx_accel.c Sun Mar 18 16:53:54 2001 | |
121 | @@ -324,28 +324,6 @@ | |
122 | GLINT_WRITE_REG(d<<16,dY); | |
123 | } | |
124 | ||
125 | -static void MoveDWORDS( | |
126 | - register CARD32* dest, | |
127 | - register CARD32* src, | |
128 | - register int dwords ) | |
129 | -{ | |
130 | - while(dwords & ~0x03) { | |
131 | - *dest = *src; | |
132 | - *(dest + 1) = *(src + 1); | |
133 | - *(dest + 2) = *(src + 2); | |
134 | - *(dest + 3) = *(src + 3); | |
135 | - src += 4; | |
136 | - dest += 4; | |
137 | - dwords -= 4; | |
138 | - } | |
139 | - if (!dwords) return; | |
140 | - *dest = *src; | |
141 | - if (dwords == 1) return; | |
142 | - *(dest + 1) = *(src + 1); | |
143 | - if (dwords == 2) return; | |
144 | - *(dest + 2) = *(src + 2); | |
145 | -} | |
146 | - | |
147 | #define Sync_tag 0x188 | |
148 | ||
149 | static void | |
150 | @@ -572,7 +550,8 @@ | |
151 | while (dwords >= infoRec->ColorExpandRange) { | |
152 | GLINT_WAIT(infoRec->ColorExpandRange); | |
153 | GLINT_WRITE_REG((infoRec->ColorExpandRange - 2)<<16 | 0x0D, OutputFIFO); | |
154 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), src, | |
155 | + GLINT_MoveDWORDS( | |
156 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), src, | |
157 | infoRec->ColorExpandRange - 1); | |
158 | dwords -= (infoRec->ColorExpandRange - 1); | |
159 | src += (infoRec->ColorExpandRange - 1); | |
160 | @@ -580,7 +559,8 @@ | |
161 | if (dwords) { | |
162 | GLINT_WAIT(dwords); | |
163 | GLINT_WRITE_REG((dwords - 1)<<16 | 0x0D, OutputFIFO); | |
164 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), src,dwords); | |
165 | + GLINT_MoveDWORDS( | |
166 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), src,dwords); | |
167 | } | |
168 | pGlint->cpucount += 1; | |
169 | #if 0 | |
170 | @@ -887,7 +867,8 @@ | |
171 | /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */ | |
172 | GLINT_WRITE_REG(((infoRec->ColorExpandRange - 2) << 16) | (0x15 << 4) | | |
173 | 0x05, OutputFIFO); | |
174 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
175 | + GLINT_MoveDWORDS( | |
176 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
177 | (CARD32*)srcp, infoRec->ColorExpandRange - 1); | |
178 | count -= infoRec->ColorExpandRange - 1; | |
179 | srcp += infoRec->ColorExpandRange - 1; | |
180 | @@ -897,7 +878,8 @@ | |
181 | /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */ | |
182 | GLINT_WRITE_REG(((count - 1) << 16) | (0x15 << 4) | | |
183 | 0x05, OutputFIFO); | |
184 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
185 | + GLINT_MoveDWORDS( | |
186 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
187 | (CARD32*)srcp, count); | |
188 | } | |
189 | src += srcwidth; | |
190 | diff -ur xc.orig/programs/Xserver/hw/xfree86/drivers/glint/glint.h xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h | |
191 | --- xc.orig/programs/Xserver/hw/xfree86/drivers/glint/glint.h Wed Nov 29 11:42:16 2000 | |
192 | +++ xc/programs/Xserver/hw/xfree86/drivers/glint/glint.h Sun Mar 18 21:36:41 2001 | |
193 | @@ -120,6 +120,7 @@ | |
194 | Bool UseBlockWrite; | |
195 | Bool UseFireGL3000; | |
196 | Bool VGAcore; | |
197 | + Bool ScanlineDirect; | |
198 | int MXFbSize; | |
199 | CARD32 rasterizerMode; | |
200 | int MinClock; | |
201 | @@ -141,6 +142,7 @@ | |
202 | DrawablePtr CurrentDrawable; | |
203 | I2CBusPtr DDCBus, VSBus; | |
204 | CARD8* XAAScanlineColorExpandBuffers[2]; | |
205 | + CARD8* ScratchBuffer; | |
206 | CARD32 RasterizerSwap; | |
207 | int PM3_Config2D; | |
208 | int PM3_Render2D; | |
209 | @@ -282,6 +284,10 @@ | |
210 | LOCO *colors, VisualPtr pVisual); | |
211 | void Permedia2LoadPalette16(ScrnInfoPtr pScrn, int numColors, int *indices, | |
212 | LOCO *colors, VisualPtr pVisual); | |
213 | +void Permedia3LoadPalette(ScrnInfoPtr pScrn, int numColors, int *indices, | |
214 | + LOCO *colors, VisualPtr pVisual); | |
215 | +void Permedia3LoadPalette16(ScrnInfoPtr pScrn, int numColors, int *indices, | |
216 | + LOCO *colors, VisualPtr pVisual); | |
217 | void Permedia2I2CUDelay(I2CBusPtr b, int usec); | |
218 | void Permedia2I2CPutBits(I2CBusPtr b, int scl, int sda); | |
219 | void Permedia2I2CGetBits(I2CBusPtr b, int *scl, int *sda); | |
220 | @@ -314,4 +320,8 @@ | |
221 | CARD32 GLINT_VERB_READ_REG(GLINTPtr, CARD32 r, char *file, int line); | |
222 | ||
223 | void GLINTRefreshArea(ScrnInfoPtr pScrn, int num, BoxPtr pbox); | |
224 | + | |
225 | +void GLINT_MoveBYTES(CARD32* dest, unsigned char* src, int dwords); | |
226 | +void GLINT_MoveWORDS(CARD32* dest, unsigned short* src, int dwords); | |
227 | +void GLINT_MoveDWORDS(CARD32* dest, CARD32* src, int dwords); | |
228 | #endif /* _GLINT_H_ */ | |
229 | diff -ur xc.orig/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c | |
230 | --- xc.orig/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c Fri Dec 8 22:58:55 2000 | |
231 | +++ xc/programs/Xserver/hw/xfree86/drivers/glint/glint_driver.c Sun Mar 18 21:39:59 2001 | |
232 | @@ -2610,8 +2610,17 @@ | |
233 | if (!miCreateDefColormap(pScreen)) | |
234 | return FALSE; | |
235 | ||
236 | + if (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA3) { | |
237 | + if (!xf86HandleColormaps(pScreen, 256, pScrn->rgbBits, | |
238 | + (pGlint->FBDev) ? fbdevHWLoadPalette : | |
239 | + ((pScrn->depth == 16) ? Permedia3LoadPalette16:Permedia3LoadPalette), | |
240 | + NULL, | |
241 | + CMAP_RELOAD_ON_MODE_SWITCH | | |
242 | + ((pScrn->overlayFlags & OVERLAY_8_32_PLANAR) | |
243 | + ? 0 : CMAP_PALETTED_TRUECOLOR))) | |
244 | + return FALSE; | |
245 | + } else | |
246 | if ((pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA2V) || | |
247 | - (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA3) || | |
248 | (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA2) || | |
249 | (pGlint->Chipset == PCI_VENDOR_TI_CHIP_PERMEDIA2)) { | |
250 | if (!xf86HandleColormaps(pScreen, 256, pScrn->rgbBits, | |
251 | @@ -3051,16 +3060,86 @@ | |
252 | { | |
253 | if (xf86GetVerbosity() > 2) | |
254 | ErrorF("[0x%04x] <- 0x%08x (%s, %d)\n", r, v, file, line); | |
255 | +#if defined(__alpha__) | |
256 | + GLINT_WRITE_REG(v, r); | |
257 | +#else | |
258 | *(volatile CARD32 *)((char *) pGlint->IOBase + r) = v; | |
259 | +#endif | |
260 | } | |
261 | ||
262 | CARD32 | |
263 | GLINT_VERB_READ_REG(GLINTPtr pGlint, CARD32 r, char *file, int line) | |
264 | { | |
265 | - CARD32 v = *(volatile CARD32 *)((char *) pGlint->IOBase + r); | |
266 | + CARD32 v; | |
267 | ||
268 | +#if defined(__alpha__) | |
269 | + v = GLINT_READ_REG(r); | |
270 | +#else | |
271 | + v = *(volatile CARD32 *)((char *) pGlint->IOBase + r); | |
272 | +#endif | |
273 | if (xf86GetVerbosity() > 2) | |
274 | ErrorF("[0x%04x] -> 0x%08x (%s, %d)\n", r, v, file, line); | |
275 | return v; | |
276 | } | |
277 | #endif | |
278 | + | |
279 | +void GLINT_MoveBYTES( | |
280 | + register CARD32* dest, | |
281 | + register unsigned char* src, | |
282 | + register int dwords) | |
283 | +{ | |
284 | +#if defined(__alpha__) | |
285 | + write_mem_barrier(); | |
286 | +#endif | |
287 | + while(dwords) { | |
288 | + *dest = *src; | |
289 | + src += 1; | |
290 | + dest += 1; | |
291 | + dwords -= 1; | |
292 | + } | |
293 | +} | |
294 | + | |
295 | +void GLINT_MoveWORDS( | |
296 | + register CARD32* dest, | |
297 | + register unsigned short* src, | |
298 | + register int dwords) | |
299 | +{ | |
300 | +#if defined(__alpha__) | |
301 | + write_mem_barrier(); | |
302 | +#endif | |
303 | + while(dwords & ~0x01) { | |
304 | + *dest = *src; | |
305 | + *(dest + 1) = *(src + 1); | |
306 | + src += 2; | |
307 | + dest += 2; | |
308 | + dwords -= 2; | |
309 | + } | |
310 | + if(dwords) | |
311 | + *dest = *src; | |
312 | + return; | |
313 | +} | |
314 | + | |
315 | +void GLINT_MoveDWORDS( | |
316 | + register CARD32* dest, | |
317 | + register CARD32* src, | |
318 | + register int dwords) | |
319 | +{ | |
320 | +#if defined(__alpha__) | |
321 | + write_mem_barrier(); | |
322 | +#endif | |
323 | + while(dwords & ~0x03) { | |
324 | + *dest = *src; | |
325 | + *(dest + 1) = *(src + 1); | |
326 | + *(dest + 2) = *(src + 2); | |
327 | + *(dest + 3) = *(src + 3); | |
328 | + src += 4; | |
329 | + dest += 4; | |
330 | + dwords -= 4; | |
331 | + } | |
332 | + if (!dwords) return; | |
333 | + *dest = *src; | |
334 | + if (dwords == 1) return; | |
335 | + *(dest + 1) = *(src + 1); | |
336 | + if (dwords == 2) return; | |
337 | + *(dest + 2) = *(src + 2); | |
338 | +} | |
339 | diff -ur xc.orig/programs/Xserver/hw/xfree86/drivers/glint/glint_regs.h xc/programs/Xserver/hw/xfree86/drivers/glint/glint_regs.h | |
340 | --- xc.orig/programs/Xserver/hw/xfree86/drivers/glint/glint_regs.h Fri Oct 27 21:23:07 2000 | |
341 | +++ xc/programs/Xserver/hw/xfree86/drivers/glint/glint_regs.h Sun Mar 18 17:05:13 2001 | |
342 | @@ -1201,10 +1201,17 @@ | |
343 | ||
344 | #define GLINT_SLOW_WRITE_REG(v,r) \ | |
345 | do{ \ | |
346 | - GLINTDACDelay(5); \ | |
347 | + mem_barrier(); \ | |
348 | + GLINT_WAIT(1); \ | |
349 | + mem_barrier(); \ | |
350 | GLINT_WRITE_REG(v,r); \ | |
351 | - GLINTDACDelay(5); \ | |
352 | }while(0) | |
353 | + | |
354 | +#define GLINT_SET_INDEX(index) \ | |
355 | +do{ \ | |
356 | + GLINT_SLOW_WRITE_REG(((index)>>8)&0xff,PM2VDACIndexRegHigh); \ | |
357 | + GLINT_SLOW_WRITE_REG((index)&0xff,PM2VDACIndexRegLow); \ | |
358 | +} while(0) | |
359 | ||
360 | #define GLINT_SECONDARY_SLOW_WRITE_REG(v,r) \ | |
361 | do{ \ | |
362 | diff -ur xc.orig/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c | |
363 | --- xc.orig/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c Fri Mar 31 17:55:43 2000 | |
364 | +++ xc/programs/Xserver/hw/xfree86/drivers/glint/pm2_accel.c Sun Mar 18 16:55:14 2001 | |
365 | @@ -356,8 +356,6 @@ | |
366 | Permedia2SubsequentColorExpandScanline; | |
367 | } | |
368 | ||
369 | - infoPtr->ColorExpandRange = MAX_FIFO_ENTRIES; | |
370 | - | |
371 | infoPtr->WriteBitmap = Permedia2WriteBitmap; | |
372 | ||
373 | if (pScrn->bitsPerPixel == 8) | |
374 | @@ -427,10 +425,14 @@ | |
375 | CHECKCLIPPING; | |
376 | ||
377 | while (GLINT_READ_REG(DMACount) != 0); | |
378 | - GLINT_WAIT(1); | |
379 | - GLINT_WRITE_REG(0, GlintSync); | |
380 | + | |
381 | + GLINT_SLOW_WRITE_REG(0xc00, FilterMode); | |
382 | + | |
383 | + GLINT_WAIT(2); | |
384 | + GLINT_SLOW_WRITE_REG(0, GlintSync); | |
385 | + | |
386 | do { | |
387 | - while(GLINT_READ_REG(OutFIFOWords) == 0); | |
388 | + while(GLINT_READ_REG(OutFIFOWords) == 0); | |
389 | #define Sync_tag 0x188 | |
390 | } while (GLINT_READ_REG(OutputFIFO) != Sync_tag); | |
391 | } | |
392 | @@ -733,63 +735,6 @@ | |
393 | TRACE_EXIT("Permedia2SubsequentFillRectSolid"); | |
394 | } | |
395 | ||
396 | -static void MoveBYTE( | |
397 | - register CARD32* dest, | |
398 | - register unsigned char* src, | |
399 | - register int dwords | |
400 | -) | |
401 | -{ | |
402 | - while(dwords) { | |
403 | - *dest = *src; | |
404 | - src += 1; | |
405 | - dest += 1; | |
406 | - dwords -= 1; | |
407 | - } | |
408 | -} | |
409 | - | |
410 | -static void MoveWORDS( | |
411 | - register CARD32* dest, | |
412 | - register unsigned short* src, | |
413 | - register int dwords | |
414 | -) | |
415 | -{ | |
416 | - while(dwords & ~0x01) { | |
417 | - *dest = *src; | |
418 | - *(dest + 1) = *(src + 1); | |
419 | - src += 2; | |
420 | - dest += 2; | |
421 | - dwords -= 2; | |
422 | - } | |
423 | - switch(dwords) { | |
424 | - case 0: return; | |
425 | - case 1: *dest = *src; | |
426 | - return; | |
427 | - } | |
428 | -} | |
429 | - | |
430 | -static void MoveDWORDS( | |
431 | - register CARD32* dest, | |
432 | - register CARD32* src, | |
433 | - register int dwords ) | |
434 | -{ | |
435 | - while(dwords & ~0x03) { | |
436 | - *dest = *src; | |
437 | - *(dest + 1) = *(src + 1); | |
438 | - *(dest + 2) = *(src + 2); | |
439 | - *(dest + 3) = *(src + 3); | |
440 | - src += 4; | |
441 | - dest += 4; | |
442 | - dwords -= 4; | |
443 | - } | |
444 | - if (!dwords) return; | |
445 | - *dest = *src; | |
446 | - if (dwords == 1) return; | |
447 | - *(dest + 1) = *(src + 1); | |
448 | - if (dwords == 2) return; | |
449 | - *(dest + 2) = *(src + 2); | |
450 | -} | |
451 | - | |
452 | - | |
453 | static void | |
454 | Permedia2SetupForMono8x8PatternFill24bpp(ScrnInfoPtr pScrn, | |
455 | int patternx, int patterny, | |
456 | @@ -1117,10 +1062,10 @@ | |
457 | Permedia2SetClippingRectangle(pScrn,x+skipleft,y,x+w,y+h); | |
458 | ||
459 | if (pScrn->bitsPerPixel == 24) { | |
460 | - GLINT_WAIT(10); | |
461 | + GLINT_WAIT(10); | |
462 | } else { | |
463 | GLINT_WAIT(11); | |
464 | - DO_PLANEMASK(planemask); | |
465 | + DO_PLANEMASK(planemask); | |
466 | } | |
467 | LOADROP(rop); | |
468 | Permedia2LoadCoord(pScrn, x&0xFFFF, y, w, h); | |
469 | @@ -1137,39 +1082,40 @@ | |
470 | mode = 0; | |
471 | GLINT_WRITE_REG(UNIT_ENABLE, ColorDDAMode); | |
472 | GLINT_WRITE_REG(BitMaskPackingEachScanline| | |
473 | - pGlint->RasterizerSwap,RasterizerMode); | |
474 | + pGlint->RasterizerSwap,RasterizerMode); | |
475 | } | |
476 | ||
477 | if(bg == -1) { | |
478 | /* >>>>> set fg <<<<<<<< */ | |
479 | REPLICATE(fg); | |
480 | - if ((pScrn->bitsPerPixel != 24) && (rop == GXcopy)) { | |
481 | - GLINT_WRITE_REG(fg, FBBlockColor); | |
482 | + if ((pScrn->bitsPerPixel != 24) && (rop == GXcopy)) { | |
483 | + GLINT_WRITE_REG(fg, FBBlockColor); | |
484 | } else { | |
485 | - GLINT_WRITE_REG(fg, ConstantColor); | |
486 | + GLINT_WRITE_REG(fg, ConstantColor); | |
487 | } | |
488 | } else if(rop == GXcopy) { | |
489 | - /* >>>>> set bg <<<<<<< */ | |
490 | - /* >>>>> draw rect (x,y,w,h) */ | |
491 | - REPLICATE(bg); | |
492 | - if ((pScrn->bitsPerPixel != 24) && (rop == GXcopy)) { | |
493 | + /* >>>>> set bg <<<<<<< */ | |
494 | + /* >>>>> draw rect (x,y,w,h) */ | |
495 | + REPLICATE(bg); | |
496 | + if ((pScrn->bitsPerPixel != 24) && (rop == GXcopy)) { | |
497 | GLINT_WRITE_REG(bg, FBBlockColor); | |
498 | } else { | |
499 | GLINT_WRITE_REG(bg, ConstantColor); | |
500 | } | |
501 | - GLINT_WRITE_REG(PrimitiveRectangle | XPositive | YPositive |mode,Render); | |
502 | + GLINT_WRITE_REG(PrimitiveRectangle | XPositive | YPositive |mode, | |
503 | + Render); | |
504 | /* >>>>>> set fg <<<<<< */ | |
505 | REPLICATE(fg); | |
506 | - if ((pScrn->bitsPerPixel != 24) && (rop == GXcopy)) { | |
507 | + if ((pScrn->bitsPerPixel != 24) && (rop == GXcopy)) { | |
508 | GLINT_WRITE_REG(fg, FBBlockColor); | |
509 | } else { | |
510 | GLINT_WRITE_REG(fg, ConstantColor); | |
511 | } | |
512 | } else { | |
513 | - SecondPass = TRUE; | |
514 | + SecondPass = TRUE; | |
515 | /* >>>>> set fg <<<<<<< */ | |
516 | REPLICATE(fg); | |
517 | - if ((pScrn->bitsPerPixel != 24) && (rop == GXcopy)) { | |
518 | + if ((pScrn->bitsPerPixel != 24) && (rop == GXcopy)) { | |
519 | GLINT_WRITE_REG(fg, FBBlockColor); | |
520 | } else { | |
521 | GLINT_WRITE_REG(fg, ConstantColor); | |
522 | @@ -1188,8 +1134,8 @@ | |
523 | GLINT_WAIT(dwords); | |
524 | /* 0x0D is the TAG value for BitMaskPattern */ | |
525 | GLINT_WRITE_REG(((dwords - 1) << 16) | 0x0D, OutputFIFO); | |
526 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
527 | - (CARD32 *)srcpntr, dwords); | |
528 | + GLINT_MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
529 | + (CARD32 *)srcpntr, dwords); | |
530 | srcpntr += srcwidth; | |
531 | } | |
532 | ||
533 | @@ -1198,12 +1144,13 @@ | |
534 | /* >>>>>> invert bitmask and set bg <<<<<<<< */ | |
535 | REPLICATE(bg); | |
536 | GLINT_WAIT(3); | |
537 | - if ((pScrn->bitsPerPixel != 24) && (rop == GXcopy)) { | |
538 | - GLINT_WRITE_REG(InvertBitMask|pGlint->RasterizerSwap,RasterizerMode); | |
539 | + if ((pScrn->bitsPerPixel != 24) && (rop == GXcopy)) { | |
540 | + GLINT_WRITE_REG(InvertBitMask|pGlint->RasterizerSwap, | |
541 | + RasterizerMode); | |
542 | GLINT_WRITE_REG(bg, FBBlockColor); | |
543 | } else { | |
544 | - GLINT_WRITE_REG(InvertBitMask|BitMaskPackingEachScanline| | |
545 | - pGlint->RasterizerSwap, RasterizerMode); | |
546 | + GLINT_WRITE_REG(InvertBitMask|BitMaskPackingEachScanline| | |
547 | + pGlint->RasterizerSwap, RasterizerMode); | |
548 | GLINT_WRITE_REG(bg, ConstantColor); | |
549 | } | |
550 | goto SECOND_PASS; | |
551 | @@ -1276,13 +1223,15 @@ | |
552 | count = dwords; | |
553 | address = ((y * pScrn->displayWidth) + x) >> 2; | |
554 | srcp = (CARD32*)src; | |
555 | + GLINT_WAIT(1); | |
556 | GLINT_WRITE_REG(address, TextureDownloadOffset); | |
557 | while(count >= MAX_FIFO_ENTRIES) { | |
558 | GLINT_WAIT(MAX_FIFO_ENTRIES); | |
559 | /* (0x11 << 4) | 0x0D is the TAG for TextureData */ | |
560 | GLINT_WRITE_REG(((MAX_FIFO_ENTRIES - 2) << 16) | (0x11 << 4) | | |
561 | 0x0D, OutputFIFO); | |
562 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
563 | + GLINT_MoveDWORDS( | |
564 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
565 | (CARD32*)srcp, MAX_FIFO_ENTRIES - 1); | |
566 | count -= MAX_FIFO_ENTRIES - 1; | |
567 | address += MAX_FIFO_ENTRIES - 1; | |
568 | @@ -1293,7 +1242,8 @@ | |
569 | /* (0x11 << 4) | 0x0D is the TAG for TextureData */ | |
570 | GLINT_WRITE_REG(((count - 1) << 16) | (0x11 << 4) | 0x0D, | |
571 | OutputFIFO); | |
572 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
573 | + GLINT_MoveDWORDS( | |
574 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
575 | (CARD32*)srcp, count); | |
576 | } | |
577 | src += srcwidth; | |
578 | @@ -1304,7 +1254,7 @@ | |
579 | } else { | |
580 | char align = (x & pGlint->bppalign); | |
581 | ||
582 | - | |
583 | + GLINT_WAIT(1); | |
584 | GLINT_WRITE_REG(UNIT_DISABLE, ColorDDAMode); | |
585 | if (rop == GXcopy) { | |
586 | GLINT_WAIT(6); | |
587 | @@ -1329,7 +1279,8 @@ | |
588 | /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */ | |
589 | GLINT_WRITE_REG(((MAX_FIFO_ENTRIES - 2) << 16) | (0x15 << 4) | | |
590 | 0x05, OutputFIFO); | |
591 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
592 | + GLINT_MoveDWORDS( | |
593 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
594 | (CARD32*)srcp, MAX_FIFO_ENTRIES - 1); | |
595 | count -= MAX_FIFO_ENTRIES - 1; | |
596 | srcp += MAX_FIFO_ENTRIES - 1; | |
597 | @@ -1339,7 +1290,8 @@ | |
598 | /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */ | |
599 | GLINT_WRITE_REG(((count - 1) << 16) | (0x15 << 4) | | |
600 | 0x05, OutputFIFO); | |
601 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
602 | + GLINT_MoveDWORDS( | |
603 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
604 | (CARD32*)srcp, count); | |
605 | } | |
606 | src += srcwidth; | |
607 | @@ -1353,7 +1305,8 @@ | |
608 | /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */ | |
609 | GLINT_WRITE_REG(((MAX_FIFO_ENTRIES - 2) << 16) | (0x15 << 4) | | |
610 | 0x05, OutputFIFO); | |
611 | - MoveBYTE((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
612 | + GLINT_MoveBYTES( | |
613 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
614 | (unsigned char *)srcpbyte, MAX_FIFO_ENTRIES - 1); | |
615 | count -= MAX_FIFO_ENTRIES - 1; | |
616 | srcpbyte += MAX_FIFO_ENTRIES - 1; | |
617 | @@ -1363,7 +1316,8 @@ | |
618 | /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */ | |
619 | GLINT_WRITE_REG(((count - 1) << 16) | (0x15 << 4) | | |
620 | 0x05, OutputFIFO); | |
621 | - MoveBYTE((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
622 | + GLINT_MoveBYTES( | |
623 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
624 | (unsigned char *)srcpbyte, count); | |
625 | } | |
626 | src += srcwidth; | |
627 | @@ -1435,13 +1389,15 @@ | |
628 | count = dwords; | |
629 | address = ((y * pScrn->displayWidth) + x) >> 1; | |
630 | srcp = (CARD32*)src; | |
631 | + GLINT_WAIT(1); | |
632 | GLINT_WRITE_REG(address, TextureDownloadOffset); | |
633 | while(count >= MAX_FIFO_ENTRIES) { | |
634 | GLINT_WAIT(MAX_FIFO_ENTRIES); | |
635 | /* (0x11 << 4) | 0x0D is the TAG for TextureData */ | |
636 | GLINT_WRITE_REG(((MAX_FIFO_ENTRIES - 2) << 16) | (0x11 << 4) | | |
637 | 0x0D, OutputFIFO); | |
638 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
639 | + GLINT_MoveDWORDS( | |
640 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
641 | (CARD32*)srcp, MAX_FIFO_ENTRIES - 1); | |
642 | count -= MAX_FIFO_ENTRIES - 1; | |
643 | address += MAX_FIFO_ENTRIES - 1; | |
644 | @@ -1452,7 +1408,8 @@ | |
645 | /* (0x11 << 4) | 0x0D is the TAG for TextureData */ | |
646 | GLINT_WRITE_REG(((count - 1) << 16) | (0x11 << 4) | 0x0D, | |
647 | OutputFIFO); | |
648 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
649 | + GLINT_MoveDWORDS( | |
650 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
651 | (CARD32*)srcp, count); | |
652 | } | |
653 | src += srcwidth; | |
654 | @@ -1488,7 +1445,8 @@ | |
655 | /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */ | |
656 | GLINT_WRITE_REG(((MAX_FIFO_ENTRIES - 2) << 16) | (0x15 << 4) | | |
657 | 0x05, OutputFIFO); | |
658 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
659 | + GLINT_MoveDWORDS( | |
660 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
661 | (CARD32*)srcp, MAX_FIFO_ENTRIES - 1); | |
662 | count -= MAX_FIFO_ENTRIES - 1; | |
663 | srcp += MAX_FIFO_ENTRIES - 1; | |
664 | @@ -1498,7 +1456,8 @@ | |
665 | /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */ | |
666 | GLINT_WRITE_REG(((count - 1) << 16) | (0x15 << 4) | | |
667 | 0x05, OutputFIFO); | |
668 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
669 | + GLINT_MoveDWORDS( | |
670 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
671 | (CARD32*)srcp, count); | |
672 | } | |
673 | src += srcwidth; | |
674 | @@ -1512,7 +1471,8 @@ | |
675 | /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */ | |
676 | GLINT_WRITE_REG(((MAX_FIFO_ENTRIES - 2) << 16) | (0x15 << 4) | | |
677 | 0x05, OutputFIFO); | |
678 | - MoveWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
679 | + GLINT_MoveWORDS( | |
680 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
681 | (unsigned short *)srcpword, MAX_FIFO_ENTRIES - 1); | |
682 | count -= MAX_FIFO_ENTRIES - 1; | |
683 | srcpword += MAX_FIFO_ENTRIES - 1; | |
684 | @@ -1522,7 +1482,8 @@ | |
685 | /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */ | |
686 | GLINT_WRITE_REG(((count - 1) << 16) | (0x15 << 4) | | |
687 | 0x05, OutputFIFO); | |
688 | - MoveWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
689 | + GLINT_MoveWORDS( | |
690 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
691 | (unsigned short *)srcpword, count); | |
692 | } | |
693 | src += srcwidth; | |
694 | @@ -1590,7 +1551,8 @@ | |
695 | /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */ | |
696 | GLINT_WRITE_REG(((MAX_FIFO_ENTRIES - 2) << 16) | (0x15 << 4) | | |
697 | 0x05, OutputFIFO); | |
698 | - MoveBYTE((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
699 | + GLINT_MoveBYTES( | |
700 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
701 | (unsigned char *)srcpbyte, MAX_FIFO_ENTRIES - 1); | |
702 | count -= MAX_FIFO_ENTRIES - 1; | |
703 | srcpbyte += MAX_FIFO_ENTRIES - 1; | |
704 | @@ -1600,7 +1562,8 @@ | |
705 | /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */ | |
706 | GLINT_WRITE_REG(((count - 1) << 16) | (0x15 << 4) | | |
707 | 0x05, OutputFIFO); | |
708 | - MoveBYTE((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
709 | + GLINT_MoveBYTES( | |
710 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
711 | (unsigned char *)srcpbyte, count); | |
712 | } | |
713 | src += srcwidth; | |
714 | @@ -1613,7 +1576,8 @@ | |
715 | /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */ | |
716 | GLINT_WRITE_REG(((MAX_FIFO_ENTRIES - 2) << 16) | (0x15 << 4) | | |
717 | 0x05, OutputFIFO); | |
718 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
719 | + GLINT_MoveDWORDS( | |
720 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
721 | (CARD32*)srcp, MAX_FIFO_ENTRIES - 1); | |
722 | count -= MAX_FIFO_ENTRIES - 1; | |
723 | srcp += MAX_FIFO_ENTRIES - 1; | |
724 | @@ -1623,7 +1587,8 @@ | |
725 | /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */ | |
726 | GLINT_WRITE_REG(((count - 1) << 16) | (0x15 << 4) | | |
727 | 0x05, OutputFIFO); | |
728 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
729 | + GLINT_MoveDWORDS( | |
730 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
731 | (CARD32*)srcp, count); | |
732 | } | |
733 | src += srcwidth; | |
734 | @@ -1689,13 +1654,15 @@ | |
735 | count = dwords; | |
736 | address = (y * pScrn->displayWidth) + x; | |
737 | srcp = (CARD32*)src; | |
738 | + GLINT_WAIT(1); | |
739 | GLINT_WRITE_REG(address, TextureDownloadOffset); | |
740 | while(count >= MAX_FIFO_ENTRIES) { | |
741 | GLINT_WAIT(MAX_FIFO_ENTRIES); | |
742 | /* (0x11 << 4) | 0x0D is the TAG for TextureData */ | |
743 | GLINT_WRITE_REG(((MAX_FIFO_ENTRIES - 2) << 16) | (0x11 << 4) | | |
744 | 0x0D, OutputFIFO); | |
745 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
746 | + GLINT_MoveDWORDS( | |
747 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
748 | (CARD32*)srcp, MAX_FIFO_ENTRIES - 1); | |
749 | count -= MAX_FIFO_ENTRIES - 1; | |
750 | address += MAX_FIFO_ENTRIES - 1; | |
751 | @@ -1706,7 +1673,8 @@ | |
752 | /* (0x11 << 4) | 0x0D is the TAG for TextureData */ | |
753 | GLINT_WRITE_REG(((count - 1) << 16) | (0x11 << 4) | 0x0D, | |
754 | OutputFIFO); | |
755 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
756 | + GLINT_MoveDWORDS( | |
757 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
758 | (CARD32*)srcp, count); | |
759 | } | |
760 | src += srcwidth; | |
761 | @@ -1732,7 +1700,8 @@ | |
762 | /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */ | |
763 | GLINT_WRITE_REG(((MAX_FIFO_ENTRIES - 2) << 16) | (0x15 << 4) | | |
764 | 0x05, OutputFIFO); | |
765 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
766 | + GLINT_MoveDWORDS( | |
767 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
768 | (CARD32*)srcp, MAX_FIFO_ENTRIES - 1); | |
769 | count -= MAX_FIFO_ENTRIES - 1; | |
770 | srcp += MAX_FIFO_ENTRIES - 1; | |
771 | @@ -1742,7 +1711,8 @@ | |
772 | /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */ | |
773 | GLINT_WRITE_REG(((count - 1) << 16) | (0x15 << 4) | | |
774 | 0x05, OutputFIFO); | |
775 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
776 | + GLINT_MoveDWORDS( | |
777 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
778 | (CARD32*)srcp, count); | |
779 | } | |
780 | src += srcwidth; | |
781 | diff -ur xc.orig/programs/Xserver/hw/xfree86/drivers/glint/pm2ramdac.c xc/programs/Xserver/hw/xfree86/drivers/glint/pm2ramdac.c | |
782 | --- xc.orig/programs/Xserver/hw/xfree86/drivers/glint/pm2ramdac.c Sat Jul 17 23:26:57 1999 | |
783 | +++ xc/programs/Xserver/hw/xfree86/drivers/glint/pm2ramdac.c Sun Mar 18 22:26:08 2001 | |
784 | @@ -104,16 +104,21 @@ | |
785 | VisualPtr pVisual | |
786 | ){ | |
787 | GLINTPtr pGlint = GLINTPTR(pScrn); | |
788 | - int i, index, shift; | |
789 | + int i, index, shift = 0, j, repeat = 1; | |
790 | ||
791 | - shift = (pScrn->depth == 15) ? 3 : 0; | |
792 | + if (pScrn->depth == 15) { | |
793 | + repeat = 8; | |
794 | + shift = 3; | |
795 | + } | |
796 | ||
797 | for(i = 0; i < numColors; i++) { | |
798 | index = indices[i]; | |
799 | - Permedia2WriteAddress(pScrn, index << shift); | |
800 | - Permedia2WriteData(pScrn, colors[index].red); | |
801 | - Permedia2WriteData(pScrn, colors[index].green); | |
802 | - Permedia2WriteData(pScrn, colors[index].blue); | |
803 | + for (j = 0; j < repeat; j++) { | |
804 | + Permedia2WriteAddress(pScrn, (index << shift)+j); | |
805 | + Permedia2WriteData(pScrn, colors[index].red); | |
806 | + Permedia2WriteData(pScrn, colors[index].green); | |
807 | + Permedia2WriteData(pScrn, colors[index].blue); | |
808 | + } | |
809 | /* for video i/o */ | |
810 | GLINT_SLOW_WRITE_REG(index, TexelLUTIndex); | |
811 | GLINT_SLOW_WRITE_REG((colors[index].red & 0xFF) | | |
812 | @@ -132,14 +137,16 @@ | |
813 | VisualPtr pVisual | |
814 | ){ | |
815 | GLINTPtr pGlint = GLINTPTR(pScrn); | |
816 | - int i, index; | |
817 | + int i, index, j; | |
818 | ||
819 | for(i = 0; i < numColors; i++) { | |
820 | index = indices[i]; | |
821 | - Permedia2WriteAddress(pScrn, index << 2); | |
822 | - Permedia2WriteData(pScrn, colors[index >> 1].red); | |
823 | - Permedia2WriteData(pScrn, colors[index].green); | |
824 | - Permedia2WriteData(pScrn, colors[index >> 1].blue); | |
825 | + for (j = 0; j < 4; j++) { | |
826 | + Permedia2WriteAddress(pScrn, (index << 2)+j); | |
827 | + Permedia2WriteData(pScrn, colors[index >> 1].red); | |
828 | + Permedia2WriteData(pScrn, colors[index].green); | |
829 | + Permedia2WriteData(pScrn, colors[index >> 1].blue); | |
830 | + } | |
831 | GLINT_SLOW_WRITE_REG(index, TexelLUTIndex); | |
832 | GLINT_SLOW_WRITE_REG((colors[index].red & 0xFF) | | |
833 | ((colors[index].green & 0xFF) << 8) | | |
834 | @@ -147,10 +154,12 @@ | |
835 | TexelLUTData); | |
836 | ||
837 | if(index <= 31) { | |
838 | - Permedia2WriteAddress(pScrn, index << 3); | |
839 | - Permedia2WriteData(pScrn, colors[index].red); | |
840 | - Permedia2WriteData(pScrn, colors[(index << 1) + 1].green); | |
841 | - Permedia2WriteData(pScrn, colors[index].blue); | |
842 | + for (j = 0; j < 4; j++) { | |
843 | + Permedia2WriteAddress(pScrn, (index << 3)+j); | |
844 | + Permedia2WriteData(pScrn, colors[index].red); | |
845 | + Permedia2WriteData(pScrn, colors[(index << 1) + 1].green); | |
846 | + Permedia2WriteData(pScrn, colors[index].blue); | |
847 | + } | |
848 | } | |
849 | } | |
850 | } | |
851 | diff -ur xc.orig/programs/Xserver/hw/xfree86/drivers/glint/pm2v_dac.c xc/programs/Xserver/hw/xfree86/drivers/glint/pm2v_dac.c | |
852 | --- xc.orig/programs/Xserver/hw/xfree86/drivers/glint/pm2v_dac.c Sat Mar 17 17:57:15 2001 | |
853 | +++ xc/programs/Xserver/hw/xfree86/drivers/glint/pm2v_dac.c Sun Mar 18 17:43:30 2001 | |
854 | @@ -406,7 +406,10 @@ | |
855 | int bg, int fg | |
856 | ) | |
857 | { | |
858 | - /* A 2 color cursor uses last 2 indexes into hardware cursor palette */ | |
859 | + GLINTPtr pGlint = GLINTPTR(pScrn); | |
860 | + | |
861 | + if (pGlint->Chipset == PCI_VENDOR_3DLABS_CHIP_PERMEDIA3) { | |
862 | + /* PM3 uses last 2 indexes into hardware cursor palette fg first...*/ | |
863 | Permedia2vOutIndReg(pScrn, PM2VDACRDCursorPalette+39, 0x00, (fg>>16)&0xff); | |
864 | Permedia2vOutIndReg(pScrn, PM2VDACRDCursorPalette+40, 0x00, (fg>>8)&0xff); | |
865 | Permedia2vOutIndReg(pScrn, PM2VDACRDCursorPalette+41, 0x00, fg & 0xff); | |
866 | @@ -414,6 +417,16 @@ | |
867 | Permedia2vOutIndReg(pScrn, PM2VDACRDCursorPalette+42, 0x00, (bg>>16)&0xff); | |
868 | Permedia2vOutIndReg(pScrn, PM2VDACRDCursorPalette+43, 0x00, (bg>>8)&0xff); | |
869 | Permedia2vOutIndReg(pScrn, PM2VDACRDCursorPalette+44, 0x00, bg & 0xff); | |
870 | + } else { | |
871 | + /* PM2v uses first 2 indexes into hardware cursor palette bg first...*/ | |
872 | + Permedia2vOutIndReg(pScrn, PM2VDACRDCursorPalette+0, 0x00, (bg>>16)&0xff); | |
873 | + Permedia2vOutIndReg(pScrn, PM2VDACRDCursorPalette+1, 0x00, (bg>>8)&0xff); | |
874 | + Permedia2vOutIndReg(pScrn, PM2VDACRDCursorPalette+2, 0x00, bg & 0xff); | |
875 | + | |
876 | + Permedia2vOutIndReg(pScrn, PM2VDACRDCursorPalette+3, 0x00, (fg>>16)&0xff); | |
877 | + Permedia2vOutIndReg(pScrn, PM2VDACRDCursorPalette+4, 0x00, (fg>>8)&0xff); | |
878 | + Permedia2vOutIndReg(pScrn, PM2VDACRDCursorPalette+5, 0x00, fg & 0xff); | |
879 | + } | |
880 | } | |
881 | ||
882 | static Bool | |
883 | diff -ur xc.orig/programs/Xserver/hw/xfree86/drivers/glint/pm2vramdac.c xc/programs/Xserver/hw/xfree86/drivers/glint/pm2vramdac.c | |
884 | --- xc.orig/programs/Xserver/hw/xfree86/drivers/glint/pm2vramdac.c Fri Feb 12 17:52:05 1999 | |
885 | +++ xc/programs/Xserver/hw/xfree86/drivers/glint/pm2vramdac.c Sun Mar 18 16:51:30 2001 | |
886 | @@ -43,8 +43,7 @@ | |
887 | GLINTPtr pGlint = GLINTPTR(pScrn); | |
888 | unsigned char tmp = 0x00; | |
889 | ||
890 | - GLINT_SLOW_WRITE_REG((reg>>8) & 0xff, PM2VDACIndexRegHigh); | |
891 | - GLINT_SLOW_WRITE_REG(reg&0xff, PM2VDACIndexRegLow); | |
892 | + GLINT_SET_INDEX(reg); | |
893 | ||
894 | if (mask != 0x00) | |
895 | tmp = GLINT_READ_REG (PM2VDACIndexData) & mask; | |
896 | @@ -58,8 +57,7 @@ | |
897 | GLINTPtr pGlint = GLINTPTR(pScrn); | |
898 | unsigned char ret; | |
899 | ||
900 | - GLINT_SLOW_WRITE_REG (reg&0xff, PM2VDACIndexRegLow); | |
901 | - GLINT_SLOW_WRITE_REG((reg>>8) & 0xff, PM2VDACIndexRegHigh); | |
902 | + GLINT_SET_INDEX(reg); | |
903 | ret = GLINT_READ_REG (PM2VDACIndexData); | |
904 | ||
905 | return (ret); | |
906 | diff -ur xc.orig/programs/Xserver/hw/xfree86/drivers/glint/pm3_accel.c xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_accel.c | |
907 | --- xc.orig/programs/Xserver/hw/xfree86/drivers/glint/pm3_accel.c Wed Nov 29 11:42:17 2000 | |
908 | +++ xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_accel.c Sun Mar 18 20:15:21 2001 | |
909 | @@ -47,7 +47,6 @@ | |
910 | #include "xaalocal.h" /* For replacements */ | |
911 | ||
912 | #define DEBUG 0 | |
913 | -#define USE_DIRECT_FIFO_WRITES 1 | |
914 | ||
915 | #if DEBUG | |
916 | # define TRACE_ENTER(str) ErrorF("pm3_accel: " str " %d\n",pScrn->scrnIndex) | |
917 | @@ -86,26 +85,35 @@ | |
918 | int x_offset, int y_offset, int x, int y, | |
919 | int w, int h); | |
920 | /* Color Expansion Fills */ | |
921 | -static void Permedia3SetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, | |
922 | - int fg, int bg, int rop,unsigned int planemask); | |
923 | -static void Permedia3SubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, | |
924 | - int x, int y, int w, int h, int skipleft); | |
925 | +static void Permedia3SetupForScanlineCPUToScreenColorExpandFill( | |
926 | + ScrnInfoPtr pScrn, | |
927 | + int fg, int bg, int rop, | |
928 | + unsigned int planemask); | |
929 | +static void Permedia3SubsequentScanlineCPUToScreenColorExpandFill( | |
930 | + ScrnInfoPtr pScrn, int x, | |
931 | + int y, int w, int h, int skipleft); | |
932 | +static void Permedia3SubsequentColorExpandScanline( | |
933 | + ScrnInfoPtr pScrn, | |
934 | + int bufno); | |
935 | /* Direct Fifo Bitmap Writes */ | |
936 | static void Permedia3WriteBitmap(ScrnInfoPtr pScrn, int x, int y, int w, int h, | |
937 | unsigned char *src, int srcwidth, int skipleft, | |
938 | int fg, int bg, int rop,unsigned int planemask); | |
939 | /* Images Writes */ | |
940 | -static void Permedia3SetupForImageWrite(ScrnInfoPtr pScrn, int rop, | |
941 | +static void Permedia3SetupForScanlineImageWrite(ScrnInfoPtr pScrn, int rop, | |
942 | unsigned int planemask, int trans_color, | |
943 | int bpp, int depth); | |
944 | -static void Permedia3SubsequentImageWriteRect(ScrnInfoPtr pScrn, | |
945 | +static void Permedia3SubsequentScanlineImageWriteRect(ScrnInfoPtr pScrn, | |
946 | int x, int y, int w, int h, int skipleft); | |
947 | +static void Permedia3SubsequentImageWriteScanline(ScrnInfoPtr pScrn, int bufno); | |
948 | /* Direct Fifo Pixmap Writes */ | |
949 | static void Permedia3WritePixmap(ScrnInfoPtr pScrn, int x, int y, int w, int h, | |
950 | unsigned char *src, int srcwidth, int rop, | |
951 | unsigned int planemask, int transparency_color, | |
952 | int bpp, int depth); | |
953 | ||
954 | +#define MAX_FIFO_ENTRIES 120 | |
955 | + | |
956 | void | |
957 | Permedia3InitializeEngine(ScrnInfoPtr pScrn) | |
958 | { | |
959 | @@ -407,51 +415,52 @@ | |
960 | infoPtr->SubsequentMono8x8PatternFillRect = | |
961 | Permedia3SubsequentMono8x8PatternFillRect; | |
962 | ||
963 | -#if USE_DIRECT_FIFO_WRITES | |
964 | - /* Direct Fifo Bitmap Writes */ | |
965 | + /* Bitmap Writes */ | |
966 | infoPtr->WriteBitmapFlags = 0; | |
967 | infoPtr->WriteBitmap = Permedia3WriteBitmap; | |
968 | -#endif | |
969 | - | |
970 | - /* Color Expand Fills */ | |
971 | - infoPtr->CPUToScreenColorExpandFillFlags = | |
972 | - /* | |
973 | - SYNC_AFTER_COLOR_EXPAND | | |
974 | - */ | |
975 | - LEFT_EDGE_CLIPPING | | |
976 | - BIT_ORDER_IN_BYTE_LSBFIRST | | |
977 | - CPU_TRANSFER_BASE_FIXED | | |
978 | - CPU_TRANSFER_PAD_DWORD; | |
979 | - infoPtr->ColorExpandBase = pGlint->IOBase + BitMaskPattern; | |
980 | - infoPtr->ColorExpandRange = 4; | |
981 | - infoPtr->SetupForCPUToScreenColorExpandFill = | |
982 | - Permedia3SetupForCPUToScreenColorExpandFill; | |
983 | - infoPtr->SubsequentCPUToScreenColorExpandFill = | |
984 | - Permedia3SubsequentCPUToScreenColorExpandFill; | |
985 | ||
986 | -#if USE_DIRECT_FIFO_WRITES | |
987 | - /* Direct Fifo Images Writes */ | |
988 | + /* Pixmap Writes */ | |
989 | infoPtr->WritePixmapFlags = 0; | |
990 | infoPtr->WritePixmap = Permedia3WritePixmap; | |
991 | -#else | |
992 | + | |
993 | + /* Color Expand Fills */ | |
994 | + infoPtr->ScanlineCPUToScreenColorExpandFillFlags = | |
995 | + LEFT_EDGE_CLIPPING | | |
996 | + LEFT_EDGE_CLIPPING_NEGATIVE_X | | |
997 | + BIT_ORDER_IN_BYTE_LSBFIRST | | |
998 | + CPU_TRANSFER_PAD_DWORD; | |
999 | + | |
1000 | + infoPtr->NumScanlineColorExpandBuffers = 1; | |
1001 | + pGlint->ScratchBuffer = xalloc(((pScrn->virtualX+62)/32*4) | |
1002 | + + (pScrn->virtualX | |
1003 | + * pScrn->bitsPerPixel / 8)); | |
1004 | + infoPtr->ScanlineColorExpandBuffers = | |
1005 | + pGlint->XAAScanlineColorExpandBuffers; | |
1006 | + pGlint->XAAScanlineColorExpandBuffers[0] = | |
1007 | + pGlint->IOBase + OutputFIFO + 4; | |
1008 | + | |
1009 | + infoPtr->SetupForScanlineCPUToScreenColorExpandFill = | |
1010 | + Permedia3SetupForScanlineCPUToScreenColorExpandFill; | |
1011 | + infoPtr->SubsequentScanlineCPUToScreenColorExpandFill = | |
1012 | + Permedia3SubsequentScanlineCPUToScreenColorExpandFill; | |
1013 | + infoPtr->SubsequentColorExpandScanline = | |
1014 | + Permedia3SubsequentColorExpandScanline; | |
1015 | + | |
1016 | /* Images Writes */ | |
1017 | - infoPtr->ImageWriteFlags = | |
1018 | - NO_GXCOPY | | |
1019 | - /* | |
1020 | - SYNC_AFTER_IMAGE_WRITE | | |
1021 | - */ | |
1022 | - LEFT_EDGE_CLIPPING | | |
1023 | - LEFT_EDGE_CLIPPING_NEGATIVE_X | | |
1024 | - BIT_ORDER_IN_BYTE_LSBFIRST | | |
1025 | - CPU_TRANSFER_BASE_FIXED | | |
1026 | - CPU_TRANSFER_PAD_DWORD; | |
1027 | - infoPtr->ImageWriteBase = pGlint->IOBase + PM3FBSourceData; | |
1028 | - infoPtr->ImageWriteRange = 4; | |
1029 | - infoPtr->SetupForImageWrite = | |
1030 | - Permedia3SetupForImageWrite; | |
1031 | - infoPtr->SubsequentImageWriteRect = | |
1032 | - Permedia3SubsequentImageWriteRect; | |
1033 | -#endif | |
1034 | + infoPtr->ScanlineImageWriteFlags = NO_GXCOPY | | |
1035 | + LEFT_EDGE_CLIPPING | | |
1036 | + LEFT_EDGE_CLIPPING_NEGATIVE_X | | |
1037 | + BIT_ORDER_IN_BYTE_LSBFIRST | | |
1038 | + CPU_TRANSFER_PAD_DWORD; | |
1039 | + infoPtr->NumScanlineImageWriteBuffers = 1; | |
1040 | + infoPtr->ScanlineImageWriteBuffers = | |
1041 | + pGlint->XAAScanlineColorExpandBuffers; | |
1042 | + infoPtr->SetupForScanlineImageWrite = | |
1043 | + Permedia3SetupForScanlineImageWrite; | |
1044 | + infoPtr->SubsequentScanlineImageWriteRect = | |
1045 | + Permedia3SubsequentScanlineImageWriteRect; | |
1046 | + infoPtr->SubsequentImageWriteScanline = | |
1047 | + Permedia3SubsequentImageWriteScanline; | |
1048 | ||
1049 | /* Available Framebuffer Area for XAA. */ | |
1050 | AvailFBArea.x1 = 0; | |
1051 | @@ -461,7 +470,7 @@ | |
1052 | pScrn->bitsPerPixel / 8); | |
1053 | /* Alan does this ??? | |
1054 | AvailFBArea.y2 = ((pGlint->FbMapSize > 16384*1024) ? 16384*1024 : | |
1055 | - pGlint->FbMapSize) / (pScrn->displayWidth | |
1056 | + pGlint->FbMapSize) / (pScrn->displayWidth * | |
1057 | pScrn->bitsPerPixel / 8); | |
1058 | */ | |
1059 | ||
1060 | @@ -491,8 +500,12 @@ | |
1061 | CHECKCLIPPING; | |
1062 | ||
1063 | while (GLINT_READ_REG(DMACount) != 0); | |
1064 | - GLINT_WAIT(1); | |
1065 | + | |
1066 | + GLINT_WAIT(3); | |
1067 | + GLINT_WRITE_REG(3, BroadcastMask); /* hack! this shouldn't be needed */ | |
1068 | + GLINT_WRITE_REG(0x400, FilterMode); | |
1069 | GLINT_WRITE_REG(0, GlintSync); | |
1070 | + | |
1071 | do { | |
1072 | while(GLINT_READ_REG(OutFIFOWords) == 0); | |
1073 | } while (GLINT_READ_REG(OutputFIFO) != PM3SyncTag); | |
1074 | @@ -700,11 +713,15 @@ | |
1075 | } | |
1076 | ||
1077 | /* Color Expansion Fills */ | |
1078 | -static void Permedia3SetupForCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, | |
1079 | - int fg, int bg, int rop,unsigned int planemask) | |
1080 | -{ | |
1081 | +static void | |
1082 | +Permedia3SetupForScanlineCPUToScreenColorExpandFill( | |
1083 | + ScrnInfoPtr pScrn, | |
1084 | + int fg, int bg, | |
1085 | + int rop, | |
1086 | + unsigned int planemask | |
1087 | +){ | |
1088 | GLINTPtr pGlint = GLINTPTR(pScrn); | |
1089 | - TRACE_ENTER("Permedia3SetupForCPUToScreenColorExpandFill"); | |
1090 | + | |
1091 | REPLICATE(fg); | |
1092 | pGlint->PM3_Render2D = | |
1093 | PM3Render2D_SpanOperation | | |
1094 | @@ -729,14 +746,23 @@ | |
1095 | GLINT_WRITE_REG(fg, PM3ForegroundColor); | |
1096 | DO_PLANEMASK(planemask); | |
1097 | GLINT_WRITE_REG(pGlint->PM3_Config2D, PM3Config2D); | |
1098 | - TRACE_EXIT("Permedia3SetupForCPUToScreenColorExpandFill"); | |
1099 | } | |
1100 | -static void Permedia3SubsequentCPUToScreenColorExpandFill(ScrnInfoPtr pScrn, | |
1101 | - int x, int y, int w, int h, int skipleft) | |
1102 | -{ | |
1103 | + | |
1104 | +static void | |
1105 | +Permedia3SubsequentScanlineCPUToScreenColorExpandFill( | |
1106 | + ScrnInfoPtr pScrn, | |
1107 | + int x, int y, int w, int h, | |
1108 | + int skipleft | |
1109 | +){ | |
1110 | GLINTPtr pGlint = GLINTPTR(pScrn); | |
1111 | - TRACE_ENTER("Permedia3SubsequentCPUToScreenColorExpandFill"); | |
1112 | - GLINT_WAIT(4); | |
1113 | + | |
1114 | + TRACE_ENTER("Permedia2SubsequentScanlineCPUToScreenColorExpandFill"); | |
1115 | + | |
1116 | + pGlint->dwords = ((w + 31) >> 5); /* dwords per scanline */ | |
1117 | + | |
1118 | + pGlint->cpucount = h; | |
1119 | + | |
1120 | + GLINT_WAIT(5); | |
1121 | GLINT_WRITE_REG(((y&0x0fff)<<16)|((x+skipleft)&0x0fff), ScissorMinXY); | |
1122 | GLINT_WRITE_REG((((y+h)&0x0fff)<<16)|((x+w)&0x0fff), ScissorMaxXY); | |
1123 | GLINT_WRITE_REG( | |
1124 | @@ -746,16 +772,60 @@ | |
1125 | GLINT_WRITE_REG(pGlint->PM3_Render2D | | |
1126 | PM3Render2D_Width(w) | PM3Render2D_Height(h), | |
1127 | PM3Render2D); | |
1128 | - TRACE_EXIT("Permedia3SubsequentCPUToScreenColorExpandFill"); | |
1129 | + | |
1130 | +#ifdef __alpha__ | |
1131 | + if (0) /* force ALPHA to use indirect always */ | |
1132 | +#else | |
1133 | + if ((pGlint->dwords*h) < MAX_FIFO_ENTRIES) | |
1134 | +#endif | |
1135 | + { | |
1136 | + /* Turn on direct for less than 120 dword colour expansion */ | |
1137 | + pGlint->XAAScanlineColorExpandBuffers[0] = pGlint->IOBase+OutputFIFO+4; | |
1138 | + pGlint->ScanlineDirect = 1; | |
1139 | + GLINT_WRITE_REG(((pGlint->dwords*h)-1)<<16 | 0x0D, OutputFIFO); | |
1140 | + GLINT_WAIT(pGlint->dwords*h); | |
1141 | + } else { | |
1142 | + /* Use indirect for anything else */ | |
1143 | + pGlint->XAAScanlineColorExpandBuffers[0] = pGlint->ScratchBuffer; | |
1144 | + pGlint->ScanlineDirect = 0; | |
1145 | + } | |
1146 | + | |
1147 | + pGlint->cpucount--; | |
1148 | } | |
1149 | ||
1150 | +static void | |
1151 | +Permedia3SubsequentColorExpandScanline(ScrnInfoPtr pScrn, int bufno) | |
1152 | +{ | |
1153 | + GLINTPtr pGlint = GLINTPTR(pScrn); | |
1154 | + CARD32 *srcp = (CARD32*)pGlint->XAAScanlineColorExpandBuffers[bufno]; | |
1155 | + int dwords = pGlint->dwords; | |
1156 | + | |
1157 | + if (!pGlint->ScanlineDirect) { | |
1158 | + while(dwords >= MAX_FIFO_ENTRIES) { | |
1159 | + GLINT_WAIT(MAX_FIFO_ENTRIES); | |
1160 | + GLINT_WRITE_REG(((MAX_FIFO_ENTRIES - 2) << 16) | 0x0D, OutputFIFO); | |
1161 | + GLINT_MoveDWORDS( | |
1162 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1163 | + (CARD32*)srcp, MAX_FIFO_ENTRIES - 1); | |
1164 | + dwords -= MAX_FIFO_ENTRIES - 1; | |
1165 | + srcp += MAX_FIFO_ENTRIES - 1; | |
1166 | + } | |
1167 | + if(dwords) { | |
1168 | + GLINT_WAIT(dwords + 1); | |
1169 | + GLINT_WRITE_REG(((dwords - 1) << 16) | 0x0D, OutputFIFO); | |
1170 | + GLINT_MoveDWORDS( | |
1171 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1172 | + (CARD32*)srcp, dwords); | |
1173 | + } | |
1174 | + } | |
1175 | +} | |
1176 | ||
1177 | /* Images Writes */ | |
1178 | -static void Permedia3SetupForImageWrite(ScrnInfoPtr pScrn, int rop, | |
1179 | +static void Permedia3SetupForScanlineImageWrite(ScrnInfoPtr pScrn, int rop, | |
1180 | unsigned int planemask, int trans_color, int bpp, int depth) | |
1181 | { | |
1182 | GLINTPtr pGlint = GLINTPTR(pScrn); | |
1183 | - TRACE_ENTER("Permedia3SetupForImageWrite"); | |
1184 | + TRACE_ENTER("Permedia3SetupForScanlineImageWrite"); | |
1185 | pGlint->PM3_Render2D = | |
1186 | PM3Render2D_SpanOperation | | |
1187 | PM3Render2D_XPositive | | |
1188 | @@ -771,14 +841,18 @@ | |
1189 | GLINT_WAIT(2); | |
1190 | DO_PLANEMASK(planemask); | |
1191 | GLINT_WRITE_REG(pGlint->PM3_Config2D, PM3Config2D); | |
1192 | - TRACE_EXIT("Permedia3SetupForImageWrite"); | |
1193 | + TRACE_EXIT("Permedia3SetupForScanlineImageWrite"); | |
1194 | } | |
1195 | -static void Permedia3SubsequentImageWriteRect(ScrnInfoPtr pScrn, | |
1196 | + | |
1197 | +static void Permedia3SubsequentScanlineImageWriteRect(ScrnInfoPtr pScrn, | |
1198 | int x, int y, int w, int h, int skipleft) | |
1199 | { | |
1200 | GLINTPtr pGlint = GLINTPTR(pScrn); | |
1201 | - TRACE_ENTER("Permedia3SubsequentImageWrite"); | |
1202 | - GLINT_WAIT(4); | |
1203 | + TRACE_ENTER("Permedia3SubsequentScanlineImageWrite"); | |
1204 | + pGlint->dwords = (((w * pScrn->bitsPerPixel) + 3) >> 2); /* per scanline */ | |
1205 | + | |
1206 | + pGlint->cpucount = h; | |
1207 | + GLINT_WAIT(5); | |
1208 | GLINT_WRITE_REG(((y&0x0fff)<<16)|((x+skipleft)&0x0fff), ScissorMinXY); | |
1209 | GLINT_WRITE_REG((((y+h)&0x0fff)<<16)|((x+w)&0x0fff), ScissorMaxXY); | |
1210 | GLINT_WRITE_REG( | |
1211 | @@ -788,18 +862,63 @@ | |
1212 | GLINT_WRITE_REG(pGlint->PM3_Render2D | | |
1213 | PM3Render2D_Width(w) | PM3Render2D_Height(h), | |
1214 | PM3Render2D); | |
1215 | - TRACE_EXIT("Permedia3SubsequentImageWrite"); | |
1216 | -} | |
1217 | ||
1218 | +#ifdef __alpha__ | |
1219 | + if (0) /* force ALPHA to use indirect always */ | |
1220 | +#else | |
1221 | + if (pGlint->dwords < MAX_FIFO_ENTRIES) | |
1222 | +#endif | |
1223 | + { | |
1224 | + /* Turn on direct for less than 120 dword colour expansion */ | |
1225 | + pGlint->XAAScanlineColorExpandBuffers[0] = pGlint->IOBase+OutputFIFO+4; | |
1226 | + pGlint->ScanlineDirect = 1; | |
1227 | + GLINT_WRITE_REG(((pGlint->dwords*h)-1)<<16 | (0x15<<4) | 0x05, | |
1228 | + OutputFIFO); | |
1229 | + GLINT_WAIT(pGlint->dwords); | |
1230 | + } else { | |
1231 | + /* Use indirect for anything else */ | |
1232 | + pGlint->XAAScanlineColorExpandBuffers[0] = pGlint->ScratchBuffer; | |
1233 | + pGlint->ScanlineDirect = 0; | |
1234 | + } | |
1235 | ||
1236 | -/* Defines for Direct Fifo access */ | |
1237 | + pGlint->cpucount--; | |
1238 | + TRACE_EXIT("Permedia3SubsequentScanlineImageWrite"); | |
1239 | +} | |
1240 | ||
1241 | -#define WriteRange 120 | |
1242 | -#define PciRetryWriteRange 1023 | |
1243 | -#define WriteBase_Fixed ((CARD32 *)(pGlint->IOBase + PM3FBSourceData)) | |
1244 | -#define WriteBase ((CARD32 *)(pGlint->IOBase + OutputFIFO + 4)) | |
1245 | +static void | |
1246 | +Permedia3SubsequentImageWriteScanline(ScrnInfoPtr pScrn, int bufno) | |
1247 | +{ | |
1248 | + GLINTPtr pGlint = GLINTPTR(pScrn); | |
1249 | + int dwords = pGlint->dwords; | |
1250 | ||
1251 | -/* Direct Fifo Bitmap Writes */ | |
1252 | + if (pGlint->ScanlineDirect) { | |
1253 | + if (pGlint->cpucount--) | |
1254 | + GLINT_WAIT(dwords); | |
1255 | + return; | |
1256 | + } else { | |
1257 | + while(dwords >= MAX_FIFO_ENTRIES) { | |
1258 | + GLINT_WAIT(MAX_FIFO_ENTRIES); | |
1259 | + GLINT_WRITE_REG(((MAX_FIFO_ENTRIES - 2) << 16) | (0x15 << 4) | | |
1260 | + 0x05, OutputFIFO); | |
1261 | + GLINT_MoveDWORDS( | |
1262 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1263 | + (CARD32*)pGlint->XAAScanlineColorExpandBuffers[bufno], | |
1264 | + MAX_FIFO_ENTRIES - 1); | |
1265 | + dwords -= MAX_FIFO_ENTRIES - 1; | |
1266 | + } | |
1267 | + if(dwords) { | |
1268 | + GLINT_WAIT(dwords + 1); | |
1269 | + GLINT_WRITE_REG(((dwords - 1) << 16) | (0x15 << 4) | | |
1270 | + 0x05, OutputFIFO); | |
1271 | + GLINT_MoveDWORDS( | |
1272 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1273 | + (CARD32*)pGlint->XAAScanlineColorExpandBuffers[bufno], | |
1274 | + dwords); | |
1275 | + } | |
1276 | + } | |
1277 | +} | |
1278 | + | |
1279 | +/* Bitmap Writes */ | |
1280 | ||
1281 | static void | |
1282 | Permedia3WriteBitmap(ScrnInfoPtr pScrn, | |
1283 | @@ -810,59 +929,85 @@ | |
1284 | unsigned int planemask | |
1285 | ) | |
1286 | { | |
1287 | - int dwords; | |
1288 | - int ApertureRange; | |
1289 | + int dwords, count; | |
1290 | + CARD32 *srcp; | |
1291 | GLINTPtr pGlint = GLINTPTR(pScrn); | |
1292 | TRACE_ENTER("Permedia3WriteBitmap"); | |
1293 | ||
1294 | w += skipleft; | |
1295 | x -= skipleft; | |
1296 | - dwords = (w + 31) >>5; | |
1297 | - if (pGlint->UsePCIRetry) ApertureRange = PciRetryWriteRange; | |
1298 | - else ApertureRange = WriteRange; | |
1299 | ||
1300 | /* width of the stuff to copy in 32 bit words */ | |
1301 | - Permedia3SetupForCPUToScreenColorExpandFill(pScrn, fg, bg, rop, planemask); | |
1302 | - Permedia3SubsequentCPUToScreenColorExpandFill(pScrn, x, y, w, h, skipleft); | |
1303 | + dwords = (w + 31) >>5; | |
1304 | ||
1305 | - if (dwords > ApertureRange) { | |
1306 | - while(h--) { | |
1307 | - XAAMoveDWORDS_FixedBase(WriteBase_Fixed, (CARD32*)src, dwords); | |
1308 | - src += srcwidth; | |
1309 | - } | |
1310 | - } else { | |
1311 | - /* the src is exatcly as wide as the target rectangle. We copy all | |
1312 | - * of it, so no need to separate stuff by scanline */ | |
1313 | - if(srcwidth == (dwords << 5)) { | |
1314 | - /* decrement contains the number of lines that can be | |
1315 | - * put in the fifo */ | |
1316 | - int decrement = ApertureRange/dwords; | |
1317 | - | |
1318 | - while(h > decrement) { | |
1319 | - GLINT_WAIT(dwords * decrement); | |
1320 | - GLINT_WRITE_REG((((dwords * decrement)-1) << 16) | 0xd, | |
1321 | - OutputFIFO); | |
1322 | - XAAMoveDWORDS(WriteBase, (CARD32*)src, dwords * decrement); | |
1323 | - src += (srcwidth * decrement); | |
1324 | - h -= decrement; | |
1325 | - } | |
1326 | - if(h) { | |
1327 | - GLINT_WAIT(dwords * h); | |
1328 | - GLINT_WRITE_REG((((dwords * h)-1) << 16) | 0xd, OutputFIFO); | |
1329 | - XAAMoveDWORDS(WriteBase, (CARD32*)src, dwords * h); | |
1330 | - } | |
1331 | - } else { | |
1332 | - while(h--) { | |
1333 | - GLINT_WAIT(dwords); | |
1334 | - GLINT_WRITE_REG(((dwords-1) << 16) | 0xd, OutputFIFO); | |
1335 | - XAAMoveDWORDS(WriteBase, (CARD32*)src, dwords); | |
1336 | - src += srcwidth; | |
1337 | - } | |
1338 | - } | |
1339 | + REPLICATE(fg); | |
1340 | + pGlint->PM3_Render2D = | |
1341 | + PM3Render2D_SpanOperation | | |
1342 | + PM3Render2D_XPositive | | |
1343 | + PM3Render2D_YPositive | | |
1344 | + PM3Render2D_Operation_SyncOnBitMask; | |
1345 | + pGlint->PM3_Config2D = | |
1346 | + PM3Config2D_UserScissorEnable | | |
1347 | + PM3Config2D_UseConstantSource | | |
1348 | + PM3Config2D_ForegroundROPEnable | | |
1349 | + PM3Config2D_ForegroundROP(rop) | | |
1350 | + PM3Config2D_FBWriteEnable; | |
1351 | + if ((rop!=GXclear)&&(rop!=GXset)&&(rop!=GXcopy)&&(rop!=GXcopyInverted)) | |
1352 | + pGlint->PM3_Config2D |= PM3Config2D_FBDestReadEnable; | |
1353 | + if (bg != -1) { | |
1354 | + REPLICATE(bg); | |
1355 | + pGlint->PM3_Config2D |= PM3Config2D_OpaqueSpan; | |
1356 | + GLINT_WAIT(8); | |
1357 | + GLINT_WRITE_REG(bg, BackgroundColor); | |
1358 | + } | |
1359 | + else GLINT_WAIT(7); | |
1360 | + GLINT_WRITE_REG(fg, PM3ForegroundColor); | |
1361 | + DO_PLANEMASK(planemask); | |
1362 | + GLINT_WRITE_REG(pGlint->PM3_Config2D, PM3Config2D); | |
1363 | + GLINT_WRITE_REG(((y&0x0fff)<<16)|((x+skipleft)&0x0fff), ScissorMinXY); | |
1364 | + GLINT_WRITE_REG((((y+h)&0x0fff)<<16)|((x+w)&0x0fff), ScissorMaxXY); | |
1365 | + GLINT_WRITE_REG( | |
1366 | + PM3RectanglePosition_XOffset(x) | | |
1367 | + PM3RectanglePosition_YOffset(y), | |
1368 | + PM3RectanglePosition); | |
1369 | + GLINT_WRITE_REG(pGlint->PM3_Render2D | | |
1370 | + PM3Render2D_Width(w) | PM3Render2D_Height(h), | |
1371 | + PM3Render2D); | |
1372 | + | |
1373 | +#ifdef __alpha__ | |
1374 | + mem_barrier(); /* dunno why, but this helps on older Alpha CPUs */ | |
1375 | +#endif | |
1376 | + | |
1377 | + while(h--) { | |
1378 | + count = dwords; | |
1379 | + srcp = (CARD32*)src; | |
1380 | + while(count >= MAX_FIFO_ENTRIES) { | |
1381 | + GLINT_WAIT(MAX_FIFO_ENTRIES); | |
1382 | + GLINT_WRITE_REG(((MAX_FIFO_ENTRIES - 2) << 16) | | |
1383 | + 0x0D, OutputFIFO); | |
1384 | + GLINT_MoveDWORDS( | |
1385 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1386 | + (CARD32*)srcp, MAX_FIFO_ENTRIES - 1); | |
1387 | + count -= MAX_FIFO_ENTRIES - 1; | |
1388 | + srcp += MAX_FIFO_ENTRIES - 1; | |
1389 | + } | |
1390 | + if(count) { | |
1391 | + GLINT_WAIT(count + 1); | |
1392 | + GLINT_WRITE_REG(((count - 1) << 16) | 0x0D, OutputFIFO); | |
1393 | + GLINT_MoveDWORDS( | |
1394 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1395 | + (CARD32*)srcp, count); | |
1396 | + } | |
1397 | + src += srcwidth; | |
1398 | } | |
1399 | + | |
1400 | + Permedia3DisableClipping(pScrn); | |
1401 | + Permedia3Sync(pScrn); | |
1402 | + | |
1403 | TRACE_EXIT("Permedia3WriteBitmap"); | |
1404 | } | |
1405 | -/* Direct Fifo Images Writes */ | |
1406 | + | |
1407 | +/* Pixmap Writes */ | |
1408 | ||
1409 | static void | |
1410 | Permedia3WritePixmap( | |
1411 | @@ -876,10 +1021,10 @@ | |
1412 | int bpp, int depth | |
1413 | ) | |
1414 | { | |
1415 | - int dwords; | |
1416 | + int dwords, count; | |
1417 | int skipleft = (long)src & 0x03L; | |
1418 | int Bpp = bpp >> 3; | |
1419 | - int ApertureRange; | |
1420 | + CARD32 *srcp; | |
1421 | GLINTPtr pGlint = GLINTPTR(pScrn); | |
1422 | TRACE_ENTER("Permedia3WritePixmap"); | |
1423 | ||
1424 | @@ -896,48 +1041,67 @@ | |
1425 | ||
1426 | src = (unsigned char*)((long)src & ~0x03L); | |
1427 | } | |
1428 | - Permedia3SetupForImageWrite(pScrn, rop, planemask, trans, bpp, depth); | |
1429 | - Permedia3SubsequentImageWriteRect(pScrn, x, y, w, h, skipleft); | |
1430 | + | |
1431 | + pGlint->PM3_Render2D = | |
1432 | + PM3Render2D_SpanOperation | | |
1433 | + PM3Render2D_XPositive | | |
1434 | + PM3Render2D_YPositive | | |
1435 | + PM3Render2D_Operation_SyncOnHostData; | |
1436 | + pGlint->PM3_Config2D = | |
1437 | + PM3Config2D_UserScissorEnable | | |
1438 | + PM3Config2D_ForegroundROPEnable | | |
1439 | + PM3Config2D_ForegroundROP(rop) | | |
1440 | + PM3Config2D_FBWriteEnable; | |
1441 | + if ((rop!=GXclear)&&(rop!=GXset)&&(rop!=GXcopy)&&(rop!=GXcopyInverted)) | |
1442 | + pGlint->PM3_Config2D |= PM3Config2D_FBDestReadEnable; | |
1443 | + GLINT_WAIT(6); | |
1444 | + DO_PLANEMASK(planemask); | |
1445 | + GLINT_WRITE_REG(pGlint->PM3_Config2D, PM3Config2D); | |
1446 | + GLINT_WRITE_REG(((y&0x0fff)<<16)|((x+skipleft)&0x0fff), ScissorMinXY); | |
1447 | + GLINT_WRITE_REG((((y+h)&0x0fff)<<16)|((x+w)&0x0fff), ScissorMaxXY); | |
1448 | + GLINT_WRITE_REG( | |
1449 | + PM3RectanglePosition_XOffset(x) | | |
1450 | + PM3RectanglePosition_YOffset(y), | |
1451 | + PM3RectanglePosition); | |
1452 | + GLINT_WRITE_REG(pGlint->PM3_Render2D | | |
1453 | + PM3Render2D_Width(w) | PM3Render2D_Height(h), | |
1454 | + PM3Render2D); | |
1455 | + | |
1456 | +#ifdef __alpha__ | |
1457 | + mem_barrier(); /* dunno why, but this helps on older Alpha CPUs */ | |
1458 | +#endif | |
1459 | ||
1460 | /* width of the stuff to copy in 32 bit words */ | |
1461 | dwords = ((w * Bpp) + 3) >> 2; | |
1462 | - if (pGlint->UsePCIRetry) ApertureRange = PciRetryWriteRange; | |
1463 | - else ApertureRange = WriteRange; | |
1464 | ||
1465 | - if (dwords > ApertureRange) { | |
1466 | - while(h--) { | |
1467 | - XAAMoveDWORDS_FixedBase(WriteBase_Fixed, (CARD32*)src, dwords); | |
1468 | - src += srcwidth; | |
1469 | - } | |
1470 | - } else { | |
1471 | - /* the src is exatcly as wide as the target rectangle. We copy all | |
1472 | - * of it, so no need to separate stuff by scanline */ | |
1473 | - if(srcwidth == (dwords << 2)) { | |
1474 | - /* decrement contains the number of lines that can be | |
1475 | - * put in the fifo */ | |
1476 | - int decrement = ApertureRange/dwords; | |
1477 | - | |
1478 | - while(h > decrement) { | |
1479 | - GLINT_WAIT(dwords * decrement); | |
1480 | - GLINT_WRITE_REG((((dwords * decrement)-1) << 16) | 0x155, | |
1481 | - OutputFIFO); | |
1482 | - XAAMoveDWORDS(WriteBase, (CARD32*)src, dwords * decrement); | |
1483 | - src += (srcwidth * decrement); | |
1484 | - h -= decrement; | |
1485 | - } | |
1486 | - if(h) { | |
1487 | - GLINT_WAIT(dwords * h); | |
1488 | - GLINT_WRITE_REG((((dwords * h)-1) << 16) | 0x155, OutputFIFO); | |
1489 | - XAAMoveDWORDS(WriteBase, (CARD32*)src, dwords * h); | |
1490 | - } | |
1491 | - } else { | |
1492 | - while(h--) { | |
1493 | - GLINT_WAIT(dwords); | |
1494 | - GLINT_WRITE_REG(((dwords-1) << 16) | 0x155, OutputFIFO); | |
1495 | - XAAMoveDWORDS(WriteBase, (CARD32*)src, dwords); | |
1496 | - src += srcwidth; | |
1497 | - } | |
1498 | - } | |
1499 | + while(h--) { | |
1500 | + count = dwords; | |
1501 | + srcp = (CARD32*)src; | |
1502 | + while(count >= MAX_FIFO_ENTRIES) { | |
1503 | + GLINT_WAIT(MAX_FIFO_ENTRIES); | |
1504 | + /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */ | |
1505 | + GLINT_WRITE_REG(((MAX_FIFO_ENTRIES - 2) << 16) | (0x15 << 4) | | |
1506 | + 0x05, OutputFIFO); | |
1507 | + GLINT_MoveDWORDS( | |
1508 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1509 | + (CARD32*)srcp, MAX_FIFO_ENTRIES - 1); | |
1510 | + count -= MAX_FIFO_ENTRIES - 1; | |
1511 | + srcp += MAX_FIFO_ENTRIES - 1; | |
1512 | + } | |
1513 | + if(count) { | |
1514 | + GLINT_WAIT(count + 1); | |
1515 | + /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */ | |
1516 | + GLINT_WRITE_REG(((count - 1) << 16) | (0x15 << 4) | | |
1517 | + 0x05, OutputFIFO); | |
1518 | + GLINT_MoveDWORDS( | |
1519 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1520 | + (CARD32*)srcp, count); | |
1521 | + } | |
1522 | + src += srcwidth; | |
1523 | } | |
1524 | + | |
1525 | + Permedia3DisableClipping(pScrn); | |
1526 | + Permedia3Sync(pScrn); | |
1527 | + | |
1528 | TRACE_EXIT("Permedia3WritePixmap"); | |
1529 | } | |
1530 | diff -ur xc.orig/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c | |
1531 | --- xc.orig/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c Sat Mar 17 17:57:15 2001 | |
1532 | +++ xc/programs/Xserver/hw/xfree86/drivers/glint/pm3_dac.c Sun Mar 18 21:35:54 2001 | |
1533 | @@ -320,7 +320,7 @@ | |
1534 | pReg->glintRegs[VClkCtl >> 3] = (GLINT_READ_REG(VClkCtl) & 0xFFFFFFFC); | |
1535 | pReg->glintRegs[PMScreenBase >> 3] = 0; | |
1536 | ||
1537 | - pReg->glintRegs[ChipConfig >> 3] = GLINT_READ_REG(ChipConfig) & 0xFFFFFFDD; | |
1538 | + pReg->glintRegs[ChipConfig >> 3] = GLINT_READ_REG(ChipConfig) & 0xFFFFFFFD; | |
1539 | pReg->DacRegs[PM2VDACRDDACControl] = 0x00; | |
1540 | ||
1541 | { | |
1542 | @@ -524,4 +524,80 @@ | |
1543 | Permedia2vOutIndReg(pScrn, PM2VDACRDDClk0PostScale, 0x00, | |
1544 | glintReg->DacRegs[PM2VDACRDDClk0PostScale]); | |
1545 | Permedia2vOutIndReg(pScrn, PM2VDACIndexClockControl, 0x00, temp|0x03); | |
1546 | +} | |
1547 | + | |
1548 | +void Permedia3LoadPalette( | |
1549 | + ScrnInfoPtr pScrn, | |
1550 | + int numColors, | |
1551 | + int *indices, | |
1552 | + LOCO *colors, | |
1553 | + VisualPtr pVisual | |
1554 | +){ | |
1555 | +#if 0 /* NOT YET */ | |
1556 | + GLINTPtr pGlint = GLINTPTR(pScrn); | |
1557 | +#endif | |
1558 | + int i, index, shift = 0, j, repeat = 1; | |
1559 | + | |
1560 | + if (pScrn->depth == 15) { | |
1561 | + repeat = 8; | |
1562 | + shift = 3; | |
1563 | + } | |
1564 | + | |
1565 | + for(i = 0; i < numColors; i++) { | |
1566 | + index = indices[i]; | |
1567 | + for (j = 0; j < repeat; j++) { | |
1568 | + Permedia2WriteAddress(pScrn, (index << shift)+j); | |
1569 | + Permedia2WriteData(pScrn, colors[index].red); | |
1570 | + Permedia2WriteData(pScrn, colors[index].green); | |
1571 | + Permedia2WriteData(pScrn, colors[index].blue); | |
1572 | + } | |
1573 | + /* for video i/o */ | |
1574 | +#if 0 /* NOT YET */ | |
1575 | + GLINT_SLOW_WRITE_REG(index, PM3LUTIndex); | |
1576 | + GLINT_SLOW_WRITE_REG((colors[index].red & 0xFF) | | |
1577 | + ((colors[index].green & 0xFF) << 8) | | |
1578 | + ((colors[index].blue & 0xFF) << 16), | |
1579 | + PM3LUTData); | |
1580 | +#endif | |
1581 | + } | |
1582 | +} | |
1583 | + | |
1584 | +/* special one for 565 mode */ | |
1585 | +void Permedia3LoadPalette16( | |
1586 | + ScrnInfoPtr pScrn, | |
1587 | + int numColors, | |
1588 | + int *indices, | |
1589 | + LOCO *colors, | |
1590 | + VisualPtr pVisual | |
1591 | +){ | |
1592 | +#if 0 /* NOT YET */ | |
1593 | + GLINTPtr pGlint = GLINTPTR(pScrn); | |
1594 | +#endif | |
1595 | + int i, index, j; | |
1596 | + | |
1597 | + for(i = 0; i < numColors; i++) { | |
1598 | + index = indices[i]; | |
1599 | + for (j = 0; j < 4; j++) { | |
1600 | + Permedia2WriteAddress(pScrn, (index << 2)+j); | |
1601 | + Permedia2WriteData(pScrn, colors[index >> 1].red); | |
1602 | + Permedia2WriteData(pScrn, colors[index].green); | |
1603 | + Permedia2WriteData(pScrn, colors[index >> 1].blue); | |
1604 | + } | |
1605 | +#if 0 /* NOT YET */ | |
1606 | + GLINT_SLOW_WRITE_REG(index, PM3LUTIndex); | |
1607 | + GLINT_SLOW_WRITE_REG((colors[index].red & 0xFF) | | |
1608 | + ((colors[index].green & 0xFF) << 8) | | |
1609 | + ((colors[index].blue & 0xFF) << 16), | |
1610 | + PM3LUTData); | |
1611 | +#endif | |
1612 | + | |
1613 | + if(index <= 31) { | |
1614 | + for (j = 0; j < 4; j++) { | |
1615 | + Permedia2WriteAddress(pScrn, (index << 3)+j); | |
1616 | + Permedia2WriteData(pScrn, colors[index].red); | |
1617 | + Permedia2WriteData(pScrn, colors[(index << 1) + 1].green); | |
1618 | + Permedia2WriteData(pScrn, colors[index].blue); | |
1619 | + } | |
1620 | + } | |
1621 | + } | |
1622 | } | |
1623 | diff -ur xc.orig/programs/Xserver/hw/xfree86/drivers/glint/pm_accel.c xc/programs/Xserver/hw/xfree86/drivers/glint/pm_accel.c | |
1624 | --- xc.orig/programs/Xserver/hw/xfree86/drivers/glint/pm_accel.c Sat Jun 24 14:19:55 2000 | |
1625 | +++ xc/programs/Xserver/hw/xfree86/drivers/glint/pm_accel.c Sun Mar 18 16:57:17 2001 | |
1626 | @@ -301,62 +301,6 @@ | |
1627 | return (XAAInit(pScreen, infoPtr)); | |
1628 | } | |
1629 | ||
1630 | -static void MoveBYTE( | |
1631 | - register CARD32* dest, | |
1632 | - register unsigned char* src, | |
1633 | - register int dwords | |
1634 | -) | |
1635 | -{ | |
1636 | - while(dwords) { | |
1637 | - *dest = *src; | |
1638 | - src += 1; | |
1639 | - dest += 1; | |
1640 | - dwords -= 1; | |
1641 | - } | |
1642 | -} | |
1643 | - | |
1644 | -static void MoveWORDS( | |
1645 | - register CARD32* dest, | |
1646 | - register unsigned short* src, | |
1647 | - register int dwords | |
1648 | -) | |
1649 | -{ | |
1650 | - while(dwords & ~0x01) { | |
1651 | - *dest = *src; | |
1652 | - *(dest + 1) = *(src + 1); | |
1653 | - src += 2; | |
1654 | - dest += 2; | |
1655 | - dwords -= 2; | |
1656 | - } | |
1657 | - switch(dwords) { | |
1658 | - case 0: return; | |
1659 | - case 1: *dest = *src; | |
1660 | - return; | |
1661 | - } | |
1662 | -} | |
1663 | - | |
1664 | -static void MoveDWORDS( | |
1665 | - register CARD32* dest, | |
1666 | - register CARD32* src, | |
1667 | - register int dwords ) | |
1668 | -{ | |
1669 | - while(dwords & ~0x03) { | |
1670 | - *dest = *src; | |
1671 | - *(dest + 1) = *(src + 1); | |
1672 | - *(dest + 2) = *(src + 2); | |
1673 | - *(dest + 3) = *(src + 3); | |
1674 | - src += 4; | |
1675 | - dest += 4; | |
1676 | - dwords -= 4; | |
1677 | - } | |
1678 | - if (!dwords) return; | |
1679 | - *dest = *src; | |
1680 | - if (dwords == 1) return; | |
1681 | - *(dest + 1) = *(src + 1); | |
1682 | - if (dwords == 2) return; | |
1683 | - *(dest + 2) = *(src + 2); | |
1684 | -} | |
1685 | - | |
1686 | static void PermediaLoadCoord( | |
1687 | ScrnInfoPtr pScrn, | |
1688 | int x, int y, | |
1689 | @@ -779,15 +723,16 @@ | |
1690 | while (dwords >= infoRec->ColorExpandRange) { | |
1691 | GLINT_WAIT(infoRec->ColorExpandRange); | |
1692 | GLINT_WRITE_REG((infoRec->ColorExpandRange - 2)<<16 | 0x0D, OutputFIFO); | |
1693 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), src, | |
1694 | - infoRec->ColorExpandRange - 1); | |
1695 | + GLINT_MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1696 | + src, infoRec->ColorExpandRange - 1); | |
1697 | dwords -= (infoRec->ColorExpandRange - 1); | |
1698 | src += (infoRec->ColorExpandRange - 1); | |
1699 | } | |
1700 | if (dwords) { | |
1701 | GLINT_WAIT(dwords); | |
1702 | GLINT_WRITE_REG((dwords - 1)<<16 | 0x0D, OutputFIFO); | |
1703 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), src,dwords); | |
1704 | + GLINT_MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1705 | + src,dwords); | |
1706 | } | |
1707 | pGlint->cpucount += 1; | |
1708 | #if 0 | |
1709 | @@ -915,7 +860,8 @@ | |
1710 | /* (0x11 << 4) | 0x0D is the TAG for TextureData */ | |
1711 | GLINT_WRITE_REG(((infoRec->ColorExpandRange - 2) << 16) | |
1712 | | (0x11 << 4) | 0x0D, OutputFIFO); | |
1713 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1714 | + GLINT_MoveDWORDS( | |
1715 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1716 | (CARD32*)srcp, infoRec->ColorExpandRange - 1); | |
1717 | count -= infoRec->ColorExpandRange - 1; | |
1718 | address += infoRec->ColorExpandRange - 1; | |
1719 | @@ -926,7 +872,8 @@ | |
1720 | /* (0x11 << 4) | 0x0D is the TAG for TextureData */ | |
1721 | GLINT_WRITE_REG(((count - 1) << 16) | (0x11 << 4) | 0x0D, | |
1722 | OutputFIFO); | |
1723 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1724 | + GLINT_MoveDWORDS( | |
1725 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1726 | (CARD32*)srcp, count); | |
1727 | } | |
1728 | src += srcwidth; | |
1729 | @@ -955,7 +902,8 @@ | |
1730 | /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */ | |
1731 | GLINT_WRITE_REG(((infoRec->ColorExpandRange - 2) << 16) | | |
1732 | (0x15 << 4) | 0x05, OutputFIFO); | |
1733 | - MoveBYTE((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1734 | + GLINT_MoveBYTES( | |
1735 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1736 | (unsigned char *)srcpbyte, infoRec->ColorExpandRange-1); | |
1737 | count -= infoRec->ColorExpandRange - 1; | |
1738 | srcpbyte += infoRec->ColorExpandRange - 1; | |
1739 | @@ -965,7 +913,8 @@ | |
1740 | /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */ | |
1741 | GLINT_WRITE_REG(((count - 1) << 16) | (0x15 << 4) | | |
1742 | 0x05, OutputFIFO); | |
1743 | - MoveBYTE((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1744 | + GLINT_MoveBYTES( | |
1745 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1746 | (unsigned char *)srcpbyte, count); | |
1747 | } | |
1748 | src += srcwidth; | |
1749 | @@ -1038,7 +987,8 @@ | |
1750 | /* (0x11 << 4) | 0x0D is the TAG for TextureData */ | |
1751 | GLINT_WRITE_REG(((infoRec->ColorExpandRange - 2) << 16) | | |
1752 | (0x11 << 4) | 0x0D, OutputFIFO); | |
1753 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1754 | + GLINT_MoveDWORDS( | |
1755 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1756 | (CARD32*)srcp, infoRec->ColorExpandRange - 1); | |
1757 | count -= infoRec->ColorExpandRange - 1; | |
1758 | address += infoRec->ColorExpandRange - 1; | |
1759 | @@ -1049,7 +999,8 @@ | |
1760 | /* (0x11 << 4) | 0x0D is the TAG for TextureData */ | |
1761 | GLINT_WRITE_REG(((count - 1) << 16) | (0x11 << 4) | 0x0D, | |
1762 | OutputFIFO); | |
1763 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1764 | + GLINT_MoveDWORDS( | |
1765 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1766 | (CARD32*)srcp, count); | |
1767 | } | |
1768 | src += srcwidth; | |
1769 | @@ -1078,7 +1029,8 @@ | |
1770 | /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */ | |
1771 | GLINT_WRITE_REG(((infoRec->ColorExpandRange - 2) << 16) | | |
1772 | (0x15 << 4) | 0x05, OutputFIFO); | |
1773 | - MoveWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1774 | + GLINT_MoveWORDS( | |
1775 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1776 | (unsigned short *)srcpword,infoRec->ColorExpandRange-1); | |
1777 | count -= infoRec->ColorExpandRange - 1; | |
1778 | srcpword += infoRec->ColorExpandRange - 1; | |
1779 | @@ -1088,7 +1040,8 @@ | |
1780 | /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */ | |
1781 | GLINT_WRITE_REG(((count - 1) << 16) | (0x15 << 4) | | |
1782 | 0x05, OutputFIFO); | |
1783 | - MoveWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1784 | + GLINT_MoveWORDS( | |
1785 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1786 | (unsigned short *)srcpword, count); | |
1787 | } | |
1788 | src += srcwidth; | |
1789 | @@ -1162,7 +1115,8 @@ | |
1790 | /* (0x11 << 4) | 0x0D is the TAG for TextureData */ | |
1791 | GLINT_WRITE_REG(((infoRec->ColorExpandRange - 2) << 16) | | |
1792 | (0x11 << 4) | 0x0D, OutputFIFO); | |
1793 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1794 | + GLINT_MoveDWORDS( | |
1795 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1796 | (CARD32*)srcp, infoRec->ColorExpandRange - 1); | |
1797 | count -= infoRec->ColorExpandRange - 1; | |
1798 | address += infoRec->ColorExpandRange - 1; | |
1799 | @@ -1173,7 +1127,8 @@ | |
1800 | /* (0x11 << 4) | 0x0D is the TAG for TextureData */ | |
1801 | GLINT_WRITE_REG(((count - 1) << 16) | (0x11 << 4) | 0x0D, | |
1802 | OutputFIFO); | |
1803 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1804 | + GLINT_MoveDWORDS( | |
1805 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1806 | (CARD32*)srcp, count); | |
1807 | } | |
1808 | src += srcwidth; | |
1809 | @@ -1196,7 +1151,8 @@ | |
1810 | /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */ | |
1811 | GLINT_WRITE_REG(((infoRec->ColorExpandRange - 2) << 16) | | |
1812 | (0x15 << 4) | 0x05, OutputFIFO); | |
1813 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1814 | + GLINT_MoveDWORDS( | |
1815 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1816 | (CARD32*)srcp, infoRec->ColorExpandRange - 1); | |
1817 | count -= infoRec->ColorExpandRange - 1; | |
1818 | srcp += infoRec->ColorExpandRange - 1; | |
1819 | @@ -1206,7 +1162,8 @@ | |
1820 | /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */ | |
1821 | GLINT_WRITE_REG(((count - 1) << 16) | (0x15 << 4) | | |
1822 | 0x05, OutputFIFO); | |
1823 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1824 | + GLINT_MoveDWORDS( | |
1825 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1826 | (CARD32*)srcp, count); | |
1827 | } | |
1828 | src += srcwidth; | |
1829 | diff -ur xc.orig/programs/Xserver/hw/xfree86/drivers/glint/sx_accel.c xc/programs/Xserver/hw/xfree86/drivers/glint/sx_accel.c | |
1830 | --- xc.orig/programs/Xserver/hw/xfree86/drivers/glint/sx_accel.c Wed Apr 12 10:44:41 2000 | |
1831 | +++ xc/programs/Xserver/hw/xfree86/drivers/glint/sx_accel.c Sun Mar 18 16:57:36 2001 | |
1832 | @@ -298,28 +298,6 @@ | |
1833 | } | |
1834 | } | |
1835 | ||
1836 | -static void MoveDWORDS( | |
1837 | - register CARD32* dest, | |
1838 | - register CARD32* src, | |
1839 | - register int dwords ) | |
1840 | -{ | |
1841 | - while(dwords & ~0x03) { | |
1842 | - *dest = *src; | |
1843 | - *(dest + 1) = *(src + 1); | |
1844 | - *(dest + 2) = *(src + 2); | |
1845 | - *(dest + 3) = *(src + 3); | |
1846 | - src += 4; | |
1847 | - dest += 4; | |
1848 | - dwords -= 4; | |
1849 | - } | |
1850 | - if (!dwords) return; | |
1851 | - *dest = *src; | |
1852 | - if (dwords == 1) return; | |
1853 | - *(dest + 1) = *(src + 1); | |
1854 | - if (dwords == 2) return; | |
1855 | - *(dest + 2) = *(src + 2); | |
1856 | -} | |
1857 | - | |
1858 | static void | |
1859 | SXSync( | |
1860 | ScrnInfoPtr pScrn | |
1861 | @@ -519,7 +497,8 @@ | |
1862 | while (dwords >= infoRec->ColorExpandRange) { | |
1863 | GLINT_WAIT(infoRec->ColorExpandRange); | |
1864 | GLINT_WRITE_REG((infoRec->ColorExpandRange - 2)<<16 | 0x0D, OutputFIFO); | |
1865 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), src, | |
1866 | + GLINT_MoveDWORDS( | |
1867 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), src, | |
1868 | infoRec->ColorExpandRange - 1); | |
1869 | dwords -= (infoRec->ColorExpandRange - 1); | |
1870 | src += (infoRec->ColorExpandRange - 1); | |
1871 | @@ -527,7 +506,8 @@ | |
1872 | if (dwords) { | |
1873 | GLINT_WAIT(dwords); | |
1874 | GLINT_WRITE_REG((dwords - 1)<<16 | 0x0D, OutputFIFO); | |
1875 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), src,dwords); | |
1876 | + GLINT_MoveDWORDS( | |
1877 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), src,dwords); | |
1878 | } | |
1879 | pGlint->cpucount += 1; | |
1880 | } | |
1881 | @@ -809,7 +789,8 @@ | |
1882 | /* (0x0f << 4) | 0x0e is the TAG for GLINTColor */ | |
1883 | GLINT_WRITE_REG(((infoRec->ColorExpandRange - 2) << 16) | (0x0F << 4) | | |
1884 | 0x0E, OutputFIFO); | |
1885 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1886 | + GLINT_MoveDWORDS( | |
1887 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1888 | (CARD32*)srcp, infoRec->ColorExpandRange - 1); | |
1889 | count -= infoRec->ColorExpandRange - 1; | |
1890 | srcp += infoRec->ColorExpandRange - 1; | |
1891 | @@ -819,7 +800,8 @@ | |
1892 | /* (0x0F << 4) | 0x0E is the TAG for GLINTColor */ | |
1893 | GLINT_WRITE_REG(((count - 1) << 16) | (0x0f << 4) | | |
1894 | 0x0e, OutputFIFO); | |
1895 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1896 | + GLINT_MoveDWORDS( | |
1897 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1898 | (CARD32*)srcp, count); | |
1899 | } | |
1900 | src += srcwidth; | |
1901 | diff -ur xc.orig/programs/Xserver/hw/xfree86/drivers/glint/tx_accel.c xc/programs/Xserver/hw/xfree86/drivers/glint/tx_accel.c | |
1902 | --- xc.orig/programs/Xserver/hw/xfree86/drivers/glint/tx_accel.c Wed May 10 16:01:32 2000 | |
1903 | +++ xc/programs/Xserver/hw/xfree86/drivers/glint/tx_accel.c Sun Mar 18 16:57:58 2001 | |
1904 | @@ -326,28 +326,6 @@ | |
1905 | #endif | |
1906 | } | |
1907 | ||
1908 | -static void MoveDWORDS( | |
1909 | - register CARD32* dest, | |
1910 | - register CARD32* src, | |
1911 | - register int dwords ) | |
1912 | -{ | |
1913 | - while(dwords & ~0x03) { | |
1914 | - *dest = *src; | |
1915 | - *(dest + 1) = *(src + 1); | |
1916 | - *(dest + 2) = *(src + 2); | |
1917 | - *(dest + 3) = *(src + 3); | |
1918 | - src += 4; | |
1919 | - dest += 4; | |
1920 | - dwords -= 4; | |
1921 | - } | |
1922 | - if (!dwords) return; | |
1923 | - *dest = *src; | |
1924 | - if (dwords == 1) return; | |
1925 | - *(dest + 1) = *(src + 1); | |
1926 | - if (dwords == 2) return; | |
1927 | - *(dest + 2) = *(src + 2); | |
1928 | -} | |
1929 | - | |
1930 | static void | |
1931 | TXSync( | |
1932 | ScrnInfoPtr pScrn | |
1933 | @@ -541,7 +519,8 @@ | |
1934 | while (dwords >= infoRec->ColorExpandRange) { | |
1935 | GLINT_WAIT(infoRec->ColorExpandRange); | |
1936 | GLINT_WRITE_REG((infoRec->ColorExpandRange - 2)<<16 | 0x0D, OutputFIFO); | |
1937 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), src, | |
1938 | + GLINT_MoveDWORDS( | |
1939 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), src, | |
1940 | infoRec->ColorExpandRange - 1); | |
1941 | dwords -= (infoRec->ColorExpandRange - 1); | |
1942 | src += (infoRec->ColorExpandRange - 1); | |
1943 | @@ -549,7 +528,8 @@ | |
1944 | if (dwords) { | |
1945 | GLINT_WAIT(dwords); | |
1946 | GLINT_WRITE_REG((dwords - 1)<<16 | 0x0D, OutputFIFO); | |
1947 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), src,dwords); | |
1948 | + GLINT_MoveDWORDS( | |
1949 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), src,dwords); | |
1950 | } | |
1951 | pGlint->cpucount += 1; | |
1952 | } | |
1953 | @@ -848,7 +828,8 @@ | |
1954 | /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */ | |
1955 | GLINT_WRITE_REG(((infoRec->ColorExpandRange - 2) << 16) | (0x15 << 4) | | |
1956 | 0x05, OutputFIFO); | |
1957 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1958 | + GLINT_MoveDWORDS( | |
1959 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1960 | (CARD32*)srcp, infoRec->ColorExpandRange - 1); | |
1961 | count -= infoRec->ColorExpandRange - 1; | |
1962 | srcp += infoRec->ColorExpandRange - 1; | |
1963 | @@ -858,7 +839,8 @@ | |
1964 | /* (0x15 << 4) | 0x05 is the TAG for FBSourceData */ | |
1965 | GLINT_WRITE_REG(((count - 1) << 16) | (0x15 << 4) | | |
1966 | 0x05, OutputFIFO); | |
1967 | - MoveDWORDS((CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1968 | + GLINT_MoveDWORDS( | |
1969 | + (CARD32*)((char*)pGlint->IOBase + OutputFIFO + 4), | |
1970 | (CARD32*)srcp, count); | |
1971 | } | |
1972 | src += srcwidth; | |
1973 | diff -ur xc.orig/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c | |
1974 | --- xc.orig/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c Sat Mar 17 17:57:15 2001 | |
1975 | +++ xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c Sun Mar 18 17:19:13 2001 | |
1976 | @@ -37,6 +37,16 @@ | |
1977 | #include "mga_dri.h" | |
1978 | #endif | |
1979 | ||
1980 | +#if defined(__alpha__) | |
1981 | +#define MGAMoveDWORDS(d,s,c) \ | |
1982 | +do { \ | |
1983 | + write_mem_barrier(); \ | |
1984 | + XAAMoveDWORDS((d),(s),(c)); \ | |
1985 | +} while (0) | |
1986 | +#else | |
1987 | +#define MGAMoveDWORDS(d,s,c) XAAMoveDWORDS((d),(s),(c)) | |
1988 | +#endif | |
1989 | + | |
1990 | static void MGANAME(SubsequentScreenToScreenCopy)(ScrnInfoPtr pScrn, | |
1991 | int srcX, int srcY, int dstX, int dstY, | |
1992 | int w, int h); | |
1993 | @@ -964,6 +974,8 @@ | |
1994 | ||
1995 | CHECK_DMA_QUIESCENT(pMga, pScrn); | |
1996 | ||
1997 | + mem_barrier(); /*??*/ | |
1998 | + | |
1999 | while(MGAISBUSY()); | |
2000 | /* flush cache before a read (mga-1064g 5.1.6) */ | |
2001 | OUTREG8(MGAREG_CRTC_INDEX, 0); | |
2002 | @@ -1599,7 +1611,13 @@ | |
2003 | OUTREG(MGAREG_FXBNDRY, ((x + w - 1) << 16) | (x & 0xFFFF)); | |
2004 | OUTREG(MGAREG_YDSTLEN + MGAREG_EXEC, (y << 16) | h); | |
2005 | ||
2006 | - if(pMga->expandDWORDs > pMga->FifoSize) { | |
2007 | +#ifdef __alpha__ | |
2008 | + /* force Alpha to always use indirect */ | |
2009 | + if(1) | |
2010 | +#else | |
2011 | + if(pMga->expandDWORDs > pMga->FifoSize) | |
2012 | +#endif | |
2013 | + { | |
2014 | pMga->AccelInfoRec->SubsequentColorExpandScanline = | |
2015 | MGANAME(SubsequentColorExpandScanlineIndirect); | |
2016 | pMga->AccelInfoRec->ScanlineColorExpandBuffers = | |
2017 | @@ -1624,13 +1642,13 @@ | |
2018 | ||
2019 | while(dwords > pMga->FifoSize) { | |
2020 | WAITFIFO(pMga->FifoSize); | |
2021 | - XAAMoveDWORDS((CARD32*)(pMga->ColorExpandBase), src, pMga->FifoSize); | |
2022 | + MGAMoveDWORDS((CARD32*)(pMga->ColorExpandBase), src, pMga->FifoSize); | |
2023 | src += pMga->FifoSize; | |
2024 | dwords -= pMga->FifoSize; | |
2025 | } | |
2026 | ||
2027 | WAITFIFO(dwords); | |
2028 | - XAAMoveDWORDS((CARD32*)(pMga->ColorExpandBase), src, dwords); | |
2029 | + MGAMoveDWORDS((CARD32*)(pMga->ColorExpandBase), src, dwords); | |
2030 | ||
2031 | if(!(--pMga->expandRows)) { | |
2032 | if(pMga->expandRemaining) { | |
2033 | @@ -1726,13 +1744,13 @@ | |
2034 | ||
2035 | while(dwords > pMga->FifoSize) { | |
2036 | WAITFIFO(pMga->FifoSize); | |
2037 | - XAAMoveDWORDS((CARD32*)(pMga->ColorExpandBase), src, pMga->FifoSize); | |
2038 | + MGAMoveDWORDS((CARD32*)(pMga->ColorExpandBase), src, pMga->FifoSize); | |
2039 | src += pMga->FifoSize; | |
2040 | dwords -= pMga->FifoSize; | |
2041 | } | |
2042 | ||
2043 | WAITFIFO(dwords); | |
2044 | - XAAMoveDWORDS((CARD32*)(pMga->ColorExpandBase), src, dwords); | |
2045 | + MGAMoveDWORDS((CARD32*)(pMga->ColorExpandBase), src, dwords); | |
2046 | ||
2047 | if(!(--pMga->expandRows)) { | |
2048 | DISABLE_CLIP(); | |
2049 | diff -ur xc.orig/programs/Xserver/hw/xfree86/drivers/tga/IBM561ramdac.c xc/programs/Xserver/hw/xfree86/drivers/tga/IBM561ramdac.c | |
2050 | --- xc.orig/programs/Xserver/hw/xfree86/drivers/tga/IBM561ramdac.c Mon Oct 23 17:16:50 2000 | |
2051 | +++ xc/programs/Xserver/hw/xfree86/drivers/tga/IBM561ramdac.c Sun Mar 18 16:51:30 2001 | |
2052 | @@ -533,7 +533,6 @@ | |
2053 | TGAPtr pTga = TGAPTR(pScrn); | |
2054 | ||
2055 | unsigned int temp1[6] = {0,0,0,0,0,0}; | |
2056 | - struct monitor_data * c_table = &crystal_table; | |
2057 | ||
2058 | /* | |
2059 | * Set-up av9110 to 14.3 Mhz as reference for 561's PLL | |
2060 | @@ -555,10 +554,10 @@ | |
2061 | IBM561WriteReg(pScrn, IBM561_CONFIG_REG_4, 0x20 ); | |
2062 | ||
2063 | /* IBM561WriteReg(pScrn, IBM561_PLL_VCO_DIV_REG, 0xc8 ); */ | |
2064 | - IBM561WriteReg(pScrn, IBM561_PLL_VCO_DIV_REG, c_table->ibm561_vco_div); | |
2065 | + IBM561WriteReg(pScrn, IBM561_PLL_VCO_DIV_REG, tga_c_table->ibm561_vco_div); | |
2066 | ||
2067 | /* IBM561WriteReg(pScrn, IBM561_PLL_REF_REG, 0x08 ); */ | |
2068 | - IBM561WriteReg(pScrn, IBM561_PLL_REF_REG, c_table->ibm561_ref ); | |
2069 | + IBM561WriteReg(pScrn, IBM561_PLL_REF_REG, tga_c_table->ibm561_ref ); | |
2070 | ||
2071 | IBM561WriteReg(pScrn, IBM561_DIV_DOT_CLK_REG, 0xb0 ); | |
2072 | ||
2073 | diff -ur xc.orig/programs/Xserver/hw/xfree86/drivers/tga/tga.h xc/programs/Xserver/hw/xfree86/drivers/tga/tga.h | |
2074 | --- xc.orig/programs/Xserver/hw/xfree86/drivers/tga/tga.h Fri Oct 27 21:23:37 2000 | |
2075 | +++ xc/programs/Xserver/hw/xfree86/drivers/tga/tga.h Sun Mar 18 16:51:30 2001 | |
2076 | @@ -120,7 +120,9 @@ | |
2077 | unsigned int ibm561_ref; | |
2078 | }; | |
2079 | ||
2080 | -extern struct monitor_data crystal_table; | |
2081 | +extern struct monitor_data tga_crystal_table[]; | |
2082 | +extern int tga_crystal_table_entries; | |
2083 | +extern struct monitor_data *tga_c_table; | |
2084 | ||
2085 | /* Prototypes */ | |
2086 | ||
2087 | @@ -131,6 +133,7 @@ | |
2088 | Bool saveFonts*/); | |
2089 | Bool DEC21030Init(ScrnInfoPtr pScrn, DisplayModePtr mode); | |
2090 | void write_av9110(ScrnInfoPtr pScrn, unsigned int *); | |
2091 | +void TGA2SetupMode(ScrnInfoPtr pScrn); | |
2092 | ||
2093 | /* tga_accel.c */ | |
2094 | Bool DEC21030AccelInit(ScreenPtr pScreen); | |
2095 | diff -ur xc.orig/programs/Xserver/hw/xfree86/drivers/tga/tga_dac.c xc/programs/Xserver/hw/xfree86/drivers/tga/tga_dac.c | |
2096 | --- xc.orig/programs/Xserver/hw/xfree86/drivers/tga/tga_dac.c Fri Oct 27 21:23:37 2000 | |
2097 | +++ xc/programs/Xserver/hw/xfree86/drivers/tga/tga_dac.c Sun Mar 18 16:51:30 2001 | |
2098 | @@ -49,45 +49,114 @@ | |
2099 | /* There lies an ICS1562 Clock Generator. */ | |
2100 | ICS1562_CalcClockBits(freq, pll_bits); | |
2101 | ||
2102 | - switch (pTga->Chipset) { | |
2103 | - case PCI_CHIP_DEC21030: | |
2104 | - /* | |
2105 | - * For the DEC 21030 TGA: | |
2106 | - * This requires the 55 clock bits be written in a serial manner to | |
2107 | - * bit 0 of the CLOCK register and on the 56th bit set the hold flag. | |
2108 | - */ | |
2109 | - for (i = 0;i <= 6; i++) { | |
2110 | - for (j = 0; j <= 7; j++) { | |
2111 | - temp = (pll_bits[i] >> (7-j)) & 1; | |
2112 | - if (i == 6 && j == 7) | |
2113 | - temp |= 2; | |
2114 | - TGA_WRITE_REG(temp, TGA_CLOCK_REG); | |
2115 | - } | |
2116 | + /* | |
2117 | + * For the DEC 21030 TGA: | |
2118 | + * This requires the 55 clock bits be written in a serial manner to | |
2119 | + * bit 0 of the CLOCK register and on the 56th bit set the hold flag. | |
2120 | + */ | |
2121 | + for (i = 0;i <= 6; i++) { | |
2122 | + for (j = 0; j <= 7; j++) { | |
2123 | + temp = (pll_bits[i] >> (7-j)) & 1; | |
2124 | + if (i == 6 && j == 7) | |
2125 | + temp |= 2; | |
2126 | + TGA_WRITE_REG(temp, TGA_CLOCK_REG); | |
2127 | } | |
2128 | - break; | |
2129 | - | |
2130 | - case PCI_CHIP_TGA2: | |
2131 | - /* | |
2132 | - * For the DEC TGA2: | |
2133 | - * This requires the 55 clock bits be written in a serial manner to | |
2134 | - * bit 0 of the CLOCK register and on the 56th bit set the hold flag. | |
2135 | - */ | |
2136 | -#if 0 | |
2137 | - /* ?? FIXME FIXME FIXME ?? */ | |
2138 | - for (i = 0;i <= 6; i++) { | |
2139 | - for (j = 0; j <= 7; j++) { | |
2140 | - temp = (pll_bits[i] >> (7-j)) & 1; | |
2141 | - if (i == 6 && j == 7) | |
2142 | - temp |= 2; | |
2143 | - TGA_WRITE_REG(temp, TGA_CLOCK_REG); | |
2144 | - } | |
2145 | - } | |
2146 | -#endif | |
2147 | - break; | |
2148 | } | |
2149 | } | |
2150 | ||
2151 | -struct monitor_data crystal_table = | |
2152 | +struct monitor_data tga_crystal_table[] = { | |
2153 | +{ | |
2154 | +/* Option 0 Monitor Info 130.8 */ | |
2155 | +1024, /* rows */ | |
2156 | +1280, /* columns */ | |
2157 | +130, /* 130.8 Mhz */ | |
2158 | +72, /* refresh rate */ | |
2159 | +1024, /* v scanlines */ | |
2160 | +3, /* v front porch */ | |
2161 | +3, /* v sync */ | |
2162 | +33, /* v back porch */ | |
2163 | +1280, /* h pixels */ | |
2164 | +32, /* h front porch */ | |
2165 | +160, /* h sync */ | |
2166 | +232, /* h back porch */ | |
2167 | +/* AV9110 clock serial load information 130.808 */ | |
2168 | +0x40, /* 0:6 VCO frequency divider N */ | |
2169 | +0x7, /* 7:13 Reference frequency divide M */ | |
2170 | +0x0, /* 14 VCO pre-scale divide V (0=div.by 1,1=by 8) | |
2171 | +*/ | |
2172 | +0x1, /* 15:16 CLK/X output divide X */ | |
2173 | +0x1, /* 17:18 VCO output divide R */ | |
2174 | +1, /* 19 CLK Output enable. */ | |
2175 | +1, /* 20 CLK/X Output enable */ | |
2176 | +0, /* reserved, should be set to 0 */ | |
2177 | +0, /* Reference clock select on CLK 1=ref */ | |
2178 | +1, /* reserved, should be set to 1 */ | |
2179 | +/* IBM561 PLL setup data 130.808 */ | |
2180 | +0xC8, /* VCO Div: PFR=0x3, M-65=49 */ | |
2181 | +0x8 /* REF: N=0x8 */ | |
2182 | +}, | |
2183 | +{ | |
2184 | +/* Option 3 Monitor Info 104.00 Mhz */ | |
2185 | +900, /* rows */ | |
2186 | +1152, /* columns */ | |
2187 | +104, /* 104 Mhz */ | |
2188 | +72, /* refresh rate */ | |
2189 | +900, /* v scanlines */ | |
2190 | +6, /* v front porch */ | |
2191 | +10, /* v sync */ | |
2192 | +44, /* v back porch */ | |
2193 | +1152, /* h pixels */ | |
2194 | +64, /* h front porch */ | |
2195 | +112, /* h sync */ | |
2196 | +176, /* h back porch */ | |
2197 | +/* 103.994 MHz av9110 clock serial load information */ | |
2198 | +0x6d, /* 0:6 VCO frequency divider N */ | |
2199 | +0xf, /* 7:13 Reference frequency divide M */ | |
2200 | +0x0, /* 14 VCO pre-scale divide V (0=div.by 1,1=by 8) | |
2201 | +*/ | |
2202 | +0x1, /* 15:16 CLK/X output divide X */ | |
2203 | +0x1, /* 17:18 VCO output divide R */ | |
2204 | +1, /* 19 CLK Output enable. */ | |
2205 | +1, /* 20 CLK/X Output enable */ | |
2206 | +0, /* reserved, should be set to 0 */ | |
2207 | +0, /* Reference clock select on CLK 1=ref */ | |
2208 | +1, /* reserved, should be set to 1 */ | |
2209 | +/* 104.00 MHz IBM561 PLL setup data */ | |
2210 | +0x96, /* VCO Div: PFR=2, M=57 */ | |
2211 | +0x6 /* REF: N=6 */ | |
2212 | +}, | |
2213 | +#if 1 | |
2214 | +{ | |
2215 | +/* Option 6 Monitor Info 74.00 Mhz */ | |
2216 | +768, /* rows */ | |
2217 | +1024, /* columns */ | |
2218 | +74, /* 74 Mhz */ | |
2219 | +72, /* refresh rate */ | |
2220 | +768, /* v scanlines */ | |
2221 | +1, /* v front porch */ | |
2222 | +6, /* v sync */ | |
2223 | +22, /* v back porch */ | |
2224 | +1024, /* h pixels */ | |
2225 | +16, /* h front porch */ | |
2226 | +128, /* h sync */ | |
2227 | +128, /* h back porch */ | |
2228 | +/* 74.00 MHz AV9110 clock serial load information */ | |
2229 | +0x2a, /* 0:6 VCO frequency divider N */ | |
2230 | +0x41, /* 7:13 Reference frequency divide M */ | |
2231 | +0x1, /* 14 VCO pre-scale divide V (0=div.by 1,1=by 8) | |
2232 | +*/ | |
2233 | +0x1, /* 15:16 CLK/X output divide X */ | |
2234 | +0x1, /* 17:18 VCO output divide R */ | |
2235 | +1, /* 19 CLK Output enable. */ | |
2236 | +1, /* 20 CLK/X Output enable */ | |
2237 | +0, /* reserved, should be set to 0 */ | |
2238 | +0, /* Reference clock select on CLK 1=ref */ | |
2239 | +1, /* reserved, should be set to 1 */ | |
2240 | +/* 74.00 MHz IBM561 PLL setup data */ | |
2241 | +0x9C, /* VCO Div: PFR=2, M=0x5D*/ | |
2242 | +0x9 /* REF: N=0x9 */ | |
2243 | +}, | |
2244 | +#else | |
2245 | { | |
2246 | /* Option 5 Monitor Info 75.00 Mhz */ | |
2247 | 768, /* rows */ | |
2248 | @@ -117,8 +186,406 @@ | |
2249 | /* 75.00 MHz IBM561 PLL setup data */ | |
2250 | 0x93, /* VCO Div: PFR=2, M=0x54 */ | |
2251 | 0x8 /* REF: N=0x8 */ | |
2252 | +}, | |
2253 | +#endif | |
2254 | +{ | |
2255 | +/* Option 9 Monitor Info 50 Mhz ergo SVGA */ | |
2256 | +600, /* rows */ | |
2257 | +800, /* columns */ | |
2258 | +50, /* 50 Mhz */ | |
2259 | +72, /* refresh rate */ | |
2260 | +600, /* v scanlines */ | |
2261 | +37, /*(31 tga)v front porch */ | |
2262 | +6, /* v sync */ | |
2263 | +23, /*(29 tga)v back porch */ | |
2264 | +800, /* h pixels */ | |
2265 | +56, /* h front porch */ | |
2266 | +120, /* h sync */ | |
2267 | +64, /* h back porch */ | |
2268 | +/*50.00 Mhz AV9110 clock serial load information */ | |
2269 | +0x37, /* 0:6 VCO frequency divider N */ | |
2270 | +0x3f, /* 7:13 Reference frequency divide M */ | |
2271 | +0x1, /* 14 VCO pre-scale divide V (0=div.by 1,1=by 8) | |
2272 | +*/ | |
2273 | +0x1, /* 15:16 CLK/X output divide X */ | |
2274 | +0x2, /* 17:18 VCO output divide R */ | |
2275 | +1, /* 19 CLK Output enable. */ | |
2276 | +1, /* 20 CLK/X Output enable */ | |
2277 | +0, /* reserved, should be set to 0 */ | |
2278 | +0, /* Reference clock select on CLK 1=ref */ | |
2279 | +1, /* reserved, should be set to 1 */ | |
2280 | +/* 50.00 MHz IBM561 PLL setup data */ | |
2281 | +0x45, /* VCO Div: PFR=1, M=46*/ | |
2282 | +0x5 /* REF: N=5 */ | |
2283 | +}, | |
2284 | +{ | |
2285 | +/* Option B Monitor Info 31.5 Mhz ergo VGA */ | |
2286 | +480, /* rows */ | |
2287 | +640, /* columns */ | |
2288 | +32, /* 32 Mhz */ | |
2289 | +72, /* refresh rate */ | |
2290 | +480, /* v scanlines */ | |
2291 | +9, /* v front porch */ | |
2292 | +3, /* v sync */ | |
2293 | +28, /* v back porch */ | |
2294 | +640, /* h pixels */ | |
2295 | +24, /* h front porch */ | |
2296 | +40, /* h sync */ | |
2297 | +128, /* h back porch */ | |
2298 | +/* 31.50 MHz AV9110 clock serial load information */ | |
2299 | +0x16, /* 0:6 VCO frequency divider N */ | |
2300 | +0x05, /* 7:13 Reference frequency divide M */ | |
2301 | +0x0, /* 14 VCO pre-scale divide V (0=div.by 1,1=by 8) | |
2302 | +*/ | |
2303 | +0x1, /* 15:16 CLK/X output divide X */ | |
2304 | +0x2, /* 17:18 VCO output divide R */ | |
2305 | +1, /* 19 CLK Output enable. */ | |
2306 | +1, /* 20 CLK/X Output enable */ | |
2307 | +0, /* reserved, should be set to 0 */ | |
2308 | +0, /* Reference clock select on CLK 1=ref */ | |
2309 | +1, /* reserved, should be set to 1 */ | |
2310 | +/* 31.50 MHz IBM561 PLL setup data */ | |
2311 | +0x17, /* VCO Div: PFR=0, M=0x58 */ | |
2312 | +0x5 /* REF: N=0x5 */ | |
2313 | +}, | |
2314 | +#ifdef ALLOW_LT_72_HZ | |
2315 | +{ | |
2316 | +/* Option 1 Monitor Info 119.84 Mhz */ | |
2317 | +1024, /* rows */ | |
2318 | +1280, /* columns */ | |
2319 | +119, /* 119 Mhz */ | |
2320 | +66, /* refresh rate */ | |
2321 | +1024, /* v scanlines */ | |
2322 | +3, /* v front porch */ | |
2323 | +3, /* v sync */ | |
2324 | +33, /* v back porch */ | |
2325 | +1280, /* h pixels */ | |
2326 | +32, /* h front porch */ | |
2327 | +160, /* h sync */ | |
2328 | +232, /* h back porch */ | |
2329 | +/* 119.84MHz AV9110 clock serial load information */ | |
2330 | +0x2d, /* 0:6 VCO frequency divider N */ | |
2331 | +0x2b, /* 7:13 Reference frequency divide M */ | |
2332 | +0x1, /* 14 VCO pre-scale divide V (0=div.by 1,1=by 8) */ | |
2333 | +0x1, /* 15:16 CLK/X output divide X */ | |
2334 | +0x1, /* 17:18 VCO output divide R */ | |
2335 | +1, /* 19 CLK Output enable. */ | |
2336 | +1, /* 20 CLK/X Output enable */ | |
2337 | +0, /* reserved, should be set to 0 */ | |
2338 | +0, /* Reference clock select on CLK 1=ref */ | |
2339 | +1, /* reserved, should be set to 1 */ | |
2340 | +/* IBM561 PLL setup data 119.84 */ | |
2341 | +0x82, /* VCO Div: PFR=0x2, M=0x43 */ | |
2342 | +0x4 /* REF: N=0x4 */ | |
2343 | +}, | |
2344 | +{ | |
2345 | +/* Option 2 Monitor Info 108.18 Mhz */ | |
2346 | +1024, /* rows */ | |
2347 | +1280, /* columns */ | |
2348 | +108, /* 108 Mhz */ | |
2349 | +60, /* refresh rate */ | |
2350 | +1024, /* v scanlines */ | |
2351 | +3, /* v front porch */ | |
2352 | +3, /* v sync */ | |
2353 | +26, /* v back porch */ | |
2354 | +1280, /* h pixels */ | |
2355 | +44, /* h front porch */ | |
2356 | +184, /* h sync */ | |
2357 | +200, /* h back porch */ | |
2358 | +/* 108.18 MHz av9110 Clk serial load information */ | |
2359 | +0x11, /* 0:6 VCO frequency divider N */ | |
2360 | +0x9, /* 7:13 Reference frequency divide M */ | |
2361 | +0x1, /* 14 VCO pre-scale divide V (0=div.by 1,1=by 8) | |
2362 | +*/ | |
2363 | +0x1, /* 15:16 CLK/X output divide X */ | |
2364 | +0x2, /* 17:18 VCO output divide R */ | |
2365 | +1, /* 19 CLK Output enable. */ | |
2366 | +1, /* 20 CLK/X Output enable */ | |
2367 | +0, /* reserved, should be set to 0 */ | |
2368 | +0, /* Reference clock select on CLK 1=ref */ | |
2369 | +1, /* reserved, should be set to 1 */ | |
2370 | +/* 108.18 MHz IBM561 PLL setup data */ | |
2371 | +0xB8, /* VCO Div: PFR=2, M=79 */ | |
2372 | +0x8 /* REF: N=0x8 */ | |
2373 | +}, | |
2374 | +{ | |
2375 | +/* Option 5 Monitor Info 75.00 Mhz */ | |
2376 | +768, /* rows */ | |
2377 | +1024, /* columns */ | |
2378 | +75, /* 74 Mhz */ | |
2379 | +70, /* refresh rate */ | |
2380 | +768, /* v scanlines */ | |
2381 | +3, /* v front porch */ | |
2382 | +6, /* v sync */ | |
2383 | +29, /* v back porch */ | |
2384 | +1024, /* h pixels */ | |
2385 | +24, /* h front porch */ | |
2386 | +136, /* h sync */ | |
2387 | +144, /* h back porch */ | |
2388 | +/* 75.00 MHz AV9110 clock serial load information */ | |
2389 | +0x6e, /* 0:6 VCO frequency divider N */ | |
2390 | +0x15, /* 7:13 Reference frequency divide M */ | |
2391 | +0x0, /* 14 VCO pre-scale divide V (0=div.by 1,1=by 8) | |
2392 | +*/ | |
2393 | +0x1, /* 15:16 CLK/X output divide X */ | |
2394 | +0x1, /* 17:18 VCO output divide R */ | |
2395 | +1, /* 19 CLK Output enable. */ | |
2396 | +1, /* 20 CLK/X Output enable */ | |
2397 | +0, /* reserved, should be set to 0 */ | |
2398 | +0, /* Reference clock select on CLK 1=ref */ | |
2399 | +1, /* reserved, should be set to 1 */ | |
2400 | +/* 75.00 MHz IBM561 PLL setup data */ | |
2401 | +0x93, /* VCO Div: PFR=2, M=0x54 */ | |
2402 | +0x8 /* REF: N=0x8 */ | |
2403 | +}, | |
2404 | +{ | |
2405 | +/* Option 7 Monitor Info 69 Mhz DEC 72 Hz */ | |
2406 | +864, /* rows */ | |
2407 | +1024, /* columns */ | |
2408 | +69, /* 69.x Mhz */ | |
2409 | +60, /* refresh rate */ | |
2410 | +864, /* v scanlines */ | |
2411 | +0, /* v front porch */ | |
2412 | +3, /* v sync */ | |
2413 | +34, /* v back porch */ | |
2414 | +1024, /* h pixels */ | |
2415 | +12, /* h front porch */ | |
2416 | +128, /* h sync */ | |
2417 | +116, /* h back porch */ | |
2418 | +/* 69.00 Mhz AV9110 clock serial load information */ | |
2419 | +0x35, /* 0:6 VCO frequency divider N */ | |
2420 | +0xb, /* 7:13 Reference frequency divide M */ | |
2421 | +0x0, /* 14 VCO pre-scale divide V (0=div.by 1,1=by 8) | |
2422 | +*/ | |
2423 | +0x1, /* 15:16 CLK/X output divide X */ | |
2424 | +0x1, /* 17:18 VCO output divide R */ | |
2425 | +1, /* 19 CLK Output enable. */ | |
2426 | +1, /* 20 CLK/X Output enable */ | |
2427 | +0, /* reserved, should be set to 0 */ | |
2428 | +0, /* Reference clock select on CLK 1=ref */ | |
2429 | +1, /* reserved, should be set to 1 */ | |
2430 | +/* 69.00 MHz IBM561 PLL setup data */ | |
2431 | +0xA9, /* VCO Div: PFR=2, M=0x6A */ | |
2432 | +0xB /* REF: N=0xB */ | |
2433 | +}, | |
2434 | +{ | |
2435 | +/* Option 8 Monitor Info 65 Mhz */ | |
2436 | +768, /* rows */ | |
2437 | +1024, /* columns */ | |
2438 | +65, /* 65 Mhz */ | |
2439 | +60, /* refresh rate */ | |
2440 | +768, /* v scanlines */ | |
2441 | +7, /* v front porch */ | |
2442 | +9, /* v sync */ | |
2443 | +26, /* v back porch */ | |
2444 | +1024, /* h pixels */ | |
2445 | +56, /* h front porch */ | |
2446 | +64, /* h sync */ | |
2447 | +200, /* h back porch */ | |
2448 | +/* 65.00 MHz AV9110 clock serial load information */ | |
2449 | +0x6d, /* 0:6 VCO frequency divider N */ | |
2450 | +0x0c, /* 7:13 Reference frequency divide M */ | |
2451 | +0x0, /* 14 VCO pre-scale divide V (0=div.by 1,1=by 8) | |
2452 | +*/ | |
2453 | +0x1, /* 15:16 CLK/X output divide X */ | |
2454 | +0x2, /* 17:18 VCO output divide R */ | |
2455 | +1, /* 19 CLK Output enable. */ | |
2456 | +1, /* 20 CLK/X Output enable */ | |
2457 | +0, /* reserved, should be set to 0 */ | |
2458 | +0, /* Reference clock select on CLK 1=ref */ | |
2459 | +1, /* reserved, should be set to 1 */ | |
2460 | +/* 65.00 MHz IBM561 PLL setup data */ | |
2461 | +0xAC, /* VCO Div: PFR=2, M=0x6D */ | |
2462 | +0xC /* REF: N=0xC */ | |
2463 | +}, | |
2464 | +{ | |
2465 | +/* Option A Monitor Info 40 Mhz SVGA */ | |
2466 | +600, /* rows */ | |
2467 | +800, /* columns */ | |
2468 | +40, /* 40 Mhz */ | |
2469 | +60, /* refresh rate */ | |
2470 | +600, /* v scanlines */ | |
2471 | +1, /* v front porch */ | |
2472 | +4, /* v sync */ | |
2473 | +23, /* v back porch */ | |
2474 | +800, /* h pixels */ | |
2475 | +40, /* h front porch */ | |
2476 | +128, /* h sync */ | |
2477 | +88, /* h back porch */ | |
2478 | +/* 40.00 MHz AV9110 clock serial load information */ | |
2479 | +0x5f, /* 0:6 VCO frequency divider N */ | |
2480 | +0x11, /* 7:13 Reference frequency divide M */ | |
2481 | +0x0, /* 14 VCO pre-scale divide V (0=div.by 1,1=by 8) | |
2482 | +*/ | |
2483 | +0x1, /* 15:16 CLK/X output divide X */ | |
2484 | +0x2, /* 17:18 VCO output divide R */ | |
2485 | +1, /* 19 CLK Output enable. */ | |
2486 | +1, /* 20 CLK/X Output enable */ | |
2487 | +0, /* reserved, should be set to 0 */ | |
2488 | +0, /* Reference clock select on CLK 1=ref */ | |
2489 | +1, /* reserved, should be set to 1 */ | |
2490 | +/* 40.00 MHz IBM561 PLL setup data */ | |
2491 | +0x42, /* VCO Div: PFR=1, M=43 */ | |
2492 | +0x6 /* REF: N=0x6 */ | |
2493 | +}, | |
2494 | +{ | |
2495 | +/* Option C Monitor Info 25.175 Mhz VGA */ | |
2496 | +480, /* rows */ | |
2497 | +640, /* columns */ | |
2498 | +25, /* 25.175 Mhz */ | |
2499 | +60, /* refresh rate */ | |
2500 | +480, /* v scanlines */ | |
2501 | +10, /* v front porch */ | |
2502 | +2, /* v sync */ | |
2503 | +33, /* v back porch */ | |
2504 | +640, /* h pixels */ | |
2505 | +16, /* h front porch */ | |
2506 | +96, /* h sync */ | |
2507 | +48, /* h back porch */ | |
2508 | +/* 25.175 MHz AV9110 clock serial load information */ | |
2509 | +0x66, /* 0:6 VCO frequency divider N */ | |
2510 | +0x1d, /* 7:13 Reference frequency divide M */ | |
2511 | +0x0, /* 14 VCO pre-scale divide V (0=div.by 1,1=by 8) | |
2512 | +*/ | |
2513 | +0x1, /* 15:16 CLK/X output divide X */ | |
2514 | +0x2, /* 17:18 VCO output divide R */ | |
2515 | +1, /* 19 CLK Output enable. */ | |
2516 | +1, /* 20 CLK/X Output enable */ | |
2517 | +0, /* reserved, should be set to 0 */ | |
2518 | +0, /* Reference clock select on CLK 1=ref */ | |
2519 | +1, /* reserved, should be set to 1 */ | |
2520 | +/* 25.175 MHz IBM561 PLL setup data */ | |
2521 | +0x3E, /* VCO Div: PFR=0, M=0x7F */ | |
2522 | +0x9 /* REF: N=0x9 */ | |
2523 | +}, | |
2524 | +{ | |
2525 | +/* Option E Monitor Info 110 Mhz */ | |
2526 | +1024, /* rows */ | |
2527 | +1280, /* columns */ | |
2528 | +110, | |
2529 | +60, /* refresh rate */ | |
2530 | +1024, /* v scanlines */ | |
2531 | +6, /* v front porch */ | |
2532 | +7, /* v sync */ | |
2533 | +44, /* v back porch */ | |
2534 | +1280, /* h pixels */ | |
2535 | +19, /* h front porch */ | |
2536 | +163, /* h sync */ | |
2537 | +234, /* h back porch */ | |
2538 | +/* 110.0 MHz AV9110 clock serial load information */ | |
2539 | +0x60, /* 0:6 VCO frequency divider N */ | |
2540 | +0x32, /* 7:13 Reference frequency divide M */ | |
2541 | +0x1, /* 14 VCO pre-scale divide V (0=div.by 1,1=by 8) */ | |
2542 | +0x1, /* 15:16 CLK/X output divide X */ | |
2543 | +0x2, /* 17:18 VCO output divide R */ | |
2544 | +1, /* 19 CLK Output enable. */ | |
2545 | +1, /* 20 CLK/X Output enable */ | |
2546 | +0, /* reserved, should be set to 0 */ | |
2547 | +0, /* Reference clock select on CLK 1=ref */ | |
2548 | +1, /* reserved, should be set to 1 */ | |
2549 | +/* 110.0 MHz IBM561 PLL setup data */ | |
2550 | +0xBA, /* VCO Div: PFR=0x2, M=0x7B */ | |
2551 | +0x8 /* REF: N=0x8 */ | |
2552 | +}, | |
2553 | +#endif /* ALLOW_LT_72_HZ */ | |
2554 | +#ifdef /* ALLOW_GT_72_HZ */ | |
2555 | +{ | |
2556 | +/* Option D Monitor Info 135 Mhz */ | |
2557 | +1024, /* rows */ | |
2558 | +1280, /* columns */ | |
2559 | +135, /* 135 Mhz */ | |
2560 | +75, /* refresh rate */ | |
2561 | +1024, /* v scanlines */ | |
2562 | +1, /* v front porch */ | |
2563 | +3, /* v sync */ | |
2564 | +38, /* v back porch */ | |
2565 | +1280, /* h pixels */ | |
2566 | +16, /* h front porch */ | |
2567 | +144, /* h sync */ | |
2568 | +248, /* h back porch */ | |
2569 | +/* 135.0 MHz AV9110 clock serial load information */ | |
2570 | +0x42, /* 0:6 VCO frequency divider N */ | |
2571 | +0x07, /* 7:13 Reference frequency divide M */ | |
2572 | +0x0, /* 14 VCO pre-scale divide V (0=div.by 1,1=by 8) */ | |
2573 | +0x1, /* 15:16 CLK/X output divide X */ | |
2574 | +0x1, /* 17:18 VCO output divide R */ | |
2575 | +1, /* 19 CLK Output enable. */ | |
2576 | +1, /* 20 CLK/X Output enable */ | |
2577 | +0, /* reserved, should be set to 0 */ | |
2578 | +0, /* Reference clock select on CLK 1=ref */ | |
2579 | +1, /* reserved, should be set to 1 */ | |
2580 | +/* 135.0 MHz IBM561 PLL setup data */ | |
2581 | +0xC1, /* VCO Div: PFR=0x3, M=0x42 */ | |
2582 | +0x7 /* REF: N=0x7 */ | |
2583 | +}, | |
2584 | +#ifdef ALLOW_GT_1280x1024 | |
2585 | +{ | |
2586 | +/* Option 4 Monitor Info 175.5 Mhz (8-plane) */ | |
2587 | +1200, /* rows */ | |
2588 | +1600, /* columns */ | |
2589 | +175, /* clock */ | |
2590 | +65, /* refresh rate */ | |
2591 | +1200, /* v scanlines */ | |
2592 | +1, /* v front porch */ | |
2593 | +3, /* v sync */ | |
2594 | +46, /* v back porch */ | |
2595 | +1600, /* h pixels */ | |
2596 | +32, /* h front porch */ | |
2597 | +192, /* h sync */ | |
2598 | +336, /* h back porch */ | |
2599 | +/* 110.0 MHz AV9110 clock serial load information */ | |
2600 | +0x5F, /* 0:6 VCO frequency divider N */ | |
2601 | +0x3E, /* 7:13 Reference frequency divide M */ | |
2602 | +0x1, /* 14 VCO pre-scale divide V (0=div.by 1,1=by 8) | |
2603 | +*/ | |
2604 | +0x1, /* 15:16 CLK/X output divide X */ | |
2605 | +0x1, /* 17:18 VCO output divide R */ | |
2606 | +1, /* 19 CLK Output enable. */ | |
2607 | +1, /* 20 CLK/X Output enable */ | |
2608 | +0, /* reserved, should be set to 0 */ | |
2609 | +0, /* Reference clock select on CLK 1=ref */ | |
2610 | +1, /* reserved, should be set to 1 */ | |
2611 | +/* 110.0 MHz IBM561 PLL setup data */ | |
2612 | +0xE1, /* VCO Div: PFR=0x3, M-65=0x21 */ | |
2613 | +0x8 /* REF: N=0x8 */ | |
2614 | +}, | |
2615 | +{ | |
2616 | +/* Option F Monitor Info (24-plane) */ | |
2617 | +1200, /* rows */ | |
2618 | +1600, /* columns */ | |
2619 | +202.5, /* 130.8 Mhz */ | |
2620 | +75, /* refresh rate */ | |
2621 | +1200, /* v scanlines */ | |
2622 | +1, /* v front porch */ | |
2623 | +3, /* v sync */ | |
2624 | +46, /* v back porch */ | |
2625 | +1600, /* h pixels */ | |
2626 | +32, /* h front porch */ | |
2627 | +192, /* h sync */ | |
2628 | +336, /* h back porch */ | |
2629 | +/* AV9110 clock serial load information 130.808 */ | |
2630 | +0x60, /* 0:6 VCO frequency divider N */ | |
2631 | +0x32, /* 7:13 Reference frequency divide M */ | |
2632 | +0x1, /* 14 VCO pre-scale divide V (0=div.by 1,1=by 8) */ | |
2633 | +0x1, /* 15:16 CLK/X output divide X */ | |
2634 | +0x2, /* 17:18 VCO output divide R */ | |
2635 | +1, /* 19 CLK Output enable. */ | |
2636 | +1, /* 20 CLK/X Output enable */ | |
2637 | +0, /* reserved, should be set to 0 */ | |
2638 | +0, /* Reference clock select on CLK 1=ref */ | |
2639 | +1, /* reserved, should be set to 1 */ | |
2640 | +/* 110.0 MHz IBM561 PLL setup data */ | |
2641 | +0xE2, /* bogus VCO Div: PFR=0x2, M=0x7B */ | |
2642 | +0x7 /* bogus REF: N=0x8 */ | |
2643 | +} | |
2644 | +#endif /* ALLOW_GT_1280x1024 */ | |
2645 | +#endif /* ALLOW_GT_72_HZ */ | |
2646 | }; | |
2647 | ||
2648 | +int tga_crystal_table_entries = sizeof(tga_crystal_table)/sizeof(struct monitor_data); | |
2649 | + | |
2650 | +struct monitor_data *tga_c_table; | |
2651 | + | |
2652 | /* ICS av9110 is only used on TGA2 */ | |
2653 | ||
2654 | void | |
2655 | @@ -142,30 +609,58 @@ | |
2656 | TGA2_WRITE_CLOCK_REG(0x0, 0xf800); | |
2657 | } | |
2658 | ||
2659 | +void TGA2SetupMode(ScrnInfoPtr pScrn) | |
2660 | +{ | |
2661 | + int i; | |
2662 | + | |
2663 | + /* | |
2664 | + * HACK HACK HACK | |
2665 | + * | |
2666 | + * We do not know how to generate arbitrary clocks, so we search | |
2667 | + * the crystal_table above for a match. Sigh... | |
2668 | + */ | |
2669 | + tga_c_table = tga_crystal_table; | |
2670 | + for (i = 0; i < tga_crystal_table_entries; i++, tga_c_table++) { | |
2671 | + if ((tga_c_table->max_rows == pScrn->currentMode->VDisplay) && | |
2672 | + (tga_c_table->max_cols == pScrn->currentMode->HDisplay)) { | |
2673 | + ErrorF("Found a matching mode (%d)!\n", i); | |
2674 | + break; | |
2675 | + } | |
2676 | + } | |
2677 | + if (i == tga_crystal_table_entries) { | |
2678 | +#ifdef FOR_NOW | |
2679 | + FatalError("Unable to find a workable mode"); | |
2680 | +#else | |
2681 | + ErrorF("Unable to find a matching mode!\n"); | |
2682 | + /* tga_c_table = &tga_crystal_table[4]; *//* 640x480 @ 72 */ | |
2683 | + tga_c_table = &tga_crystal_table[2]; /* 1024x768 @ 72 */ | |
2684 | +#endif | |
2685 | + } | |
2686 | + return; | |
2687 | +} | |
2688 | + | |
2689 | static void | |
2690 | ICS9110ClockSelect(ScrnInfoPtr pScrn, int freq) | |
2691 | { | |
2692 | unsigned int temp, temp1[6]; | |
2693 | - struct monitor_data *c_table; | |
2694 | + int i; | |
2695 | ||
2696 | /* There lies an ICS9110 Clock Generator. */ | |
2697 | /* ICS9110_CalcClockBits(freq, pll_bits); */ | |
2698 | ||
2699 | - c_table = &crystal_table; | |
2700 | - | |
2701 | /* the following is based on munge_ics() from the | |
2702 | TRU64 kernel TGA driver */ | |
2703 | ||
2704 | - temp = (unsigned int)(c_table->vco_div | | |
2705 | - (c_table->ref_div << 7) | | |
2706 | - (c_table->vco_pre << 14) | | |
2707 | - (c_table->clk_div << 15) | | |
2708 | - (c_table->vco_out_div << 17) | | |
2709 | - (c_table->clk_out_en << 19) | | |
2710 | - (c_table->clk_out_enX << 20) | | |
2711 | - (c_table->res0 << 21) | | |
2712 | - (c_table->clk_sel << 22) | | |
2713 | - (c_table->res1 << 23)); | |
2714 | + temp = (unsigned int)(tga_c_table->vco_div | | |
2715 | + (tga_c_table->ref_div << 7) | | |
2716 | + (tga_c_table->vco_pre << 14) | | |
2717 | + (tga_c_table->clk_div << 15) | | |
2718 | + (tga_c_table->vco_out_div << 17) | | |
2719 | + (tga_c_table->clk_out_en << 19) | | |
2720 | + (tga_c_table->clk_out_enX << 20) | | |
2721 | + (tga_c_table->res0 << 21) | | |
2722 | + (tga_c_table->clk_sel << 22) | | |
2723 | + (tga_c_table->res1 << 23)); | |
2724 | ||
2725 | temp1[0] = (temp & 0x00000001) | ((temp & 0x00000002) << 7) | | |
2726 | ((temp & 0x00000004) << 14) | ((temp & 0x00000008) << 21); | |
2727 | diff -ur xc.orig/programs/Xserver/hw/xfree86/drivers/tga/tga_driver.c xc/programs/Xserver/hw/xfree86/drivers/tga/tga_driver.c | |
2728 | --- xc.orig/programs/Xserver/hw/xfree86/drivers/tga/tga_driver.c Mon Dec 4 19:56:22 2000 | |
2729 | +++ xc/programs/Xserver/hw/xfree86/drivers/tga/tga_driver.c Sun Mar 18 16:51:30 2001 | |
2730 | @@ -954,6 +954,15 @@ | |
2731 | /* Set the current mode to the first in the list */ | |
2732 | pScrn->currentMode = pScrn->modes; | |
2733 | ||
2734 | + /* | |
2735 | + This is a bit of a hack; we seem to have to init | |
2736 | + the TGA2 chipset knowing what the mode is, so we | |
2737 | + do this now as soon as we know it... | |
2738 | + */ | |
2739 | + if (pTga->Chipset == PCI_CHIP_TGA2) { | |
2740 | + TGA2SetupMode(pScrn); | |
2741 | + } | |
2742 | + | |
2743 | /* Print the list of modes being used */ | |
2744 | xf86PrintModes(pScrn); | |
2745 | ||
2746 | diff -ur xc.orig/programs/Xserver/hw/xfree86/os-support/linux/lnx_axp.c xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_axp.c | |
2747 | --- xc.orig/programs/Xserver/hw/xfree86/os-support/linux/lnx_axp.c Sat Mar 17 17:57:16 2001 | |
2748 | +++ xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_axp.c Sun Mar 18 16:51:30 2001 | |
2749 | @@ -10,28 +10,28 @@ | |
2750 | axpDevice lnxGetAXP(void); | |
2751 | ||
2752 | static AXP axpList[] = { | |
2753 | - { "Tsunami", NULL, NULL, TSUNAMI }, | |
2754 | - { "Eiger", NULL, NULL, TSUNAMI }, | |
2755 | - {"Noname", NULL, NULL, LCA }, | |
2756 | - { "AlphaBook1", NULL, NULL, LCA }, | |
2757 | - {"EB66", NULL, NULL, LCA}, | |
2758 | - {"EB64+",NULL,NULL, APECS}, | |
2759 | + {"Tsunami",NULL,NULL,TSUNAMI}, | |
2760 | + {"Eiger",NULL,NULL,TSUNAMI}, | |
2761 | + {"Noname",NULL,NULL,LCA}, | |
2762 | + {"AlphaBook1",NULL,NULL,LCA}, | |
2763 | + {"EB66",NULL,NULL,LCA}, | |
2764 | + {"EB64+",NULL,NULL,APECS}, | |
2765 | {"Noritake",NULL,"EV5",CIA}, | |
2766 | {"Noritake",NULL,"EV56",CIA}, | |
2767 | {"Noritake",NULL,NULL,APECS}, | |
2768 | - {"XL",NULL,NULL,APECS}, | |
2769 | + {"XL",NULL,NULL,APECS}, | |
2770 | {"Avanti",NULL,NULL,APECS}, | |
2771 | {"Mikasa",NULL,"EV5",CIA}, | |
2772 | {"Mikasa",NULL,"EV56",CIA}, | |
2773 | {"Mikasa",NULL,NULL,APECS}, | |
2774 | {"EB164","EB164",NULL,CIA}, | |
2775 | - {"EB164","PC164", NULL,CIA}, | |
2776 | - {"EB164","RX164",NULL, POLARIS}, | |
2777 | - {"EB164","SX164",NULL, PYXIS}, | |
2778 | - {"EB164","LX164",NULL, PYXIS}, | |
2779 | + {"EB164","PC164",NULL,CIA}, | |
2780 | + {"EB164","RX164",NULL,POLARIS}, | |
2781 | + {"EB164","SX164",NULL,PYXIS}, | |
2782 | + {"EB164","LX164",NULL,PYXIS}, | |
2783 | {"Alcor",NULL,NULL,CIA}, | |
2784 | {"Takara",NULL,NULL,CIA}, | |
2785 | - {"Sable",NULL, "EV5",T2_GAMMA}, | |
2786 | + {"Sable",NULL,"EV5",T2_GAMMA}, | |
2787 | {"Sable",NULL,"EV56",T2_GAMMA}, | |
2788 | {"Sable",NULL,NULL,T2}, | |
2789 | {"Rawhide",NULL,NULL,MCPCIA}, | |
2790 | diff -ur xc.orig/programs/Xserver/hw/xfree86/os-support/linux/lnx_ev56.c xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_ev56.c | |
2791 | --- xc.orig/programs/Xserver/hw/xfree86/os-support/linux/lnx_ev56.c Thu Feb 17 08:45:49 2000 | |
2792 | +++ xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_ev56.c Sun Mar 18 16:51:30 2001 | |
2793 | @@ -29,18 +29,21 @@ | |
2794 | int | |
2795 | readDense8(pointer Base, register unsigned long Offset) | |
2796 | { | |
2797 | + mem_barrier(); | |
2798 | return *(volatile CARD8*) ((unsigned long)Base+(Offset)); | |
2799 | } | |
2800 | ||
2801 | int | |
2802 | readDense16(pointer Base, register unsigned long Offset) | |
2803 | { | |
2804 | + mem_barrier(); | |
2805 | return *(volatile CARD16*) ((unsigned long)Base+(Offset)); | |
2806 | } | |
2807 | ||
2808 | int | |
2809 | readDense32(pointer Base, register unsigned long Offset) | |
2810 | { | |
2811 | + mem_barrier(); | |
2812 | return *(volatile CARD32*)((unsigned long)Base+(Offset)); | |
2813 | } | |
2814 | ||
2815 | @@ -65,20 +68,20 @@ | |
2816 | void | |
2817 | writeDense8(int Value, pointer Base, register unsigned long Offset) | |
2818 | { | |
2819 | + write_mem_barrier(); | |
2820 | *(volatile CARD8 *)((unsigned long)Base+(Offset)) = Value; | |
2821 | - mem_barrier(); | |
2822 | } | |
2823 | ||
2824 | void | |
2825 | writeDense16(int Value, pointer Base, register unsigned long Offset) | |
2826 | { | |
2827 | + write_mem_barrier(); | |
2828 | *(volatile CARD16 *)((unsigned long)Base+(Offset)) = Value; | |
2829 | - mem_barrier(); | |
2830 | } | |
2831 | ||
2832 | void | |
2833 | writeDense32(int Value, pointer Base, register unsigned long Offset) | |
2834 | { | |
2835 | + write_mem_barrier(); | |
2836 | *(volatile CARD32 *)((unsigned long)Base+(Offset)) = Value; | |
2837 | - mem_barrier(); | |
2838 | } | |
2839 | diff -ur xc.orig/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c | |
2840 | --- xc.orig/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c Fri Dec 8 22:59:56 2000 | |
2841 | +++ xc/programs/Xserver/hw/xfree86/os-support/linux/lnx_video.c Sun Mar 18 17:29:04 2001 | |
2842 | @@ -614,15 +614,16 @@ | |
2843 | ||
2844 | Offset += (unsigned long)Base - (unsigned long)lnxBase; | |
2845 | shift = (Offset & 0x3) << 3; | |
2846 | - if (Offset >= (hae_thresh)) { | |
2847 | + if (Offset >= (hae_thresh)) { | |
2848 | msb = Offset & hae_mask; | |
2849 | Offset -= msb; | |
2850 | if (msb_set != msb) { | |
2851 | - sethae(msb); | |
2852 | - msb_set = msb; | |
2853 | + sethae(msb); | |
2854 | + msb_set = msb; | |
2855 | } | |
2856 | - } | |
2857 | + } | |
2858 | ||
2859 | + mem_barrier(); | |
2860 | result = *(vuip) ((unsigned long)lnxSBase + (Offset << 5)); | |
2861 | result >>= shift; | |
2862 | return 0xffUL & result; | |
2863 | @@ -636,14 +637,16 @@ | |
2864 | ||
2865 | Offset += (unsigned long)Base - (unsigned long)lnxBase; | |
2866 | shift = (Offset & 0x2) << 3; | |
2867 | - if (Offset >= hae_thresh) { | |
2868 | + if (Offset >= hae_thresh) { | |
2869 | msb = Offset & hae_mask; | |
2870 | Offset -= msb; | |
2871 | - if (msb_set != msb) { | |
2872 | - sethae(msb); | |
2873 | - msb_set = msb; | |
2874 | - } | |
2875 | + if (msb_set != msb) { | |
2876 | + sethae(msb); | |
2877 | + msb_set = msb; | |
2878 | + } | |
2879 | } | |
2880 | + | |
2881 | + mem_barrier(); | |
2882 | result = *(vuip)((unsigned long)lnxSBase+(Offset<<5)+(1<<(5-2))); | |
2883 | result >>= shift; | |
2884 | return 0xffffUL & result; | |
2885 | @@ -652,6 +655,8 @@ | |
2886 | static int | |
2887 | readSparse32(pointer Base, register unsigned long Offset) | |
2888 | { | |
2889 | + /* note that this is actually doing a DENSE read... */ | |
2890 | + mem_barrier(); | |
2891 | return *(vuip)((unsigned long)Base+(Offset)); | |
2892 | } | |
2893 | ||
2894 | @@ -670,8 +675,8 @@ | |
2895 | msb_set = msb; | |
2896 | } | |
2897 | } | |
2898 | + write_mem_barrier(); | |
2899 | *(vuip) ((unsigned long)lnxSBase + (Offset << 5)) = b * 0x01010101; | |
2900 | - mem_barrier(); | |
2901 | } | |
2902 | ||
2903 | static void | |
2904 | @@ -689,17 +694,16 @@ | |
2905 | msb_set = msb; | |
2906 | } | |
2907 | } | |
2908 | - *(vuip)((unsigned long)lnxSBase+(Offset<<5)+(1<<(5-2))) = | |
2909 | - w * 0x00010001; | |
2910 | - mem_barrier(); | |
2911 | - | |
2912 | + write_mem_barrier(); | |
2913 | + *(vuip)((unsigned long)lnxSBase+(Offset<<5)+(1<<(5-2))) = w * 0x00010001; | |
2914 | } | |
2915 | ||
2916 | static void | |
2917 | writeSparse32(int Value, pointer Base, register unsigned long Offset) | |
2918 | { | |
2919 | + /* note that this is actually doing a DENSE write... */ | |
2920 | + write_mem_barrier(); | |
2921 | *(vuip)((unsigned long)Base + (Offset)) = Value; | |
2922 | - mem_barrier(); | |
2923 | return; | |
2924 | } | |
2925 | ||
2926 | diff -ur xc.orig/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h | |
2927 | --- xc.orig/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h Fri Dec 8 22:59:49 2000 | |
2928 | +++ xc/programs/Xserver/hw/xfree86/os-support/xf86_OSproc.h Sun Mar 18 16:51:30 2001 | |
2929 | @@ -194,13 +194,6 @@ | |
2930 | extern Bool xf86UnbindGARTMemory(int screenNum, int key); | |
2931 | extern Bool xf86EnableAGP(int screenNum, CARD32 mode); | |
2932 | ||
2933 | -#if defined(__alpha__) | |
2934 | -extern void xf86JensenMemToBus(char *, long, long, int); | |
2935 | -extern void xf86JensenBusToMem(char *, char *, unsigned long, int); | |
2936 | -extern void xf86SlowBCopyFromBus(unsigned char *, unsigned char *, int); | |
2937 | -extern void xf86SlowBCopyToBus(unsigned char *, unsigned char *, int); | |
2938 | -#endif /* __alpha__ */ | |
2939 | - | |
2940 | /* These routines are in shared/sigio.c and are not loaded as part of the | |
2941 | module. These routines are small, and the code if very POSIX-signal (or | |
2942 | OS-signal) specific, so it seemed better to provide more complex |