]> git.pld-linux.org Git - packages/SVGATextMode.git/blame - SVGATextMode-voodoo.patch
- massive attack s/pld.org.pl/pld-linux.org/
[packages/SVGATextMode.git] / SVGATextMode-voodoo.patch
CommitLineData
f783c0bf
JB
1diff -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
4@@ -21,6 +21,7 @@
5 mga_clock.o \
6 mach64/mach64_mem_access.o mach64/mach64.o \
7 riva128_clock.o \
8+ voodoo_clock.o \
9 xfree_compat.o
10
11 # mach64/mach64clockchips.o \
12diff -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
15@@ -0,0 +1,83 @@
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> */
21+
22+#define STM_XFREE
23+#include <stdlib.h>
24+#include "messages.h"
25+#include "compiler.h"
26+#include "include/Xmd.h"
27+#include "vgaPCI.h"
28+
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
33+
34+static vgaPCIInformation *vgaPCIInfo;
35+
36+/* function taken from svgalib (banshee.c) */
37+#define REFFREQ 14318.18
38+
39+static unsigned
40+comp_lmn(int freq)
41+{
42+ int m, n, k, best_m, best_n, best_k, f_cur, best_error;
43+
44+ best_error=freq;
45+ best_n=best_m=best_k=0;
46+ for (n=1; n<256; n++) {
47+ f_cur=REFFREQ*(n+2);
48+ if (f_cur<freq) {
49+ f_cur=f_cur/3;
50+ if (freq-f_cur<best_error) {
51+ best_error=freq-f_cur;
52+ best_n=n;
53+ best_m=1;
54+ best_k=0;
55+ continue;
56+ }
57+ }
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);
63+ best_n=n;
64+ best_m=m;
65+ best_k=k;
66+ }
67+ }
68+ }
69+ }
70+ return (best_n << 8) | (best_m<<2) | best_k;
71+}
72+/* end of svgalib part */
73+
74+/* set the clock to given speed (kHz) */
75+Bool VoodooClockSelect( int clockspeed )
76+{ vgaPCIInformation *vgapciinfo;
77+ pciConfigPtr pcr = NULL;
78+ int i,pll0;
79+ unsigned int io_base;
80+
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))
88+ break;
89+ if(!pcr) {
90+ PERROR(("No Voodoo Banshee/3+ found in PCI info!\n"));
91+ return FALSE;
92+ }
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);
97+ return TRUE;
98+}
99diff -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
102@@ -110,5 +110,7 @@
103
104 Bool RIVA128ClockSelect( int clockspeed );
105
106+Bool VoodooClockSelect( int clockspeed );
107+
108 #endif
109
110diff -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
113@@ -90,6 +90,7 @@
114 #define CS_MATROX 30
115 #define CS_NEOMAGIC 31
116 #define CS_RIVA128 32
117+#define CS_VOODOO 33
118
119 #define CLKCHIP_NONE -1
120
121@@ -122,6 +123,7 @@
122 #define CLKCHIP_LAGUNA 25
123 #define CLKCHIP_RIVA128 26
124 #define CLKCHIP_MGAG200 27
125+#define CLKCHIP_VOODOO 28
126
127 #define OPT_HIBIT_LOW 1<<0
128 #define OPT_HIBIT_HIGH 1<<1
129@@ -199,6 +201,7 @@
130 { "MATROX", CS_MATROX },
131 { "NEOMAGIC", CS_NEOMAGIC },
132 { "RIVA128", CS_RIVA128 },
133+ { "VOODOO", CS_VOODOO },
134 { "", ENDREC }
135 };
136
137@@ -406,6 +409,12 @@
138 80000
139 },
140
141+ { CS_VOODOO,
142+ 1<<CLKCHIP_VOODOO,
143+ COMMON_OPTS | OPT_CLOCKDIV2,
144+ 270000
145+ },
146+
147 { CS_NONE, /* CS_NONE signals the end of the chipset structure */
148 0,
149 0,
150@@ -446,6 +455,7 @@
151 { "laguna", CLKCHIP_LAGUNA },
152 { "riva128", CLKCHIP_RIVA128 },
153 { "mgag200", CLKCHIP_MGAG200 },
154+ { "voodoo", CLKCHIP_VOODOO },
155 { "", ENDREC }
156 };
157
158@@ -478,6 +488,7 @@
159 { CLKCHIP_LAGUNA, 14318 , 110000 },
160 { CLKCHIP_RIVA128, 14318 , 110000 }, /* another blunt guess */
161 { CLKCHIP_MGAG200, 27051 , 220000 },
162+ { CLKCHIP_VOODOO, 14318 , 270000 },
163 { ENDREC, 0 , 0 }
164 };
165
166diff -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
169@@ -294,6 +294,10 @@
170 case CS_RIVA128:
171 RIVA128ClockSelect(freq);
172 break;
173+ case CS_VOODOO:
174+ VoodooClockSelect(freq);
175+ SET_CLOCKBITS_0_1(3);
176+ break;
177 default: PERROR(("Internal error in set_clockchip_clock: chipset #%d does not support any clockchip.\n", chipset));
178 }
179 if (result == FALSE) PWARNING(("ClockChip: error while programming clock chip\n"));
180diff -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
183@@ -134,6 +134,10 @@
184 .B RIVA128
185 All RIVA128 derivatives (including RIVA128ZX, TNT, and TNT2).
186
187+.TP
188+.B VOODOO
189+Voodoo Banshee and Voodoo 3+. WARNING: no checks are done, BE CAREFUL!!!
190+
191 .PP
192 SVGATextMode needs a configuration file with a similar syntax as
193 \fBXconfig\fP or \fBXF86Config\fP, the configuration file for XFree86, the
194diff -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 @@
198 .B RIVA128
199 Should work on all RIVA128 derivatives (including ZX and TNT)
200
201+.TP
202+.B VOODOO
203+Voodoo Banshee and Voodoo 3+.
204+
205 .SH OPTIONS
206 This section contains a list of all allowed special option flags, as entered
207 on an
208diff -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
211@@ -209,6 +209,9 @@
212 case CS_RIVA128:
213 RIVA128ClockSelect(freq);
214 break;
215+ case CS_VOODOO:
216+ VoodooClockSelect(freq);
217+ break;
218 default: PERROR(("setclock.c: internal error: unknown chip set #%d\n", chipset));
219 }
220
221diff -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
224@@ -62,6 +62,9 @@
225 case CS_RIVA128:
226 clock_data.clockchiptype = CLKCHIP_RIVA128;
227 break;
228+ case CS_VOODOO:
229+ clock_data.clockchiptype = CLKCHIP_VOODOO;
230+ break;
231 }
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"));
234diff -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
237@@ -134,6 +134,7 @@
238 break;
239 case CS_MATROX:
240 case CS_RIVA128:
241+ case CS_VOODOO:
242 get_IO_range(0x400, 1); /* dummy: will give us access to all IO addresses >= 0x400 */
243 break;
244 case CS_ATIMACH64:
This page took 0.094155 seconds and 4 git commands to generate.