diff options
author | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-26 22:48:59 +0000 |
---|---|---|
committer | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-26 22:48:59 +0000 |
commit | 45ac28411cd66380aaab9ccc2c7e2ffd270323c0 (patch) | |
tree | d6de58cd129e4e629aea4f55302b37be91840e36 /src/s3_Trio64DAC.c | |
parent | b8772dfb095f92bdedafae787f74a099182a4594 (diff) |
merge latest (4.3.99.16) from XFree86 (vendor) branch
Diffstat (limited to 'src/s3_Trio64DAC.c')
-rw-r--r-- | src/s3_Trio64DAC.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/s3_Trio64DAC.c b/src/s3_Trio64DAC.c index fa5d5e8..07b88c3 100644 --- a/src/s3_Trio64DAC.c +++ b/src/s3_Trio64DAC.c @@ -24,7 +24,7 @@ * * */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3/s3_Trio64DAC.c,v 1.5 2003/02/17 16:45:24 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/s3/s3_Trio64DAC.c,v 1.8 2003/11/03 05:11:28 tsi Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -180,7 +180,7 @@ S3TrioCalcClock(long freq, int min_m, int min_n1, int max_n1, int min_n2, ffreq = ffreq_min / (1<<max_n2); } if (ffreq > ffreq_max / (1<<min_n2)) { - ErrorF("invalid frequency %1.3F Mhz [freq <= %1.3f Mhz]\n", + ErrorF("invalid frequency %1.3f Mhz [freq <= %1.3f Mhz]\n", ffreq*BASE_FREQ, ffreq_max*BASE_FREQ/(1<<min_n2)); ffreq = ffreq_max / (1<<min_n2); } @@ -220,7 +220,6 @@ static void S3TrioSetPLL(ScrnInfoPtr pScrn, int clk, unsigned char m, unsigned char n) { unsigned char tmp; - int index2; if (clk < 2) { tmp = inb(0x3cc); @@ -244,7 +243,6 @@ static void S3TrioSetPLL(ScrnInfoPtr pScrn, int clk, unsigned char m, outb(0x3c5, tmp | 0x22); outb(0x3c5, tmp | 0x02); } else { - index2 = 0x10; outb(0x3c4, 0x10); outb(0x3c5, n); outb(0x3c4, 0x11); @@ -282,7 +280,7 @@ static void S3TrioSetClock(ScrnInfoPtr pScrn, long freq, int clk, int min_m, void S3Trio64DAC_PreInit(ScrnInfoPtr pScrn) { S3Ptr pS3 = S3PTR(pScrn); - unsigned char SR8, SR27, SR28; + unsigned char SR8, SR27; int m, n, n1, n2, mclk; outb(0x3c4, 0x08); @@ -302,7 +300,7 @@ void S3Trio64DAC_PreInit(ScrnInfoPtr pScrn) outb(0x3c4, 0x27); SR27 = inb(0x3c5); outb(0x3c4, 0x28); - SR28 = inb(0x3c5); + (void) inb(0x3c5); mclk /= ((SR27 >> 2) & 0x03) + 1; } pS3->mclk = mclk; @@ -324,10 +322,14 @@ void S3Trio64DAC_Init(ScrnInfoPtr pScrn, DisplayModePtr mode) if (pS3->Chipset == PCI_CHIP_AURORA64VP) S3TrioSetClock(pScrn, mode->Clock, 2, 1, 1, 63, 0, 3, 2, 135000, 270000); + else if (pS3->Chipset == PCI_CHIP_TRIO64V2_DXGX) + S3TrioSetClock(pScrn, mode->Clock, 2, 1, 1, 31, 0, 3, 2, + 170000, 270000); else S3TrioSetClock(pScrn, mode->Clock, 2, 1, 1, 31, 0, 3, 2, 135000, 270000); + outb(0x3c4, 1); blank = inb(0x3c5); outb(0x3c5, blank | 0x20); /* blank the screen */ @@ -348,6 +350,11 @@ void S3Trio64DAC_Init(ScrnInfoPtr pScrn, DisplayModePtr mode) outb(pS3->vgaCRIndex, 0x33); cr33 = inb(pS3->vgaCRReg) & ~0x28; + if (pS3->Chipset == PCI_CHIP_TRIO64V2_DXGX) + { + cr33 |= 0x20; + } + /* ! pixmux */ switch (pScrn->depth) { case 8: |