diff options
author | Kean Johnson <kean@armory.com> | 2005-06-10 06:54:05 +0000 |
---|---|---|
committer | Kean Johnson <kean@armory.com> | 2005-06-10 06:54:05 +0000 |
commit | f9acd6223632a1380dda70b6e2ed7bb6418f802e (patch) | |
tree | 5098f861f39e10e40ce25f9d4cad2c5bc10b0a21 /src/mga_dga.c | |
parent | 1b6392ffb792212016e710aaf27ffe36e5703d36 (diff) |
SCO port update for SCO OpenServer 5 and UnixWare 7. A few general cleanupssco_port_update
and bugs not specifically related to the port fixed along the way.
Diffstat (limited to 'src/mga_dga.c')
-rw-r--r-- | src/mga_dga.c | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/src/mga_dga.c b/src/mga_dga.c index d6735b1..774aafd 100644 --- a/src/mga_dga.c +++ b/src/mga_dga.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dga.c,v 1.16 2002/09/16 18:05:55 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dga.c,v 1.14 1999/11/02 23:12:00 mvojkovi Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -264,6 +264,30 @@ BitsSet(unsigned long data) return set; } +/* + * This is not strictly required - but it will load a 'sane' + * palette when starting DGA. + */ +static void +mgaDGASetPalette(ScrnInfoPtr pScrn) +{ + MGAPtr pMga = MGAPTR(pScrn); + MGARamdacPtr MGAdac = &pMga->Dac; + unsigned char DAC[256*3]; + int i; + + if (!MGAdac->RestorePalette) + return; + + for (i = 0; i < 256; i++) { + DAC[i*3] = i; + DAC[i*3 + 1] = i; + DAC[i*3 + 2] = i; + } + MGAdac->RestorePalette(pScrn, DAC); +} + + static Bool MGA_SetMode( ScrnInfoPtr pScrn, @@ -299,6 +323,8 @@ MGA_SetMode( /* MGAModeInit() will set the mode field */ pScrn->SwitchMode(index, pMode->mode, 0); + /* not strictly required but nice */ + mgaDGASetPalette(pScrn); } return TRUE; |