diff -Bbur SVGATextMode-1.8-src/TextConfig SVGAnew/TextConfig --- SVGATextMode-1.8-src/TextConfig Wed Nov 12 15:21:29 1997 +++ SVGAnew/TextConfig Tue Apr 20 19:33:03 1999 @@ -295,6 +295,7 @@ #Chipset "matrox" #clockchip "ti3026" # for the Millennium #clockchip "mystique" # for the Mystique +#clockchip "mgag200" # for the G100 and G200 (only tested on last) # for the really unsupported cards, or others using a special clock chip @@ -978,6 +979,8 @@ "B160x32" 94.5 1280 1348 1432 1680 1024 1024 1027 1061 font 8x32 "B160x100" 94.5 1280 1352 1472 1680 800 809 819 850 font 8x8 +#160x100 for Matrox cards +"MGA160x100" 65 1280 1312 1420 1500 800 810 820 830 font 8x8 ############################################################################### # CUSTOM modes: put your own modes (new or adapted from above) here. diff -Bbur SVGATextMode-1.8-src/XFREE/mga_clock.c SVGAnew/XFREE/mga_clock.c --- SVGATextMode-1.8-src/XFREE/mga_clock.c Wed Nov 26 10:53:09 1997 +++ SVGAnew/XFREE/mga_clock.c Tue Apr 20 19:33:08 1999 @@ -58,7 +58,12 @@ { if ((pcr->_device == PCI_CHIP_MGA2064) || (pcr->_device == PCI_CHIP_MGA1064) - || (pcr->_device == PCI_CHIP_MGA2164)) + || (pcr->_device == PCI_CHIP_MGA2164) + || (pcr->_device == PCI_CHIP_MGAG200) + || (pcr->_device == PCI_CHIP_MGAG100) + || (pcr->_device == PCI_CHIP_MGAG200PCI) + || (pcr->_device == PCI_CHIP_MGAG100PCI) + || (pcr->_device == PCI_CHIP_MGA2164AGP)) break; } } @@ -66,7 +71,14 @@ if (!pcr) return(FALSE); - if ((pcr->_device != PCI_CHIP_MGA2064) && (pcr->_device != PCI_CHIP_MGA1064) && (pcr->_device != PCI_CHIP_MGA2164)) + if ((pcr->_device != PCI_CHIP_MGA2064) + && (pcr->_device != PCI_CHIP_MGA1064) + && (pcr->_device != PCI_CHIP_MGA2164) + && (pcr->_device != PCI_CHIP_MGAG100) + && (pcr->_device != PCI_CHIP_MGAG200) + && (pcr->_device != PCI_CHIP_MGAG100PCI) + && (pcr->_device != PCI_CHIP_MGAG200PCI) + && (pcr->_device != PCI_CHIP_MGA2164AGP)) return(FALSE); /* @@ -88,7 +100,12 @@ if ( ( (pcr->_device == PCI_CHIP_MGA1064) && (pcr->_rev_id == 0x3)) || - (pcr->_device == PCI_CHIP_MGA2164)) + (pcr->_device == PCI_CHIP_MGA2164) + || (pcr->_device == PCI_CHIP_MGAG200) + || (pcr->_device == PCI_CHIP_MGAG200PCI) + || (pcr->_device == PCI_CHIP_MGAG100) + || (pcr->_device == PCI_CHIP_MGAG100PCI) + || (pcr->_device == PCI_CHIP_MGA2164AGP)) { /* @@ -122,16 +139,46 @@ return TRUE; } -static ulong midCalcFreq(uchar m, uchar n, uchar p) { - ulong retval = ((14318 * (n + 1)) / (m + 1)) / (p + 1); +static ulong midCalcFreq(int reff, uchar m, uchar n, uchar p) { + ulong retval = ((reff * (n + 1)) / (m + 1)) / (p + 1); return retval; } -static ulong midCalcMNPS(ulong freq, uchar *m, uchar *n, uchar *p, uchar *s) { + + + + + + +static ulong midCalcMNPS(ulong freq, uchar *m, uchar *n, uchar *p, uchar *s, int type) { ulong Fvco; long delta, d; uchar nt, mt, pt; + int feed_div_min, feed_div_max; + int in_div_min, in_div_max; + + int reff; + + switch( type ) +{ +case 0: + reff = 14318; + feed_div_min = 100; + feed_div_max = 127; + in_div_min = 1; + in_div_max = 31; + break; +default: + reff = 27051; + feed_div_min = 7; + feed_div_max = 127; + in_div_min = 1; + in_div_max = 6; + break; +} + + // find m and n such that: // 'freq' - ((14318 * (n + 1)) / (m + 1)) / (p + 1) // is as close to 0 as possible @@ -140,9 +187,9 @@ for (pt = 1; pt <= 8; pt <<= 1) { Fvco = freq * pt; if ((Fvco > 50000) && (Fvco < 220000)) { - for (nt = 127; nt >= 100; nt--) { - for (mt = 1; mt < 32; mt++) { - d = (long)midCalcFreq(mt, nt, (pt - 1)) - (long)freq; + for (nt = feed_div_max; nt >= feed_div_min; nt--) { + for (mt = in_div_min; mt <= in_div_max; mt++) { + d = (long)midCalcFreq(reff, mt, nt, (pt - 1)) - (long)freq; if (d < 0) d = -d; if (d < delta) { *n = nt; @@ -158,7 +205,7 @@ } } } - return midCalcFreq(*m, *n, *p); + return midCalcFreq(reff, *m, *n, *p); } /* ================== XFREE code starts here ======================== */ @@ -194,12 +241,14 @@ return val; } -void midSetPixClock(ulong freq) { +void midSetPixClock(ulong freq, int isG2) { uchar m, n, p, s; uchar tmpByte; PDEBUG(("Requested PIX clock freq: %d\n", freq)); - midCalcMNPS(freq, &m, &n, &p, &s); + freq = midCalcMNPS(freq, &m, &n, &p, &s, isG2); + + PDEBUG(("Actual PIX clock freq: %ld\n", freq)); // MGA1064SG 5-77 // Step 1) force screen off @@ -226,7 +275,7 @@ PDEBUG(("VGA_MISC_W - wrote 0x%02x, read 0x%02x\n", tmpByte, INREG8(VGA_MISC_R))); #endif - + PDEBUG(("Wait for PLL lock\n")); // Step 4) wait for frequency lock while ((MGAinTi3026(MID_XPIXPLLSTAT) & 0x40) != 0x40); #endif diff -Bbur SVGATextMode-1.8-src/XFREE/vgaPCI.c SVGAnew/XFREE/vgaPCI.c --- SVGATextMode-1.8-src/XFREE/vgaPCI.c Wed Nov 26 10:56:43 1997 +++ SVGAnew/XFREE/vgaPCI.c Tue Apr 20 19:33:07 1999 @@ -81,7 +81,8 @@ break; } if (info->Vendor == PCI_VENDOR_MATROX && - (info->ChipType == PCI_CHIP_MGA2164)) { + (info->ChipType == PCI_CHIP_MGA2164 || + info->ChipType == PCI_CHIP_MGA2164AGP)) { info->IOBase = pcrp->_base1; info->MemBase = pcrp->_base0; } diff -Bbur SVGATextMode-1.8-src/XFREE/vgaPCI.h SVGAnew/XFREE/vgaPCI.h --- SVGATextMode-1.8-src/XFREE/vgaPCI.h Wed Nov 26 10:52:14 1997 +++ SVGAnew/XFREE/vgaPCI.h Tue Apr 20 19:33:08 1999 @@ -95,6 +95,12 @@ #define PCI_CHIP_MGA2064 0x0519 #define PCI_CHIP_MGA1064 0x051A #define PCI_CHIP_MGA2164 0x051B +#define PCI_CHIP_MGA2164AGP 0x051F + +#define PCI_CHIP_MGAG200PCI 0x0520 +#define PCI_CHIP_MGAG200 0x0521 +#define PCI_CHIP_MGAG100PCI 0x1000 +#define PCI_CHIP_MGAG100 0x1001 /* Chips & Tech */ #define PCI_CHIP_65545 0x00D8 @@ -255,7 +261,18 @@ {PCI_CHIP_MGA2085, "MGA 2085PX"}, {PCI_CHIP_MGA2064, "MGA 2064W"}, {PCI_CHIP_MGA2164, "MGA 2164W"}, + {PCI_CHIP_MGA2164AGP, "MGA 2164W/AGP"}, {PCI_CHIP_MGA1064, "MGA 1064SG"}, + + + + {PCI_CHIP_MGAG200PCI, "MGA G200 PCI"}, + {PCI_CHIP_MGAG200, "MGA G200 AGP"}, + {PCI_CHIP_MGAG100PCI, "MGA G100 PCI"}, + {PCI_CHIP_MGAG100, "MGA G100 AGP"}, + + + {0x0000, NULL}}}, {PCI_VENDOR_CHIPSTECH, "C&T", { {PCI_CHIP_65545, "65545"}, diff -Bbur SVGATextMode-1.8-src/XFREE/xfree_compat.h SVGAnew/XFREE/xfree_compat.h --- SVGATextMode-1.8-src/XFREE/xfree_compat.h Mon Oct 27 15:03:35 1997 +++ SVGAnew/XFREE/xfree_compat.h Tue Apr 20 19:33:06 1999 @@ -105,7 +105,7 @@ Bool mga_get_pci_info(); void MGATi3026SetPCLK( long f_out, int bpp ); void MGATi3026SetMCLK( long f_out ); -void midSetPixClock( ulong freq ); +void midSetPixClock( ulong freq, int isG2 ); void MGAoutTi3026(unsigned char reg, unsigned char val); diff -Bbur SVGATextMode-1.8-src/chipset.h SVGAnew/chipset.h --- SVGATextMode-1.8-src/chipset.h Wed Nov 12 14:10:33 1997 +++ SVGAnew/chipset.h Tue Apr 20 19:33:10 1999 @@ -119,6 +119,7 @@ #define CLKCHIP_ATT20C408 23 #define CLKCHIP_MGA1064 24 #define CLKCHIP_LAGUNA 25 +#define CLKCHIP_MGAG200 26 #define OPT_HIBIT_LOW 1<<0 #define OPT_HIBIT_HIGH 1<<1 @@ -383,9 +384,9 @@ }, { CS_MATROX, - 1<