]>
Commit | Line | Data |
---|---|---|
a19699fe | 1 | diff -ur programs/Xserver/hw/xfree86/drivers/i810_old/common.h programs/Xserver/hw/xfree86/drivers/i810/common.h |
2 | --- programs/Xserver/hw/xfree86/drivers/i810_old/common.h 2004-09-29 16:03:59.645813735 +0200 | |
3 | +++ programs/Xserver/hw/xfree86/drivers/i810/common.h 2004-09-29 16:04:13.974719718 +0200 | |
4 | @@ -173,7 +173,7 @@ | |
5 | #define BEGIN_LP_RING(n) \ | |
6 | unsigned int outring, ringmask; \ | |
7 | volatile unsigned char *virt; \ | |
8 | - unsigned int needed; \ | |
9 | + int needed; \ | |
10 | if ((n) & 1) \ | |
11 | ErrorF("BEGIN_LP_RING called with odd argument: %d\n", n); \ | |
12 | if ((n) > 2 && (I810_DEBUG&DEBUG_ALWAYS_SYNC)) \ | |
13 | @@ -206,7 +206,7 @@ | |
14 | #define BEGIN_LP_RING(n) \ | |
15 | unsigned int outring, ringmask; \ | |
16 | volatile unsigned char *virt; \ | |
17 | - unsigned int needed; \ | |
18 | + int needed; \ | |
19 | if ((n) & 1) \ | |
20 | ErrorF("BEGIN_LP_RING called with odd argument: %d\n", n); \ | |
21 | if ((n) > 2 && (I810_DEBUG&DEBUG_ALWAYS_SYNC)) \ | |
22 | diff -ur programs/Xserver/hw/xfree86/drivers/i810_old/i810.h programs/Xserver/hw/xfree86/drivers/i810/i810.h | |
23 | --- programs/Xserver/hw/xfree86/drivers/i810_old/i810.h 2004-09-29 16:03:59.639814611 +0200 | |
24 | +++ programs/Xserver/hw/xfree86/drivers/i810/i810.h 2004-09-29 16:04:13.974719718 +0200 | |
25 | @@ -172,7 +172,7 @@ | |
26 | unsigned long OverlayPhysical; | |
27 | unsigned long OverlayStart; | |
28 | int colorKey; | |
29 | - int surfaceAllocation[I810_TOTAL_SURFACES]; | |
30 | + unsigned int surfaceAllocation[I810_TOTAL_SURFACES]; | |
31 | int numSurfaces; | |
32 | ||
33 | DGAModePtr DGAModes; | |
34 | @@ -295,9 +295,10 @@ | |
35 | extern void I810Sync(ScrnInfoPtr pScrn); | |
36 | extern unsigned long I810LocalToPhysical(ScrnInfoPtr pScrn, | |
37 | unsigned long local); | |
38 | -extern int I810AllocLow(I810MemRange * result, I810MemRange * pool, int size); | |
39 | +extern int I810AllocLow(I810MemRange * result, I810MemRange * pool, | |
40 | + int size); | |
41 | extern int I810AllocHigh(I810MemRange * result, I810MemRange * pool, | |
42 | - int size); | |
43 | + int size); | |
44 | extern Bool I810AllocateFront(ScrnInfoPtr pScrn); | |
45 | ||
46 | extern int I810AllocateGARTMemory(ScrnInfoPtr pScrn); | |
47 | diff -ur programs/Xserver/hw/xfree86/drivers/i810_old/i810_accel.c programs/Xserver/hw/xfree86/drivers/i810/i810_accel.c | |
48 | --- programs/Xserver/hw/xfree86/drivers/i810_old/i810_accel.c 2004-09-29 16:03:59.612818556 +0200 | |
49 | +++ programs/Xserver/hw/xfree86/drivers/i810/i810_accel.c 2004-09-29 16:04:13.975719572 +0200 | |
50 | @@ -259,7 +259,7 @@ | |
51 | #ifdef XF86DRI | |
52 | /* VT switching tries to do this. | |
53 | */ | |
54 | - if (!pI810->LockHeld && pI810->directRenderingEnabled) { | |
55 | + if ((!pI810->LockHeld && pI810->directRenderingEnabled) || !pScrn->vtSema) { | |
56 | return; | |
57 | } | |
58 | #endif | |
59 | diff -ur programs/Xserver/hw/xfree86/drivers/i810_old/i810_dri.c programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c | |
60 | --- programs/Xserver/hw/xfree86/drivers/i810_old/i810_dri.c 2004-09-29 16:03:59.671809935 +0200 | |
61 | +++ programs/Xserver/hw/xfree86/drivers/i810/i810_dri.c 2004-09-29 16:04:13.977719280 +0200 | |
62 | @@ -290,7 +290,7 @@ | |
63 | unsigned long dcacheHandle; | |
64 | int sysmem_size = 0; | |
65 | int back_size = 0; | |
66 | - int pitch_idx = 0; | |
67 | + unsigned int pitch_idx = 0; | |
68 | int bufs; | |
69 | int width = pScrn->displayWidth * pI810->cpp; | |
70 | int i; | |
71 | diff -ur programs/Xserver/hw/xfree86/drivers/i810_old/i810_driver.c programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c | |
72 | --- programs/Xserver/hw/xfree86/drivers/i810_old/i810_driver.c 2004-09-29 16:03:59.553827177 +0200 | |
73 | +++ programs/Xserver/hw/xfree86/drivers/i810/i810_driver.c 2004-09-29 16:04:13.979718988 +0200 | |
74 | @@ -1124,14 +1124,6 @@ | |
75 | xf86SetOperatingState(resVgaIo, pI810->pEnt->index, ResUnusedOpr); | |
76 | xf86SetOperatingState(resVgaMem, pI810->pEnt->index, ResDisableOpr); | |
77 | ||
78 | - pI810->LpRing = xalloc(sizeof(I810RingBuffer)); | |
79 | - if (!pI810->LpRing) { | |
80 | - xf86DrvMsg(pScrn->scrnIndex, X_ERROR, | |
81 | - "Could not allocate lpring data structure.\n"); | |
82 | - I810FreeRec(pScrn); | |
83 | - return FALSE; | |
84 | - } | |
85 | - | |
86 | return TRUE; | |
87 | } | |
88 | ||
89 | @@ -1159,7 +1151,7 @@ | |
90 | I810MapMem(ScrnInfoPtr pScrn) | |
91 | { | |
92 | I810Ptr pI810 = I810PTR(pScrn); | |
93 | - unsigned i; | |
94 | + long i; | |
95 | ||
96 | for (i = 2; i < pI810->FbMapSize; i <<= 1) ; | |
97 | pI810->FbMapSize = i; | |
98 | @@ -2074,6 +2066,13 @@ | |
99 | pI810 = I810PTR(pScrn); | |
100 | hwp = VGAHWPTR(pScrn); | |
101 | ||
102 | + pI810->LpRing = xcalloc(sizeof(I810RingBuffer),1); | |
103 | + if (!pI810->LpRing) { | |
104 | + xf86DrvMsg(pScrn->scrnIndex, X_ERROR, | |
105 | + "Could not allocate lpring data structure.\n"); | |
106 | + return FALSE; | |
107 | + } | |
108 | + | |
109 | miClearVisualTypes(); | |
110 | ||
111 | /* Re-implemented Direct Color support, -jens */ | |
112 | diff -ur programs/Xserver/hw/xfree86/drivers/i810_old/i810_memory.c programs/Xserver/hw/xfree86/drivers/i810/i810_memory.c | |
113 | --- programs/Xserver/hw/xfree86/drivers/i810_old/i810_memory.c 2004-09-29 16:03:59.659811689 +0200 | |
114 | +++ programs/Xserver/hw/xfree86/drivers/i810/i810_memory.c 2004-09-29 16:04:13.980718842 +0200 | |
115 | @@ -55,7 +55,7 @@ | |
116 | int | |
117 | I810AllocLow(I810MemRange * result, I810MemRange * pool, int size) | |
118 | { | |
119 | - if (size > pool->Size) | |
120 | + if (size > (long)pool->Size) | |
121 | return 0; | |
122 | ||
123 | pool->Size -= size; | |
124 | @@ -69,7 +69,7 @@ | |
125 | int | |
126 | I810AllocHigh(I810MemRange * result, I810MemRange * pool, int size) | |
127 | { | |
128 | - if (size > pool->Size) | |
129 | + if (size > (long)pool->Size) | |
130 | return 0; | |
131 | ||
132 | pool->Size -= size; | |
133 | diff -ur programs/Xserver/hw/xfree86/drivers/i810_old/i810_reg.h programs/Xserver/hw/xfree86/drivers/i810/i810_reg.h | |
134 | --- programs/Xserver/hw/xfree86/drivers/i810_old/i810_reg.h 2004-09-29 16:03:59.736800438 +0200 | |
135 | +++ programs/Xserver/hw/xfree86/drivers/i810/i810_reg.h 2004-09-29 16:04:13.981718696 +0200 | |
136 | @@ -459,11 +459,11 @@ | |
137 | #define I830_HEAD_MASK 0x001FFFFC | |
138 | ||
139 | #define RING_START 0x08 | |
140 | -#define START_ADDR 0x00FFFFF8 | |
141 | +#define START_ADDR 0x03FFFFF8 | |
142 | #define I830_RING_START_MASK 0xFFFFF000 | |
143 | ||
144 | #define RING_LEN 0x0C | |
145 | -#define RING_NR_PAGES 0x000FF000 | |
146 | +#define RING_NR_PAGES 0x001FF000 | |
147 | #define I830_RING_NR_PAGES 0x001FF000 | |
148 | #define RING_REPORT_MASK 0x00000006 | |
149 | #define RING_REPORT_64K 0x00000002 | |
150 | diff -ur programs/Xserver/hw/xfree86/drivers/i810_old/i830.h programs/Xserver/hw/xfree86/drivers/i810/i830.h | |
151 | --- programs/Xserver/hw/xfree86/drivers/i810_old/i830.h 2004-09-29 16:03:59.645813735 +0200 | |
152 | +++ programs/Xserver/hw/xfree86/drivers/i810/i830.h 2004-09-29 16:04:13.982718550 +0200 | |
153 | @@ -180,17 +180,17 @@ | |
154 | int CacheLines; | |
155 | ||
156 | /* These are set in PreInit and never changed. */ | |
157 | - unsigned long FbMapSize; | |
158 | - unsigned long TotalVideoRam; | |
159 | + long FbMapSize; | |
160 | + long TotalVideoRam; | |
161 | I830MemRange StolenMemory; /* pre-allocated memory */ | |
162 | - unsigned long BIOSMemorySize; /* min stolen pool size */ | |
163 | + long BIOSMemorySize; /* min stolen pool size */ | |
164 | int BIOSMemSizeLoc; | |
165 | ||
166 | /* These change according to what has been allocated. */ | |
167 | long FreeMemory; | |
168 | I830MemRange MemoryAperture; | |
169 | I830MemPool StolenPool; | |
170 | - unsigned long allocatedMemory; | |
171 | + long allocatedMemory; | |
172 | ||
173 | /* Regions allocated either from the above pools, or from agpgart. */ | |
174 | /* for single and dual head configurations */ | |
175 | @@ -348,7 +348,7 @@ | |
176 | int xoffset; | |
177 | int yoffset; | |
178 | ||
179 | - int SaveGeneration; | |
180 | + unsigned int SaveGeneration; | |
181 | Bool vbeRestoreWorkaround; | |
182 | Bool displayInfo; | |
183 | Bool devicePresence; | |
184 | @@ -415,7 +415,7 @@ | |
185 | extern Bool I830BindGARTMemory(ScrnInfoPtr pScrn); | |
186 | extern Bool I830UnbindGARTMemory(ScrnInfoPtr pScrn); | |
187 | extern unsigned long I830AllocVidMem(ScrnInfoPtr pScrn, I830MemRange *result, | |
188 | - I830MemPool *pool, unsigned long size, | |
189 | + I830MemPool *pool, long size, | |
190 | unsigned long alignment, int flags); | |
191 | ||
192 | extern void I830PrintAllRegisters(I830RegPtr i830Reg); | |
193 | diff -ur programs/Xserver/hw/xfree86/drivers/i810_old/i830_driver.c programs/Xserver/hw/xfree86/drivers/i810/i830_driver.c | |
194 | --- programs/Xserver/hw/xfree86/drivers/i810_old/i830_driver.c 2004-09-29 16:03:59.646813588 +0200 | |
195 | +++ programs/Xserver/hw/xfree86/drivers/i810/i830_driver.c 2004-09-29 16:04:13.986717965 +0200 | |
196 | @@ -1028,7 +1028,7 @@ | |
197 | I830MapMem(ScrnInfoPtr pScrn) | |
198 | { | |
199 | I830Ptr pI830 = I830PTR(pScrn); | |
200 | - unsigned i; | |
201 | + long i; | |
202 | ||
203 | for (i = 2; i < pI830->FbMapSize; i <<= 1) ; | |
204 | pI830->FbMapSize = i; | |
205 | @@ -2909,7 +2909,7 @@ | |
206 | OUTREG(LP_RING + RING_TAIL, 0); | |
207 | OUTREG(LP_RING + RING_HEAD, 0); | |
208 | ||
209 | - if ((pI830->LpRing->mem.Start & I830_RING_START_MASK) != | |
210 | + if ((long)(pI830->LpRing->mem.Start & I830_RING_START_MASK) != | |
211 | pI830->LpRing->mem.Start) { | |
212 | xf86DrvMsg(pScrn->scrnIndex, X_ERROR, | |
213 | "I830SetRingRegs: Ring buffer start (%lx) violates its " | |
214 | @@ -3452,7 +3452,7 @@ | |
215 | I830Ptr pI8301 = I830PTR(pI830->entityPrivate->pScrn_1); | |
216 | ||
217 | temp = INREG(stridereg); | |
218 | - if (temp / pI8301->cpp != pI830->entityPrivate->pScrn_1->displayWidth) { | |
219 | + if (temp / pI8301->cpp != (CARD32)(pI830->entityPrivate->pScrn_1->displayWidth)) { | |
220 | xf86DrvMsg(pScrn->scrnIndex, X_WARNING, | |
221 | "Correcting plane %c stride (%d -> %d)\n", PIPE_NAME(pI830->pipe), | |
222 | (int)(temp / pI8301->cpp), pI830->entityPrivate->pScrn_1->displayWidth); | |
223 | @@ -3470,7 +3470,7 @@ | |
224 | sizereg = pI830->pipe ? DSPASIZE : DSPBSIZE; | |
225 | ||
226 | temp = INREG(stridereg); | |
227 | - if (temp / pI8302->cpp != pI830->entityPrivate->pScrn_2->displayWidth) { | |
228 | + if (temp / pI8302->cpp != (CARD32)(pI830->entityPrivate->pScrn_2->displayWidth)) { | |
229 | xf86DrvMsg(pScrn->scrnIndex, X_WARNING, | |
230 | "Correcting plane %c stride (%d -> %d)\n", PIPE_NAME(!pI830->pipe), | |
231 | (int)(temp / pI8302->cpp), pI830->entityPrivate->pScrn_2->displayWidth); | |
232 | @@ -3489,7 +3489,7 @@ | |
233 | I830Ptr pI8302 = I830PTR(pI830->entityPrivate->pScrn_2); | |
234 | ||
235 | temp = INREG(stridereg); | |
236 | - if (temp / pI8301->cpp != pI830->entityPrivate->pScrn_1->displayWidth) { | |
237 | + if (temp / pI8301->cpp != (CARD32)(pI830->entityPrivate->pScrn_1->displayWidth)) { | |
238 | xf86DrvMsg(pScrn->scrnIndex, X_WARNING, | |
239 | "Correcting plane %c stride (%d -> %d)\n", PIPE_NAME(pI830->pipe), | |
240 | (int)(temp / pI8301->cpp), pI830->entityPrivate->pScrn_1->displayWidth); | |
241 | @@ -3505,7 +3505,7 @@ | |
242 | sizereg = !pI830->pipe ? DSPASIZE : DSPBSIZE; | |
243 | ||
244 | temp = INREG(stridereg); | |
245 | - if (temp / pI8302->cpp != pI830->entityPrivate->pScrn_2->displayWidth) { | |
246 | + if (temp / pI8302->cpp != ((CARD32)pI830->entityPrivate->pScrn_2->displayWidth)) { | |
247 | xf86DrvMsg(pScrn->scrnIndex, X_WARNING, | |
248 | "Correcting plane %c stride (%d -> %d)\n", PIPE_NAME(!pI830->pipe), | |
249 | (int)(temp / pI8302->cpp), pI830->entityPrivate->pScrn_2->displayWidth); | |
250 | @@ -3526,7 +3526,7 @@ | |
251 | continue; | |
252 | ||
253 | temp = INREG(stridereg); | |
254 | - if (temp / pI830->cpp != pScrn->displayWidth) { | |
255 | + if (temp / pI830->cpp != (CARD32)pScrn->displayWidth) { | |
256 | xf86DrvMsg(pScrn->scrnIndex, X_WARNING, | |
257 | "Correcting plane %c stride (%d -> %d)\n", PIPE_NAME(i), | |
258 | (int)(temp / pI830->cpp), pScrn->displayWidth); | |
259 | @@ -4527,7 +4527,8 @@ | |
260 | ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; | |
261 | I830Ptr pI830 = I830PTR(pScrn); | |
262 | Bool on = xf86IsUnblank(mode); | |
263 | - CARD32 temp, ctrl, base, i; | |
264 | + CARD32 temp, ctrl, base; | |
265 | + int i; | |
266 | ||
267 | DPRINTF(PFX, "I830BIOSSaveScreen: %d, on is %s\n", mode, BOOLTOSTRING(on)); | |
268 | ||
269 | Only in programs/Xserver/hw/xfree86/drivers/i810: i830_driver.c.orig | |
270 | diff -ur programs/Xserver/hw/xfree86/drivers/i810_old/i830_memory.c programs/Xserver/hw/xfree86/drivers/i810/i830_memory.c | |
271 | --- programs/Xserver/hw/xfree86/drivers/i810_old/i830_memory.c 2004-09-29 16:03:59.547828054 +0200 | |
272 | +++ programs/Xserver/hw/xfree86/drivers/i810/i830_memory.c 2004-09-29 16:04:13.988717673 +0200 | |
273 | @@ -63,10 +63,10 @@ | |
274 | */ | |
275 | static unsigned long | |
276 | AllocFromPool(ScrnInfoPtr pScrn, I830MemRange *result, I830MemPool *pool, | |
277 | - unsigned long size, unsigned long alignment, int flags) | |
278 | + long size, unsigned long alignment, int flags) | |
279 | { | |
280 | I830Ptr pI830 = I830PTR(pScrn); | |
281 | - unsigned long needed, start, end; | |
282 | + long needed, start, end; | |
283 | Bool dryrun = ((flags & ALLOCATE_DRY_RUN) != 0); | |
284 | ||
285 | if (!result || !pool || !size) | |
286 | @@ -94,7 +94,7 @@ | |
287 | } | |
288 | } | |
289 | if (needed > pool->Free.Size) { | |
290 | - unsigned long extra; | |
291 | + long extra; | |
292 | /* See if the pool can be grown. */ | |
293 | if (pI830->StolenOnly && !dryrun) | |
294 | return 0; | |
295 | @@ -107,7 +107,7 @@ | |
296 | return 0; | |
297 | } | |
298 | ||
299 | - if (!dryrun && (extra > pI830->MemoryAperture.Size)) | |
300 | + if (!dryrun && ((long)extra > pI830->MemoryAperture.Size)) | |
301 | return 0; | |
302 | ||
303 | pool->Free.Size += extra; | |
304 | @@ -136,7 +136,7 @@ | |
305 | } | |
306 | ||
307 | static unsigned long | |
308 | -AllocFromAGP(ScrnInfoPtr pScrn, I830MemRange *result, unsigned long size, | |
309 | +AllocFromAGP(ScrnInfoPtr pScrn, I830MemRange *result, long size, | |
310 | unsigned long alignment, int flags) | |
311 | { | |
312 | I830Ptr pI830 = I830PTR(pScrn); | |
313 | @@ -212,7 +212,7 @@ | |
314 | ||
315 | unsigned long | |
316 | I830AllocVidMem(ScrnInfoPtr pScrn, I830MemRange *result, I830MemPool *pool, | |
317 | - unsigned long size, unsigned long alignment, int flags) | |
318 | + long size, unsigned long alignment, int flags) | |
319 | { | |
320 | I830Ptr pI830 = I830PTR(pScrn); | |
321 | Bool dryrun = ((flags & ALLOCATE_DRY_RUN) != 0); | |
322 | @@ -392,7 +392,7 @@ | |
323 | I830Allocate2DMemory(ScrnInfoPtr pScrn, const int flags) | |
324 | { | |
325 | I830Ptr pI830 = I830PTR(pScrn); | |
326 | - unsigned long size, alloced; | |
327 | + long size, alloced; | |
328 | Bool dryrun = ((flags & ALLOCATE_DRY_RUN) != 0); | |
329 | int verbosity = dryrun ? 4 : 1; | |
330 | const char *s = dryrun ? "[dryrun] " : ""; | |
331 | @@ -610,9 +610,9 @@ | |
332 | return FALSE; | |
333 | } | |
334 | } else { | |
335 | - unsigned long lineSize; | |
336 | - unsigned long extra = 0; | |
337 | - unsigned long maxFb = 0; | |
338 | + long lineSize; | |
339 | + long extra = 0; | |
340 | + long maxFb = 0; | |
341 | ||
342 | /* | |
343 | * XXX Need to "free" up any 3D allocations if the DRI ended up | |
344 | @@ -857,7 +857,7 @@ | |
345 | I830GetExcessMemoryAllocations(ScrnInfoPtr pScrn) | |
346 | { | |
347 | I830Ptr pI830 = I830PTR(pScrn); | |
348 | - unsigned long allocated; | |
349 | + long allocated; | |
350 | ||
351 | allocated = pI830->StolenPool.Total.Size + pI830->allocatedMemory; | |
352 | if (allocated > pI830->TotalVideoRam) | |
353 | @@ -1367,7 +1367,7 @@ | |
354 | I830Ptr pI830 = I830PTR(pScrn); | |
355 | int pitch, ntiles, i; | |
356 | static int nextTile = 0; | |
357 | - static int tileGeneration = -1; | |
358 | + static unsigned int tileGeneration = -1; | |
359 | ||
360 | #if 0 | |
361 | /* Hack to "improve" the alignment of the front buffer. |