diff options
author | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-25 19:28:37 +0000 |
---|---|---|
committer | Kaleb Keithley <kaleb@freedesktop.org> | 2003-11-25 19:28:37 +0000 |
commit | bf37df17ecf040836ad8924a9174787d0f57ed5a (patch) | |
tree | 20ba7f7206ed6a68553ac46bbf23ba289ac9fb64 /src/mga_dga.c | |
parent | d3b3c858814952bc7344a4154e981851fd9bb494 (diff) |
XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folksxf86-4_3_99_902xf86-4_3_99_901xf86-4_3_99_16xf86-012804-2330
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..3148fec 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.17 2003/10/08 15:48:41 eich 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; |