]> git.pld-linux.org Git - packages/SVGATextMode.git/blame - SVGATextMode-GeForce.patch
- builds on alpha again, release 15
[packages/SVGATextMode.git] / SVGATextMode-GeForce.patch
CommitLineData
82beb398 1diff -ru SVGATextMode-1.10.orig/XFREE/riva128_clock.c SVGATextMode-1.10/XFREE/riva128_clock.c
b1c07dca 2--- SVGATextMode-1.10.orig/XFREE/riva128_clock.c Tue Jul 18 04:47:15 2000
82beb398
TP
3+++ SVGATextMode-1.10/XFREE/riva128_clock.c Tue Oct 30 03:39:11 2001
4@@ -83,6 +83,13 @@
b1c07dca
TP
5 #define PCI_DEVICE_ID_NVIDIA_VTNT2 0x002C
6 #define PCI_DEVICE_ID_NVIDIA_UVTNT2 0x002D
7 #define PCI_DEVICE_ID_NVIDIA_ITNT2 0x00A0
82beb398
TP
8+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_SDR 0x0100
9+#define PCI_DEVICE_ID_NVIDIA_GEFORCE_DDR 0x0101
10+#define PCI_DEVICE_ID_NVIDIA_GEFORCE2_MX400 0x0110
11+#define PCI_DEVICE_ID_NVIDIA_GEFORCE2_MX200 0x0111
12+#define PCI_DEVICE_ID_NVIDIA_GEFORCE2_GTS 0x0150
13+#define PCI_DEVICE_ID_NVIDIA_GEFORCE2_GTS2 0x0151
14+#define PCI_DEVICE_ID_NVIDIA_GEFORCE2_ULTRA 0x0152
b1c07dca
TP
15
16 vgaPCIInformation *vgaPCIInfo;
17
82beb398
TP
18@@ -92,14 +99,15 @@
19 #define PRAMDAC_PLL_COEFF 0x00000508
20 #define PRAMDAC_PLL_COEFF_SELECT 0x0000050C
21
22+#define PEXTDEV_BASE 0x00101000
23+
24 #define NV3_MIN_CLOCK_IN_KHZ 25000 // Not sure about this, but it seems reasonable
25 #define NV3_MAX_CLOCK_IN_KHZ 230000
26 #define NV4_MAX_CLOCK_IN_KHZ 350000
27
28 static int max_clock, is_nv3, pll_coeff;
29
30-/* NTSC cards have approx 14.3Mhz. Need to detect, but leave for now*/
31-#define PLL_INPUT_FREQ 13500
32+static int PLL_INPUT_FREQ;
33 #define M_MIN 7
34 #define M_MAX 13
35
36@@ -176,7 +184,7 @@
37 // Set the clock to the given speed (in KHz)
38 Bool RIVA128ClockSelect( int clockspeed )
39 {
40- int *ptr;
41+ int *ptr, *ptr2;
42
43 int out;
44 int m, n, p, value;
45@@ -205,7 +213,14 @@
b1c07dca
TP
46 pcr->_device == PCI_DEVICE_ID_NVIDIA_UTNT2 ||
47 pcr->_device == PCI_DEVICE_ID_NVIDIA_VTNT2 ||
48 pcr->_device == PCI_DEVICE_ID_NVIDIA_UVTNT2 ||
49- pcr->_device == PCI_DEVICE_ID_NVIDIA_ITNT2)
50+ pcr->_device == PCI_DEVICE_ID_NVIDIA_ITNT2 ||
82beb398
TP
51+ pcr->_device == PCI_DEVICE_ID_NVIDIA_GEFORCE_SDR ||
52+ pcr->_device == PCI_DEVICE_ID_NVIDIA_GEFORCE_DDR ||
53+ pcr->_device == PCI_DEVICE_ID_NVIDIA_GEFORCE2_MX400 ||
54+ pcr->_device == PCI_DEVICE_ID_NVIDIA_GEFORCE2_MX200 ||
55+ pcr->_device == PCI_DEVICE_ID_NVIDIA_GEFORCE2_GTS ||
56+ pcr->_device == PCI_DEVICE_ID_NVIDIA_GEFORCE2_GTS2 ||
57+ pcr->_device == PCI_DEVICE_ID_NVIDIA_GEFORCE2_ULTRA)
b1c07dca
TP
58 {
59 is_nv3 = 0;
60 pll_coeff = 0x00010700;
82beb398
TP
61@@ -248,6 +263,24 @@
62 PERROR(( "Error mmap'ing /dev/mem" ));
63 return FALSE;
64 }
65+
66+ ptr2 = (int*)mmap(0, 0x1000,PROT_READ|PROT_WRITE,MAP_SHARED, fd, (off_t)(pcr->_base0) + PEXTDEV_BASE);
67+
68+ if( ptr2 == (int*)-1 )
69+ {
70+ PERROR(( "Error mmap'ing /dev/mem" ));
71+ return FALSE;
72+ }
73+
74+ if(is_nv3)
75+ {
76+ PLL_INPUT_FREQ = (ptr2[0x00000000/4]&0x20) ? 13500 : 14318;
77+ }
78+ else
79+ {
80+ PLL_INPUT_FREQ = (ptr2[0x00000000/4]&0x40) ? 14318 : 13500;
81+ }
82+ munmap(ptr2, 0x1000);
83
84 close( fd );
85 #else
This page took 0.074085 seconds and 4 git commands to generate.