1 diff -Nur SVGATextMode-1.10.orig/XFREE/Makefile SVGATextMode-1.10/XFREE/Makefile
2 --- SVGATextMode-1.10.orig/XFREE/Makefile Sun Sep 3 00:50:02 2000
3 +++ SVGATextMode-1.10/XFREE/Makefile Mon Jul 30 17:05:07 2001
6 mach64/mach64_mem_access.o mach64/mach64.o \
11 # mach64/mach64clockchips.o \
12 diff -Nur SVGATextMode-1.10.orig/XFREE/voodoo_clock.c SVGATextMode-1.10/XFREE/voodoo_clock.c
13 --- SVGATextMode-1.10.orig/XFREE/voodoo_clock.c Thu Jan 1 01:00:00 1970
14 +++ SVGATextMode-1.10/XFREE/voodoo_clock.c Mon Jul 30 17:04:22 2001
16 +/* Just in case anyone want use it... but I suggest using tdfxfb, it
17 + allows using larger clocks. NO CHECKS, NO WARRANTY, BE CAREFUL!!!
18 + This piece of code is based on riva128_clock.c, with parts taken
19 + from svgalib Voodoo Banshee driver.
20 + -- Jakub Bogusz <qboosh@pld.org.pl> */
24 +#include "messages.h"
25 +#include "compiler.h"
26 +#include "include/Xmd.h"
29 +#define PCI_VENDOR_ID_3DFX 0x121a
30 +#define PCI_DEVICE_ID_BANSHEE 0x0003
31 +#define PCI_DEVICE_ID_VOODOO3 0x0005
32 +#define PCI_DEVICE_ID_VOODOO4 0x0009
34 +static vgaPCIInformation *vgaPCIInfo;
36 +/* function taken from svgalib (banshee.c) */
37 +#define REFFREQ 14318.18
42 + int m, n, k, best_m, best_n, best_k, f_cur, best_error;
45 + best_n=best_m=best_k=0;
46 + for (n=1; n<256; n++) {
47 + f_cur=REFFREQ*(n+2);
50 + if (freq-f_cur<best_error) {
51 + best_error=freq-f_cur;
58 + for (m=1; m<64; m++) {
59 + for (k=0; k<4; k++) {
60 + f_cur=REFFREQ*(n+2)/(m+2)/(1<<k);
61 + if (abs(f_cur-freq)<best_error) {
62 + best_error=abs(f_cur-freq);
70 + return (best_n << 8) | (best_m<<2) | best_k;
72 +/* end of svgalib part */
74 +/* set the clock to given speed (kHz) */
75 +Bool VoodooClockSelect( int clockspeed )
76 +{ vgaPCIInformation *vgapciinfo;
77 + pciConfigPtr pcr = NULL;
79 + unsigned int io_base;
81 + vgapciinfo = vgaGetPCIInfo();
82 + if (vgapciinfo && vgapciinfo->AllCards)
83 + for (i=0;(pcr=vgapciinfo->AllCards[i]);i++)
84 + if (pcr->_vendor == PCI_VENDOR_ID_3DFX &&
85 + (pcr->_device == PCI_DEVICE_ID_BANSHEE ||
86 + pcr->_device == PCI_DEVICE_ID_VOODOO3 ||
87 + pcr->_device == PCI_DEVICE_ID_VOODOO4))
90 + PERROR(("No Voodoo Banshee/3+ found in PCI info!\n"));
93 + io_base=pcr->_base2 & 0xFFF8;
94 + pll0=comp_lmn(clockspeed);
95 + PDEBUG(("Voodoo ports base = %08x",io_base));
96 + outl(io_base+0x40,pll0);
99 diff -Nur SVGATextMode-1.10.orig/XFREE/xfree_compat.h SVGATextMode-1.10/XFREE/xfree_compat.h
100 --- SVGATextMode-1.10.orig/XFREE/xfree_compat.h Thu Jul 20 15:07:11 2000
101 +++ SVGATextMode-1.10/XFREE/xfree_compat.h Mon Jul 30 15:23:14 2001
104 Bool RIVA128ClockSelect( int clockspeed );
106 +Bool VoodooClockSelect( int clockspeed );
110 diff -Nur SVGATextMode-1.10.orig/chipset.h SVGATextMode-1.10/chipset.h
111 --- SVGATextMode-1.10.orig/chipset.h Thu Jul 20 15:07:11 2000
112 +++ SVGATextMode-1.10/chipset.h Mon Jul 30 15:07:59 2001
115 #define CS_NEOMAGIC 31
116 #define CS_RIVA128 32
117 +#define CS_VOODOO 33
119 #define CLKCHIP_NONE -1
122 #define CLKCHIP_LAGUNA 25
123 #define CLKCHIP_RIVA128 26
124 #define CLKCHIP_MGAG200 27
125 +#define CLKCHIP_VOODOO 28
127 #define OPT_HIBIT_LOW 1<<0
128 #define OPT_HIBIT_HIGH 1<<1
130 { "MATROX", CS_MATROX },
131 { "NEOMAGIC", CS_NEOMAGIC },
132 { "RIVA128", CS_RIVA128 },
133 + { "VOODOO", CS_VOODOO },
143 + COMMON_OPTS | OPT_CLOCKDIV2,
147 { CS_NONE, /* CS_NONE signals the end of the chipset structure */
151 { "laguna", CLKCHIP_LAGUNA },
152 { "riva128", CLKCHIP_RIVA128 },
153 { "mgag200", CLKCHIP_MGAG200 },
154 + { "voodoo", CLKCHIP_VOODOO },
159 { CLKCHIP_LAGUNA, 14318 , 110000 },
160 { CLKCHIP_RIVA128, 14318 , 110000 }, /* another blunt guess */
161 { CLKCHIP_MGAG200, 27051 , 220000 },
162 + { CLKCHIP_VOODOO, 14318 , 270000 },
166 diff -Nur SVGATextMode-1.10.orig/clockchip.c SVGATextMode-1.10/clockchip.c
167 --- SVGATextMode-1.10.orig/clockchip.c Thu Jul 20 15:07:11 2000
168 +++ SVGATextMode-1.10/clockchip.c Mon Jul 30 15:19:00 2001
171 RIVA128ClockSelect(freq);
174 + VoodooClockSelect(freq);
175 + SET_CLOCKBITS_0_1(3);
177 default: PERROR(("Internal error in set_clockchip_clock: chipset #%d does not support any clockchip.\n", chipset));
179 if (result == FALSE) PWARNING(("ClockChip: error while programming clock chip\n"));
180 diff -Nur SVGATextMode-1.10.orig/doc/SVGATextMode.man SVGATextMode-1.10/doc/SVGATextMode.man
181 --- SVGATextMode-1.10.orig/doc/SVGATextMode.man Sat Sep 2 22:06:38 2000
182 +++ SVGATextMode-1.10/doc/SVGATextMode.man Mon Jul 30 17:07:52 2001
185 All RIVA128 derivatives (including RIVA128ZX, TNT, and TNT2).
189 +Voodoo Banshee and Voodoo 3+. WARNING: no checks are done, BE CAREFUL!!!
192 SVGATextMode needs a configuration file with a similar syntax as
193 \fBXconfig\fP or \fBXF86Config\fP, the configuration file for XFree86, the
194 diff -Nur SVGATextMode-1.10.orig/doc/TextConfig.man SVGATextMode-1.10/doc/TextConfig.man
195 --- SVGATextMode-1.10.orig/doc/TextConfig.man Sat Sep 2 22:06:58 2000
196 +++ SVGATextMode-1.10/doc/TextConfig.man Mon Jul 30 17:07:28 2001
197 @@ -1019,6 +1019,10 @@
199 Should work on all RIVA128 derivatives (including ZX and TNT)
203 +Voodoo Banshee and Voodoo 3+.
206 This section contains a list of all allowed special option flags, as entered
208 diff -Nur SVGATextMode-1.10.orig/setclock.c SVGATextMode-1.10/setclock.c
209 --- SVGATextMode-1.10.orig/setclock.c Thu Oct 8 22:22:56 1998
210 +++ SVGATextMode-1.10/setclock.c Mon Jul 30 15:13:02 2001
213 RIVA128ClockSelect(freq);
216 + VoodooClockSelect(freq);
218 default: PERROR(("setclock.c: internal error: unknown chip set #%d\n", chipset));
221 diff -Nur SVGATextMode-1.10.orig/validate.c SVGATextMode-1.10/validate.c
222 --- SVGATextMode-1.10.orig/validate.c Tue Oct 13 21:26:26 1998
223 +++ SVGATextMode-1.10/validate.c Mon Jul 30 15:17:39 2001
226 clock_data.clockchiptype = CLKCHIP_RIVA128;
229 + clock_data.clockchiptype = CLKCHIP_VOODOO;
232 if ((clock_data.num_clocks==0) && (clock_data.clockchiptype==CLKCHIP_NONE) && (!clock_data.ck_prog_path))
233 PERROR(("No Clocks line, no ClockChip and no ClockProg defined in config file. Make up your mind.\n"));
234 diff -Nur SVGATextMode-1.10.orig/vga_prg.c SVGATextMode-1.10/vga_prg.c
235 --- SVGATextMode-1.10.orig/vga_prg.c Sun Sep 3 00:01:59 2000
236 +++ SVGATextMode-1.10/vga_prg.c Mon Jul 30 15:12:28 2001
242 get_IO_range(0x400, 1); /* dummy: will give us access to all IO addresses >= 0x400 */