diff -Nur SVGATextMode-1.10.orig/XFREE/Makefile SVGATextMode-1.10/XFREE/Makefile --- SVGATextMode-1.10.orig/XFREE/Makefile Sun Sep 3 00:50:02 2000 +++ SVGATextMode-1.10/XFREE/Makefile Mon Jul 30 17:05:07 2001 @@ -21,6 +21,7 @@ mga_clock.o \ mach64/mach64_mem_access.o mach64/mach64.o \ riva128_clock.o \ + voodoo_clock.o \ xfree_compat.o # mach64/mach64clockchips.o \ diff -Nur SVGATextMode-1.10.orig/XFREE/voodoo_clock.c SVGATextMode-1.10/XFREE/voodoo_clock.c --- SVGATextMode-1.10.orig/XFREE/voodoo_clock.c Thu Jan 1 01:00:00 1970 +++ SVGATextMode-1.10/XFREE/voodoo_clock.c Mon Jul 30 17:04:22 2001 @@ -0,0 +1,83 @@ +/* Just in case anyone want use it... but I suggest using tdfxfb, it + allows using larger clocks. NO CHECKS, NO WARRANTY, BE CAREFUL!!! + This piece of code is based on riva128_clock.c, with parts taken + from svgalib Voodoo Banshee driver. + -- Jakub Bogusz */ + +#define STM_XFREE +#include +#include "messages.h" +#include "compiler.h" +#include "include/Xmd.h" +#include "vgaPCI.h" + +#define PCI_VENDOR_ID_3DFX 0x121a +#define PCI_DEVICE_ID_BANSHEE 0x0003 +#define PCI_DEVICE_ID_VOODOO3 0x0005 +#define PCI_DEVICE_ID_VOODOO4 0x0009 + +static vgaPCIInformation *vgaPCIInfo; + +/* function taken from svgalib (banshee.c) */ +#define REFFREQ 14318.18 + +static unsigned +comp_lmn(int freq) +{ + int m, n, k, best_m, best_n, best_k, f_cur, best_error; + + best_error=freq; + best_n=best_m=best_k=0; + for (n=1; n<256; n++) { + f_cur=REFFREQ*(n+2); + if (f_curAllCards) + for (i=0;(pcr=vgapciinfo->AllCards[i]);i++) + if (pcr->_vendor == PCI_VENDOR_ID_3DFX && + (pcr->_device == PCI_DEVICE_ID_BANSHEE || + pcr->_device == PCI_DEVICE_ID_VOODOO3 || + pcr->_device == PCI_DEVICE_ID_VOODOO4)) + break; + if(!pcr) { + PERROR(("No Voodoo Banshee/3+ found in PCI info!\n")); + return FALSE; + } + io_base=pcr->_base2 & 0xFFF8; + pll0=comp_lmn(clockspeed); + PDEBUG(("Voodoo ports base = %08x",io_base)); + outl(io_base+0x40,pll0); + return TRUE; +} diff -Nur SVGATextMode-1.10.orig/XFREE/xfree_compat.h SVGATextMode-1.10/XFREE/xfree_compat.h --- SVGATextMode-1.10.orig/XFREE/xfree_compat.h Thu Jul 20 15:07:11 2000 +++ SVGATextMode-1.10/XFREE/xfree_compat.h Mon Jul 30 15:23:14 2001 @@ -110,5 +110,7 @@ Bool RIVA128ClockSelect( int clockspeed ); +Bool VoodooClockSelect( int clockspeed ); + #endif diff -Nur SVGATextMode-1.10.orig/chipset.h SVGATextMode-1.10/chipset.h --- SVGATextMode-1.10.orig/chipset.h Thu Jul 20 15:07:11 2000 +++ SVGATextMode-1.10/chipset.h Mon Jul 30 15:07:59 2001 @@ -90,6 +90,7 @@ #define CS_MATROX 30 #define CS_NEOMAGIC 31 #define CS_RIVA128 32 +#define CS_VOODOO 33 #define CLKCHIP_NONE -1 @@ -122,6 +123,7 @@ #define CLKCHIP_LAGUNA 25 #define CLKCHIP_RIVA128 26 #define CLKCHIP_MGAG200 27 +#define CLKCHIP_VOODOO 28 #define OPT_HIBIT_LOW 1<<0 #define OPT_HIBIT_HIGH 1<<1 @@ -199,6 +201,7 @@ { "MATROX", CS_MATROX }, { "NEOMAGIC", CS_NEOMAGIC }, { "RIVA128", CS_RIVA128 }, + { "VOODOO", CS_VOODOO }, { "", ENDREC } }; @@ -406,6 +409,12 @@ 80000 }, + { CS_VOODOO, + 1<= 0x400 */ break; case CS_ATIMACH64: