]> git.pld-linux.org Git - packages/XFree86-Servers.git/blob - XFree86-Servers-new-i810.patch
- move compressed patch to distfiles
[packages/XFree86-Servers.git] / XFree86-Servers-new-i810.patch
1 --- XFree86-3.3.6/xc/config/cf/xfree86.cf.810   Tue Mar 14 23:08:19 2000
2 +++ XFree86-3.3.6/xc/config/cf/xfree86.cf       Tue Mar 14 23:08:19 2000
3 @@ -437,7 +437,7 @@ XCOMM $XConsortium: xfree86.cf /main/34 
4                                 cirrus ncr77c22 compaq mga oak al2101 \
5                                 ali cl64xx video7 ark mx realtek s3_savage s3v apm \
6                                 s3_svga neo chips cyrix rendition p9x00 \
7 -                               spc8110 i740 tdfx smi generic
8 +                               spc8110 i740 tdfx i810 smi generic
9  #  else
10  #   define XF86SvgaDrivers     nv et4000 et3000 pvga1 gvga r128 ati sis tvga8900 \
11                                 cirrus ncr77c22 compaq mga oak al2101 \
12 --- XFree86-3.3.6/xc/programs/Xserver/hw/xfree86/doc/Imakefile.810      Fri Dec  3 01:42:28 1999
13 +++ XFree86-3.3.6/xc/programs/Xserver/hw/xfree86/doc/Imakefile  Tue Mar 14 23:08:19 2000
14 @@ -90,7 +90,7 @@ HWREADME =  README.ati README.trident RE
15              README.I128 README.Mach32 \
16              README.Mach64 README.ark README.MGA README.NVIDIA README.mouse \
17             README.neo README.rendition README.3DLabs README.cyrix \
18 -           README.i740 README.r128
19 +           README.i740 README.r128 README.i810
20  
21  MAINDOCS = COPYRIGHT README README.Config BUILD RELNOTES
22  
23 --- XFree86-3.3.6/xc/programs/Xserver/hw/xfree86/vga256/drivers/i810/i810_memory.c.810  Thu Nov 18 11:22:48 1999
24 +++ XFree86-3.3.6/xc/programs/Xserver/hw/xfree86/vga256/drivers/i810/i810_memory.c      Wed Mar 15 10:16:12 2000
25 @@ -54,343 +54,192 @@ extern vgaPCIInformation *vgaPCIInfo;
26  #include "i810.h"
27  #include "i810_reg.h"
28  
29 -#include <agpgart.h>
30 +#include <linux/agpgart.h>
31  
32  /* DcachePtr will be set up, but not used. 
33   */
34  I810MemRange I810DcacheMem = { 0, 0, 0 };
35  I810MemRange I810SysMem = { 0, 0, 0 };
36 -I810MemRange *I810DisplayPtr = &I810SysMem;
37 -
38 -
39 -#define gtt_None         0
40 -#define gtt_Local        1
41 -#define gtt_Kernel       2
42 -
43 -
44 -/* Used in fallback GTT:
45 - */
46 -static int I810GttType = 0;
47 -static unsigned long I810Physical = 0;
48 -static unsigned long I810GttSize = 0;
49 -static unsigned long I810GttPhysical = 0;
50 -static unsigned long I810ScratchPageLocal = 0;
51  
52 +unsigned long I810TopOfMem = 0;
53  
54  /* Used to determine which watermarks to use:
55   */
56  int I810LmFreqSel = 0;
57  
58 -
59 -/* Communications with the kernel module:
60 +/* Work out the real top of physical memory (not just what it says in
61 + * /proc/meminfo).  Figure out the position and size of the
62 + * preallocated (stolen) video ram segment.  For now, this is all the
63 + * memory we will use.
64   */
65 -static int    gartfd;
66 -static struct gart_info gartinf;
67 -static struct gart_pge_info gart_pg_inf;
68 -
69 -static int I810AllocateGARTMemory( void ) 
70 +Bool I810CharacterizeSystemRam( pciConfigPtr pcr )
71  {
72 -   int size = 4 * 1024 * 1024;
73 -   int i, j, pages = size / 4096; 
74 -   struct stat sb;
75 -
76 -   /* We can only fallback if there is no agpgart module active -
77 -    * otherwise the fallback to system ram screws up the other gart
78 -    * client(s). 
79 +   pciTagRec tag = pcibusTag(pcr->_bus, pcr->_cardnum, pcr->_func);
80 +   unsigned long whtcfg_pamr_drp;
81 +   int pages = 4 * 1024 * 1024 / 4096; 
82 +
83 +   /* Communications with the kernel module:
84      */
85 -   if (stat("/dev/agpgart", &sb) != 0) {
86 -      ErrorF("%s %s: Stat failed on /dev/agpgart: %s\n", 
87 -            XCONFIG_PROBED, vga256InfoRec.name, 
88 -            sys_errlist[errno]);
89 +   int gartfd;
90 +   agp_info agpinf;
91 +   agp_bind bind;
92 +   agp_allocate alloc;
93 +
94 +   /* Physical page reserved for hardware curcor. It is at the top of
95 +      the frame buffer. */
96 +   int hw_cursor_page;
97  
98 -      /* Fallback - we'll manage the GTT ourselves.
99 -       */
100 -      return -1;
101 -   }
102 +   /* Need to do read longs, because read word returns rubbish...
103 +    */
104 +   whtcfg_pamr_drp = pciReadLong( tag, WHTCFG_PAMR_DRP );
105 +
106 +   /* Need this for choosing watermarks.
107 +    */
108 +   if ((whtcfg_pamr_drp & LM_FREQ_MASK) == LM_FREQ_133)
109 +      I810LmFreqSel = 133;
110 +   else
111 +      I810LmFreqSel = 100;
112  
113     gartfd = open("/dev/agpgart", O_RDWR);
114     if (gartfd == -1) { 
115        ErrorF("%s %s: unable to open /dev/agpgart: %s\n", 
116 -            XCONFIG_PROBED, vga256InfoRec.name, 
117 +            XCONFIG_PROBED, vga256InfoRec.name,
118              sys_errlist[errno]);
119        FatalError("Aborting");
120     }
121  
122 -   if (ioctl(gartfd, GARTIOCINFO, &gartinf) != 0) {
123 -      ErrorF("%s %s: error doing ioctl(GARTIOCINFO): %s\n", 
124 -            XCONFIG_PROBED, vga256InfoRec.name, 
125 +   if (ioctl(gartfd, AGPIOC_ACQUIRE) != 0) {
126 +      ErrorF("%s %s: error doing ioctl(AGPIOC_ACQUIRE): %s\n", 
127 +            XCONFIG_PROBED, vga256InfoRec.name,
128              sys_errlist[errno]);
129        FatalError("Aborting");
130     }
131  
132 +   if (ioctl(gartfd, AGPIOC_INFO, &agpinf) != 0) {
133 +      ErrorF("%s %s: error doing ioctl(AGPIOC_INFO): %s\n", 
134 +            XCONFIG_PROBED, vga256InfoRec.name,
135 +            sys_errlist[errno]);
136 +      FatalError("Aborting");
137 +   }
138  
139 -   /* Dcache - half the speed of normal ram, so not really useful for
140 -    * a 2d server.  Don't bother reporting its presence.  
141 -    */
142 -   if (gartinf.num_dcache_slots) {
143 -      I810DcacheMem.Start = gartinf.num_of_slots * 4096;
144 -      I810DcacheMem.Size = gartinf.num_dcache_slots * 4096;
145 -      I810DcacheMem.End = I810DcacheMem.Start + I810DcacheMem.Size;
146 +   if (agpinf.version.major != 0 ||
147 +       agpinf.version.minor != 99) {
148 +      ErrorF("%s %s: Agp kernel driver version not correct\n", 
149 +            XCONFIG_PROBED, vga256InfoRec.name);
150 +      FatalError("Aborting");
151     }
152 -   
153 +
154 +   /* Reserve a page for hardware cursor. */
155 +   hw_cursor_page = OFLG_ISSET(OPTION_SW_CURSOR, &vga256InfoRec.options)
156 +       ? 0 : 1;
157  
158     /* Treat the gart like video memory - we assume we own all that is
159      * there, so ignore EBUSY errors.  Don't try to remove it on
160      * failure, either.
161      */
162 -   for (i = 0; i < pages; i++) 
163 -      if (ioctl(gartfd, GARTIOCINSERT, &i) != 0) {
164 -        if (errno != EBUSY) 
165 -        {      
166 -           perror("gart insert");
167 -           ErrorF("%s %s: GART: allocation of %d pages failed at page %d\n", 
168 -                  XCONFIG_PROBED, vga256InfoRec.name, pages, i);
169 -           FatalError("Aborting");
170 -        }      
171 -      } 
172 +   alloc.pg_count = pages - hw_cursor_page;
173 +   alloc.type = 0;
174  
175 -   ErrorF("%s %s: GART: allocated %dK system ram\n",
176 -         XCONFIG_PROBED, vga256InfoRec.name, pages * 4);
177 -   
178 -   I810SysMem.Start = 0;
179 -   I810SysMem.End = pages * 4096;
180 -   I810SysMem.Size = pages * 4096;
181 -   I810GttType = gtt_Kernel;
182 -
183 -   vga256InfoRec.videoRam = I810SysMem.Size / 1024;
184 +   if (ioctl(gartfd, AGPIOC_ALLOCATE, &alloc) && errno != EBUSY) {
185 +      ErrorF("%s %s: GART: allocation of %d pages: %s\n", 
186 +            XCONFIG_PROBED, vga256InfoRec.name, alloc.pg_count,
187 +            sys_errlist[errno]);
188 +      FatalError("Aborting");
189 +   } 
190  
191 -   return 0;
192 -}
193 +   bind.pg_start = I810TopOfMem / 4096;
194 +   bind.key = alloc.key;
195 +   if (ioctl(gartfd, AGPIOC_BIND, &bind) && errno != EBUSY) {
196 +      ErrorF("%s %s: GART: bind of %d pages: %s\n", 
197 +            XCONFIG_PROBED, vga256InfoRec.name, alloc.pg_count,
198 +            sys_errlist[errno]);
199 +      FatalError("Aborting");
200 +   }
201  
202 +   I810SysMem.Start = I810TopOfMem;
203 +   I810SysMem.End = alloc.pg_count * 4096;
204 +   I810SysMem.Size = I810SysMem.End - I810SysMem.Start;
205 +   I810TopOfMem = I810SysMem.End;
206  
207 -static void I810SetupFallbackGTT()
208 -{
209 -   unsigned int off, pte;
210 +   if (hw_cursor_page) {
211 +      /* Mouse cursor -- The i810 (crazy) needs a physical address in
212 +       * system memory from which to upload the cursor.  We get this
213 +       * from the agpgart module using a special memory type.
214 +       */
215 +      alloc.pg_count = hw_cursor_page;
216 +      alloc.type = 2;
217  
218 -   OUTREG(PGETBL_CTL, (I810GttPhysical | PGETBL_ENABLED));
219 +      if (ioctl(gartfd, AGPIOC_ALLOCATE, &alloc) != 0) {
220 +        ErrorF("%s %s: GART: allocation of %d pages for mouse: %s\n", 
221 +               XCONFIG_PROBED, vga256InfoRec.name, alloc.pg_count,
222 +               sys_errlist[errno]);
223 +      }
224 +      else {
225 +        bind.pg_start = I810TopOfMem / 4096;
226 +        bind.key = alloc.key;
227 +
228 +        if (ioctl(gartfd, AGPIOC_BIND, &bind) != 0) {
229 +           ErrorF("%s %s: GART: bind of %d pages for mouse: %s\n", 
230 +                  XCONFIG_PROBED, vga256InfoRec.name, alloc.pg_count,
231 +                  sys_errlist[errno]);
232 +           ioctl(gartfd, AGPIOC_DEALLOCATE, &alloc);
233 +        }
234 +        else {
235 +           I810CursorPhysical = alloc.physical;
236 +           I810CursorStart = I810TopOfMem;
237  
238 -   /* - load GTT entries via the MMIO aperture 
239 -    * - Use a dedicated scratch page.
240 -    */
241 -   for (off = 0, pte = 0 ; 
242 -       pte < (I810GttSize * 1024) ;
243 -       off += 4096, pte += 4) 
244 -   {
245 -      if (off < I810DcacheMem.End) {
246 -        OUTREG_(PTE_BASE + pte, off | PTE_LOCAL | PTE_VALID);
247 -      } else if (off < I810SysMem.End) {
248 -        OUTREG_(PTE_BASE + pte,
249 -                (I810Physical + off - I810DcacheMem.End)
250 -                | PTE_MAIN_UNCACHED | PTE_VALID);
251 -      } else {
252 -        OUTREG_(PTE_BASE + pte,
253 -                (I810Physical + I810ScratchPageLocal)
254 -                | PTE_MAIN_UNCACHED | PTE_VALID);
255 +           I810TopOfMem += alloc.pg_count * 4096;
256 +        }
257        }
258     }
259 -}
260  
261 -
262 -/* Work out the real top of physical memory (not just what it says in
263 - * /proc/meminfo).  Figure out the position and size of the
264 - * preallocated (stolen) video ram segment.  For now, this is all the
265 - * memory we will use.
266 - */
267 -Bool I810CharacterizeSystemRam( pciConfigPtr pcr )
268 -{
269 -   pciTagRec tag = pcibusTag(pcr->_bus, pcr->_cardnum, pcr->_func);
270 -   unsigned long mb = 0;
271 -   unsigned long foo;
272 -   unsigned long whtcfg_pamr_drp;
273 -   unsigned long smram_miscc;
274 -   int i;
275 -
276 -   /* Need to do read longs, because read word returns rubbish...
277 -    */
278 -   whtcfg_pamr_drp = pciReadLong( tag, WHTCFG_PAMR_DRP );
279 -   smram_miscc = pciReadLong( tag, SMRAM_MISCC );
280 -
281 -   /* Need this for choosing watermarks.
282 +   /* Dcache - half the speed of normal ram, so not really useful for
283 +    * a 2d server.  Don't bother reporting its presence.  This is
284 +    * mapped in addition to the requested amount of system ram.
285      */
286 -   if ((whtcfg_pamr_drp & LM_FREQ_MASK) == LM_FREQ_133)
287 -      I810LmFreqSel = 133;
288 -   else
289 -      I810LmFreqSel = 100;
290 -
291 -
292 -   if (I810AllocateGARTMemory() == 0) 
293 -      return TRUE;
294 -   else if (getenv("I810_UNSUPPORTED_GTT_FALLBACK"))
295 -      ErrorF("%s %s: No kernel GTT support detected - trying to fall back\n",
296 -            XCONFIG_PROBED, vga256InfoRec.name);
297 -   else
298 -      FatalError("Couldn't get memory from gart module,\n"
299 -                "and I810_UNSUPPORTED_GTT_FALLBACK not set.");
300 -
301 +   alloc.pg_count = 1024;
302 +   alloc.type = 1;
303  
304 -   /* Fallback is useful for debugging, or if someone is unable to
305 -    * compile the kernel module (eg. a 1.2.x kernel, or a non-linux
306 -    * operating system).  However there are real drawbacks - there has
307 -    * been little thought given to synchronization between two X
308 -    * servers running on the same hardware, non-X users of the gart
309 -    * (eg svga, fbdev, ggi), and when direct-rendering 3d clients
310 -    * become available the same problems will arise there, too.
311 -    *
312 -    * Additionally, the X server is unable to allocate system memory,
313 -    * so must cram everything into whatever 'stolen' memory was
314 -    * reserved by the chipset at startup.  This is sneaky - the memory
315 -    * isn't guarenteed to be present, and is not guarenteed to be
316 -    * stable, either.
317 -    *
318 -    * Thus this should never be considered anything but a stopgap
319 -    * measure, or tool for special circumstances where a kernel module
320 -    * is unavailable.  
321 +   /* Keep it 512K aligned for the sake of tiled regions.
322      */
323 -   if ((smram_miscc & GFX_MEM_WIN_SIZE) == GFX_MEM_WIN_32M) 
324 -      I810GttSize = 32;
325 -   else
326 -      I810GttSize = 64;
327 +   I810TopOfMem += 0x7ffff;
328 +   I810TopOfMem &= ~0x7ffff;
329  
330 -   ErrorF("%s %s: GTT window size: %ld mb\n", 
331 -         XCONFIG_PROBED, vga256InfoRec.name, I810GttSize);
332 -   
333 -   for ( i = 0 ; i < 2 ; i++ ) {
334 -      char drp;
335 -      int row = 0;
336 -
337 -      switch (i) {
338 -      case 0: drp = whtcfg_pamr_drp >> SYS_DRAM_ROW_0_SHIFT; break;
339 -      case 1: drp = whtcfg_pamr_drp >> SYS_DRAM_ROW_1_SHIFT; break;
340 +   if (ioctl(gartfd, AGPIOC_ALLOCATE, &alloc) != 0) {
341 +      ErrorF("%s %s: GART: %d pages for DCACHE: %s\n", 
342 +               XCONFIG_PROBED, vga256InfoRec.name, alloc.pg_count,
343 +               sys_errlist[errno]);
344 +   }
345 +   else {
346 +      bind.pg_start = I810TopOfMem / 4096;
347 +      bind.key = alloc.key;
348 +
349 +      if (ioctl(gartfd, AGPIOC_BIND, &bind) != 0) {
350 +        ErrorF("%s %s: GART: bind of %d pages for DCACHE: %s\n", 
351 +               XCONFIG_PROBED, vga256InfoRec.name, alloc.pg_count,
352 +               sys_errlist[errno]);
353 +        ioctl(gartfd, AGPIOC_DEALLOCATE, &alloc);
354        }
355 -
356 -      switch (drp & DRAM_MASK) {
357 -      case 0x0: row = DRAM_VALUE_0; break;
358 -      case 0x1: row = DRAM_VALUE_1; break;
359 -        /* no 0x2 value defined  */
360 -      case 0x3: row = DRAM_VALUE_3; break;
361 -      case 0x4: row = DRAM_VALUE_4; break;
362 -      case 0x5: row = DRAM_VALUE_5; break;
363 -      case 0x6: row = DRAM_VALUE_6; break;
364 -      case 0x7: row = DRAM_VALUE_7; break;
365 -      case 0x8: row = DRAM_VALUE_8; break;
366 -      case 0x9: row = DRAM_VALUE_9; break;
367 -      case 0xa: row = DRAM_VALUE_A; break;
368 -      case 0xb: row = DRAM_VALUE_B; break;
369 -      case 0xc: row = DRAM_VALUE_C; break;
370 -      case 0xd: row = DRAM_VALUE_D; break;
371 -      case 0xe: row = DRAM_VALUE_E; break;
372 -      case 0xf: row = DRAM_VALUE_F; break;
373 -      default:
374 -        FatalError("%s %s: Unrecognized system dram row size\n",
375 -                   XCONFIG_PROBED, vga256InfoRec.name);
376 -        break;
377 +      else {
378 +        I810DcacheMem.Start = I810TopOfMem;
379 +        I810DcacheMem.Size = alloc.pg_count * 4096;
380 +        I810DcacheMem.End = I810DcacheMem.Start + I810DcacheMem.Size;
381 +        I810TopOfMem = I810DcacheMem.End;
382        }
383 -
384 -      mb += row;
385 -
386 -      ErrorF("%s %s: System dram row %d, size %d mb\n", 
387 -            XCONFIG_PROBED, vga256InfoRec.name, i, row );
388 -   }
389 -
390 -   ErrorF("%s %s: Installed mainboard ram: %d mb\n", 
391 -         XCONFIG_PROBED, vga256InfoRec.name, mb);
392 -
393 -   mb *= 1024*1024;
394 -
395 -   /* Take into account memory reserved for TSEG, whatever that is.
396 -    */
397 -   switch (smram_miscc & USMM) {
398 -   case USMM_TSEG_512K: mb -= 512 * 1024; break;
399 -   case USMM_TSEG_1M: mb -= 1024 * 1024; break;
400 -   default: break;
401 -   }
402 -
403 -   switch (smram_miscc & GMS) {
404 -   case GMS_DISABLE: 
405 -      ErrorF("i810 is disabled\n");
406 -      return 0;
407 -   case GMS_ENABLE_BARE:
408 -      ErrorF("\nNo system ram reserved for i810, and no kernel GTT\n");
409 -      return 0;
410 -   case GMS_ENABLE_512K:
411 -      I810SysMem.End = 512 * 1024;
412 -      I810Physical = mb - 512 * 1024;
413 -      ErrorF("%s %s: Only 512k system ram available for i810\n",
414 -            XCONFIG_PROBED, vga256InfoRec.name);
415 -      break;
416 -   case GMS_ENABLE_1M:
417 -      I810SysMem.End = 1024 * 1024;
418 -      I810Physical = mb - 1024 * 1024;
419 -      ErrorF("%s %s: Only 1024k system ram available for i810\n",
420 -            XCONFIG_PROBED, vga256InfoRec.name);
421 -      break;
422     }
423  
424 -   /* Reserve space for the GTT and scratch page.
425 -    */
426 -   I810SysMem.End -= I810GttSize * 1024;
427 -   I810GttPhysical = I810Physical + I810SysMem.End;
428 -   I810SysMem.End -= 4096;
429 -   I810ScratchPageLocal = I810SysMem.End;
430 -   I810SysMem.Size = I810SysMem.End - I810SysMem.Start;
431 -
432 -
433 -   /* Breifly map IO registers to virtual address space. */
434 -   I810MMIOBase = xf86MapVidMem(vga256InfoRec.scrnIndex, MMIO_REGION,
435 -                               (pointer)(I810MMIOAddr), 0x80000);
436 -
437 -   if (!I810MMIOBase) 
438 -      FatalError("Couldn't map MMIO region");
439 -
440 -   /* Dcache is too slow for normal use, but it's a way to get a
441 -    * fullsized framebuffer in the fallback mode.  
442 -    */
443 -   if ((INREG8(DRAM_ROW_TYPE) & DRAM_ROW_0) == DRAM_ROW_0_SDRAM)
444 -   {
445 -      ErrorF("%s %s: Detected 4MB dedicated video ram\n",
446 -            XCONFIG_PROBED, vga256InfoRec.name);
447 -
448 -      I810DcacheMem.Start = 0;
449 -      I810DcacheMem.End = 4 * 1024 * 1024;
450 -      I810DcacheMem.Size = I810DcacheMem.End;      
451 -      I810SysMem.Start += I810DcacheMem.Size;
452 -      I810SysMem.End += I810DcacheMem.Size;           
453 -      I810DisplayPtr = &I810DcacheMem;
454 +   if (ioctl(gartfd, AGPIOC_RELEASE) != 0) {
455 +      ErrorF("%s %s: error doing ioctl(AGPIOC_RELEASE): %s\n", 
456 +            XCONFIG_PROBED, vga256InfoRec.name,
457 +            sys_errlist[errno]);
458     }
459  
460 -   vga256InfoRec.videoRam = (I810SysMem.End - I810DcacheMem.Start) / 1024;
461 -   I810GttType = gtt_Local;
462 +   ErrorF("%s %s: GART: allocated %dK system ram\n",
463 +         XCONFIG_PROBED, vga256InfoRec.name, pages * 4);
464     
465 -   I810SetupFallbackGTT();
466 +   vga256InfoRec.videoRam = (pages * 4096) / 1024;
467  
468 -   /* Unmap them again. */
469 -   xf86UnMapVidMem(vga256InfoRec.scrnIndex, MMIO_REGION,
470 -                  (pointer)(I810MMIOAddr), 0x80000);
471     return TRUE;
472 -}
473 -
474 -
475 -unsigned long I810LocalToPhysical( unsigned long local )
476 -{
477 -   switch (I810GttType) {
478 -   case gtt_Local:
479 -      if (I810DisplayPtr == &I810SysMem)
480 -        return I810Physical + local;
481 -      else
482 -        return I810Physical + local - 4 * 1024 * 1024;
483 -      break;
484 -   case gtt_Kernel:
485 -      gart_pg_inf.index = (local + 4095) / 4096;
486 -      if (ioctl(gartfd, GARTIOCPGINFO, &gart_pg_inf) != 0) {
487 -        ErrorF("%s %s: error doing ioctl(GARTIOCINFO, %x): %s\n", 
488 -               XCONFIG_PROBED, vga256InfoRec.name, gart_pg_inf.index,
489 -               sys_errlist[errno]);
490 -        return 0;
491 -      }
492 -      return gart_pg_inf.physical + (local & 4095);
493 -   default:
494 -      return 0;
495 -   }
496  }
497  
498  int I810AllocLow( I810MemRange *result, I810MemRange *pool, int size )
499 --- XFree86-3.3.6/xc/programs/Xserver/hw/xfree86/vga256/drivers/i810/i810_driver.c.810  Thu Nov 18 11:22:48 1999
500 +++ XFree86-3.3.6/xc/programs/Xserver/hw/xfree86/vga256/drivers/i810/i810_driver.c      Wed Mar 15 08:36:05 2000
501 @@ -126,6 +126,7 @@ int I810LinearAddr = 0;
502  int I810MMIOAddr = 0;
503  
504  unsigned long I810CursorPhysical = 0;
505 +unsigned long I810CursorStart = 0;
506  int I810CursorOffset = 0;
507  
508  I810RingBuffer I810LpRing;
509 @@ -196,13 +197,13 @@ vgaVideoChipRec I810 = {
510      (void (*)())NoopDDA,       /* I810SetWrite, */
511      (void (*)())NoopDDA,       /* I810SetReadWrite, */
512  
513 -    0x10000,                   /* banked mode stuff */
514 -    0x10000,                   /*  */
515 -    16,                                /*  */
516 -    0xFFFF,                    /*  */
517 -    0x00000, 0x10000,          /*  */
518 -    0x00000, 0x10000,          /*  */
519 -    FALSE,                     /* banked mode stuff */
520 +    0x10000,                   /* ChipMapSize */
521 +    0x10000,                   /* ChipSegmentSize */
522 +    16,                                /* ChipSegmentShift */
523 +    0xFFFF,                    /* ChipSegmentMask */
524 +    0x00000, 0x10000,          /* ChipReadBottom, ChipReadTop */
525 +    0x00000, 0x10000,          /* ChipUse2Banks, ChipWriteTop */
526 +    FALSE,                     /* ChipUse2Banks */
527      VGA_NO_DIVIDE_VERT,
528      {0,},
529      8,                         /* scanline padding - replace pitchadjust? */
530 @@ -1304,7 +1305,7 @@ I810FbInit()
531     /* Allocate the framebuffer.
532      */
533     if (!I810AllocLow( &I810FrameBuffer, 
534 -                     I810DisplayPtr,
535 +                     &I810SysMem,
536                       (vga256InfoRec.virtualY *
537                        vga256InfoRec.displayWidth *
538                        vgaBytesPerPixel) ))
539 @@ -1318,26 +1319,15 @@ I810FbInit()
540  
541     if (!OFLG_ISSET(OPTION_SW_CURSOR, &vga256InfoRec.options)) 
542     {
543 -      if (!I810AllocHigh( &I810Cursor, &I810SysMem, 4096 )) {
544 -        ErrorF("%s %s: %s: Warning: "
545 -               "Cannot allocate memory in framebuffer for cursor image\n",
546 -               (OFLG_ISSET(OPTION_HW_CURSOR, &vga256InfoRec.options) ?
547 -                XCONFIG_GIVEN : XCONFIG_PROBED),
548 -               vga256InfoRec.name,
549 -               vga256InfoRec.chipset);
550 -      }
551 -      else {
552 -        /* Translate to a physical system memory address - this is the
553 -         * only thing for which the hardware will not use the GTT...  
554 -         */
555 -        I810CursorPhysical = I810LocalToPhysical( I810Cursor.Start ); 
556 -
557 -        if (I810_DEBUG & DEBUG_VERBOSE_MEMORY)
558 -           fprintf(stderr, "cursor local %x phys %x\n", 
559 -                   I810Cursor.Start, I810CursorPhysical);
560 -
561 -        if (I810CursorPhysical) 
562 -           I810CursorInit(); 
563 +      if (I810_DEBUG & DEBUG_VERBOSE_MEMORY)
564 +        fprintf(stderr, "cursor local %x phys %x\n", 
565 +                I810CursorStart, I810CursorPhysical);
566 +
567 +      if (I810CursorPhysical)  {
568 +        I810Cursor.Start = I810CursorStart;
569 +        I810Cursor.Size = 4096;
570 +        I810Cursor.End = I810Cursor.Start + I810Cursor.Size;
571 +        I810CursorInit(); 
572        }
573     }
574  
575 --- XFree86-3.3.6/xc/programs/Xserver/hw/xfree86/vga256/drivers/i810/i810.h.810 Thu Nov 18 11:22:47 1999
576 +++ XFree86-3.3.6/xc/programs/Xserver/hw/xfree86/vga256/drivers/i810/i810.h     Tue Mar 14 23:08:19 2000
577 @@ -47,6 +47,7 @@ extern Bool           I810CharacterizeSy
578  /* Globals */
579  extern unsigned char *I810MMIOBase;
580  extern unsigned long  I810CursorPhysical;
581 +extern unsigned long  I810CursorStart;
582  extern int            I810CursorOffset;
583  extern int            I810Chipset;
584  
585 @@ -61,8 +62,6 @@ typedef struct {
586  
587  extern int I810AllocHigh( I810MemRange *result, I810MemRange *pool, int size );
588  extern int I810AllocLow( I810MemRange *result, I810MemRange *pool, int size );
589 -extern unsigned long I810LocalToPhysical( unsigned long local );
590 -
591  /* 
592   */
593  typedef struct {
594 @@ -80,7 +79,7 @@ extern I810RingBuffer I810LpRing;
595  extern int I810FrameBufferLocked;
596  extern int I810LmFreqSel;
597  
598 -extern I810MemRange I810SysMem, I810DcacheMem, *I810DisplayPtr;
599 +extern I810MemRange I810SysMem, I810DcacheMem;
600  extern I810MemRange I810Mprotect;
601  extern I810MemRange I810Cursor;
602  
603 --- XFree86-3.3.6/xc/programs/Xserver/hw/xfree86/vga256/drivers/i810/i810_wmark.c.810   Thu Nov 18 11:22:48 1999
604 +++ XFree86-3.3.6/xc/programs/Xserver/hw/xfree86/vga256/drivers/i810/i810_wmark.c       Tue Mar 14 23:08:19 2000
605 @@ -320,19 +320,5 @@ unsigned int I810CalcWatermark( double f
606     ErrorF("%s %s: chose watermark 0x%x: (tab.freq %.1f)\n",
607           XCONFIG_PROBED, vga256InfoRec.name, tab[i].wm, tab[i].freq);
608  
609 -   /* None of these values (sourced from intel) have watermarks for
610 -    * the dcache memory.  Fake it for now by using the same watermark
611 -    * for both...  
612 -    *
613 -    * Update: this is probably because dcache isn't real useful as
614 -    * framebuffer memory, so intel's drivers don't need watermarks
615 -    * for that memory because they never use it to feed the ramdacs.
616 -    * We do use it in the fallback mode, so keep the watermarks for
617 -    * now.
618 -    */
619 -   if (I810DisplayPtr == &I810DcacheMem)
620 -      return (tab[i].wm & ~0xffffff) | ((tab[i].wm>>12) & 0xfff);
621 -   else
622 -      return tab[i].wm;
623 +   return tab[i].wm;
624  }
625 -
626 --- XFree86-3.3.6/xc/programs/Xserver/hw/xfree86/vga256/drivers/i810/i810_accel.c.810   Thu Nov 18 11:22:48 1999
627 +++ XFree86-3.3.6/xc/programs/Xserver/hw/xfree86/vga256/drivers/i810/i810_accel.c       Tue Mar 14 23:08:19 2000
628 @@ -257,7 +257,7 @@ I810AccelInit() 
629      if (pix_cache.Size > I810SysMem.Size)
630         pix_cache.Size = I810SysMem.Size;
631      
632 -    if (I810AllocLow( &pix_cache, I810DisplayPtr, pix_cache.Size ))
633 +    if (I810AllocLow( &pix_cache, &I810SysMem, pix_cache.Size ))
634      {
635         xf86AccelInfoRec.PixmapCacheMemoryStart = pix_cache.Start;
636         xf86AccelInfoRec.PixmapCacheMemoryEnd = pix_cache.End;
637 --- XFree86-3.3.6/xc/programs/Xserver/hw/xfree86/xf86config/Cards.810   Tue Mar 14 23:08:19 2000
638 +++ XFree86-3.3.6/xc/programs/Xserver/hw/xfree86/xf86config/Cards       Tue Mar 14 23:08:19 2000
639 @@ -3093,6 +3093,11 @@ SEE Intel 740 (generic)
640  NAME Winfast S900 i740 AGP 8MB
641  SEE Intel 740 (generic)
642  
643 +NAME Intel 810
644 +CHIPSET Intel 810
645 +SERVER SVGA
646 +NOCLOCKPROBE
647 +
648  NAME Voodoo Banshee (generic)
649  CHIPSET Voodoo Banshee
650  SERVER SVGA
This page took 0.139942 seconds and 3 git commands to generate.