diff options
author | daryll <daryll> | 2000-03-15 22:40:48 +0000 |
---|---|---|
committer | daryll <daryll> | 2000-03-15 22:40:48 +0000 |
commit | 0cf0f696438eca09b6d27cd555bf638227b43c4f (patch) | |
tree | de038044422775db8304be46a1296710fa67a21f | |
parent | b364dd93deb30fdb578c6a62163e3c746982e735 (diff) |
As Bullwinkle would say "This time for sure..." The palette code got
completely messed up in my iterations. This cleans it all up. We're now
using the TDFX specific access functions, which is better for multihead.
-rw-r--r-- | xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c | 48 |
1 files changed, 11 insertions, 37 deletions
diff --git a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c index 8162220f1..105e1caee 100644 --- a/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c +++ b/xc/programs/Xserver/hw/xfree86/drivers/tdfx/tdfx_driver.c @@ -1371,32 +1371,17 @@ static void TDFXLoadPalette16(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors, short visualClass) { TDFXPtr pTDFX; - vgaHWPtr hwp; - int i, j, index, max; - unsigned char r, g, b, tmpr, tmpg, tmpb; + int i, index, v; TDFXTRACE("TDFXLoadPalette16 start\n"); pTDFX = TDFXPTR(pScrn); - hwp = VGAHWPTR(pScrn); for (i=0; i<numColors; i++) { index=indices[i]; - r=colors[index/2].red; - g=colors[index].green; - b=colors[index/2].blue; - if (index<255) max=indices[i+1]<<2; - else max=256; - for (j=index<<2; j<max; j++) { - do { - hwp->writeDacWriteAddr(hwp, j); - hwp->writeDacData(hwp, r); - hwp->writeDacData(hwp, g); - hwp->writeDacData(hwp, b); - hwp->writeDacReadAddr(hwp, j); - tmpr=hwp->readDacData(hwp); - tmpg=hwp->readDacData(hwp); - tmpb=hwp->readDacData(hwp); - } while (tmpr!=r || tmpg!=g || tmpb!=b); - } + v=(colors[index/2].red<<16)|(colors[index].green<<8)|colors[index/2].blue; + pTDFX->writeLong(pTDFX, DACADDR, index); + do { + pTDFX->writeLong(pTDFX, DACDATA, v); + } while (pTDFX->readLong(pTDFX, DACDATA)!=v); } } @@ -1404,28 +1389,17 @@ static void TDFXLoadPalette24(ScrnInfoPtr pScrn, int numColors, int *indices, LOCO *colors, short visualClass) { TDFXPtr pTDFX; - vgaHWPtr hwp; - int i, index; - unsigned char r, g, b, tmpr, tmpg, tmpb; + int i, index, v; TDFXTRACE("TDFXLoadPalette24 start\n"); pTDFX = TDFXPTR(pScrn); - hwp = VGAHWPTR(pScrn); for (i=0; i<numColors; i++) { index=indices[i]; - r=colors[index].red; - b=colors[index].blue; - g=colors[index].green; + v=(colors[index].red<<16)|(colors[index].green<<8)|colors[index].blue; + pTDFX->writeLong(pTDFX, DACADDR, index); do { - hwp->writeDacWriteAddr(hwp, index); - hwp->writeDacData(hwp, r); - hwp->writeDacData(hwp, g); - hwp->writeDacData(hwp, b); - hwp->writeDacReadAddr(hwp, index); - tmpr=hwp->readDacData(hwp); - tmpg=hwp->readDacData(hwp); - tmpb=hwp->readDacData(hwp); - } while (tmpr!=r || tmpg!=g || tmpb!=b); + pTDFX->writeLong(pTDFX, DACDATA, v); + } while (pTDFX->readLong(pTDFX, DACDATA)!=v); } } |