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 | |
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')
-rw-r--r-- | src/mga_common.h | 2 | ||||
-rw-r--r-- | src/mga_dga.c | 28 | ||||
-rw-r--r-- | src/mga_dh.c | 16 | ||||
-rw-r--r-- | src/mga_dripriv.h | 2 | ||||
-rw-r--r-- | src/mga_esc.c | 37 | ||||
-rw-r--r-- | src/mga_g450pll.c | 11 | ||||
-rw-r--r-- | src/mga_halmod.c | 4 | ||||
-rw-r--r-- | src/mga_hwcurs.c | 2 | ||||
-rw-r--r-- | src/mga_macros.h | 2 | ||||
-rw-r--r-- | src/mga_map.h | 2 | ||||
-rw-r--r-- | src/mga_merge.c | 7 | ||||
-rw-r--r-- | src/mga_reg.h | 2 | ||||
-rw-r--r-- | src/mga_shadow.c | 2 | ||||
-rw-r--r-- | src/mgareg_flags.h | 2 |
14 files changed, 68 insertions, 51 deletions
diff --git a/src/mga_common.h b/src/mga_common.h index 90f6b37..6a3a83d 100644 --- a/src/mga_common.h +++ b/src/mga_common.h @@ -25,7 +25,7 @@ * Converted to common header format: * Jens Owen <jens@tungstengraphics.com> * - * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_common.h,v 1.2 2002/12/16 16:19:18 dawes Exp $ + * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_common.h,v 1.1 2002/10/30 12:52:19 alanh Exp $ * */ 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; diff --git a/src/mga_dh.c b/src/mga_dh.c index 79c8510..b1cd569 100644 --- a/src/mga_dh.c +++ b/src/mga_dh.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dh.c,v 1.4 2002/01/11 15:42:57 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dh.c,v 1.4tsi Exp $ */ /********************************************************************* * G450: This is for Dual Head. * Matrox Graphics @@ -151,13 +151,11 @@ void MGACRTC2Get(ScrnInfoPtr pScrn, xMODEINFO *pModeInfo) CARD32 ulHTotal; CARD32 ulHDispEnd; CARD32 ulHBlkStr; - CARD32 ulHBlkEnd; CARD32 ulHSyncStr; CARD32 ulHSyncEnd; CARD32 ulVTotal; CARD32 ulVDispEnd; CARD32 ulVBlkStr; - CARD32 ulVBlkEnd; CARD32 ulVSyncStr; CARD32 ulVSyncEnd; CARD32 ulOffset; @@ -181,7 +179,6 @@ void MGACRTC2Get(ScrnInfoPtr pScrn, xMODEINFO *pModeInfo) ulHDispEnd = tmpModeInfo.ulDispWidth; ulHBlkStr = ulHDispEnd; - ulHBlkEnd = ulHBlkStr + tmpModeInfo.ulHBPorch + tmpModeInfo.ulHFPorch + tmpModeInfo.ulHSync; ulHSyncStr = ulHBlkStr + tmpModeInfo.ulHFPorch; ulHSyncEnd = ulHSyncStr + tmpModeInfo.ulHSync; @@ -193,7 +190,6 @@ void MGACRTC2Get(ScrnInfoPtr pScrn, xMODEINFO *pModeInfo) ulVDispEnd = ulDispHeight; ulVBlkStr = ulVDispEnd; - ulVBlkEnd = ulVBlkStr + tmpModeInfo.ulVBPorch + tmpModeInfo.ulVFPorch + tmpModeInfo.ulVSync; ulVSyncStr = ulVBlkStr + tmpModeInfo.ulVFPorch; ulVSyncEnd = ulVSyncStr + tmpModeInfo.ulVSync; @@ -285,10 +281,11 @@ void MGACRTC2Set(ScrnInfoPtr pScrn, xMODEINFO *pModeInfo) void MGAEnableSecondOutPut(ScrnInfoPtr pScrn, xMODEINFO *pModeInfo) { CARD8 ucByte, ucXDispCtrl; - CARD32 ulC2CTL, ulStatusReg; + CARD32 ulC2CTL; MGAPtr pMga = MGAPTR(pScrn); MGARegPtr pReg; pReg = &pMga->ModeReg; + #ifdef DEBUG ErrorF("ENTER MGAEnableSecondOutPut\n"); #endif @@ -300,10 +297,9 @@ void MGAEnableSecondOutPut(ScrnInfoPtr pScrn, xMODEINFO *pModeInfo) /*--- Disable Pixel clock oscillations On Crtc1 */ OUTREG( MGAREG_C2CTL, ulC2CTL | C2CTL_PIXCLKDIS_MASK); /*--- Have to wait minimum time (2 acces will be ok) */ - ulStatusReg = INREG( MGAREG_Status); - ulStatusReg = INREG( MGAREG_Status); - - + (void) INREG( MGAREG_Status); + (void) INREG( MGAREG_Status); + ulC2CTL &= ~(C2CTL_PIXCLKSEL_MASK | C2CTL_PIXCLKSELH_MASK); ulC2CTL |= C2CTL_PIXCLKSEL_VIDEOPLL; diff --git a/src/mga_dripriv.h b/src/mga_dripriv.h index 3ddd133..ddd3aa7 100644 --- a/src/mga_dripriv.h +++ b/src/mga_dripriv.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dripriv.h,v 1.4 2001/04/10 16:08:01 dawes Exp $ */ +/* $XFree86$ */ /* * Copyright 2000 VA Linux Systems Inc., Fremont, California. diff --git a/src/mga_esc.c b/src/mga_esc.c index dc0b7b3..2478184 100644 --- a/src/mga_esc.c +++ b/src/mga_esc.c @@ -1,3 +1,4 @@ +/* $XFree86$ */ /**************************************************************************** * mga_esc.c * @@ -216,23 +217,23 @@ static void EscRead(ScrnInfoPtr pScrn, unsigned long *param, char *sResult, Dis break; case 1: ucIndex = INREG8(0x3c00); - OUTREG(0x3c00, (UCHAR)ulAddr); + OUTREG8(0x3c00, (UCHAR)ulAddr); ulData = (ULONG)INREG8(0x3c0a); - OUTREG(0x3c00, ucIndex); + OUTREG8(0x3c00, ucIndex); sprintf(sResult, "DAC[%02X] = 0x%02X", ulAddr, ulData); break; case 2: ucIndex = INREG8(0x1fd4); - OUTREG(0x1fd4, (UCHAR)ulAddr); + OUTREG8(0x1fd4, (UCHAR)ulAddr); ulData = (ULONG)INREG8(0x1fd5); - OUTREG(0x1fd4, ucIndex); + OUTREG8(0x1fd4, ucIndex); sprintf(sResult, "CRTC[%02X] = 0x%02X", ulAddr, ulData); break; case 3: ucIndex = INREG8(0x1fde); - OUTREG(0x1fde, (UCHAR)ulAddr); + OUTREG8(0x1fde, (UCHAR)ulAddr); ulData = (ULONG)INREG8(0x1fdf); - OUTREG(0x1fde, ucIndex); + OUTREG8(0x1fde, ucIndex); sprintf(sResult, "CRTCEXT[%02X] = 0x%02X", ulAddr, ulData); break; default: @@ -266,23 +267,23 @@ static void EscWrite(ScrnInfoPtr pScrn, unsigned long *param, char *sResult, Di break; case 1: ucIndex = INREG8(0x3c00); - OUTREG(0x3c00, (UCHAR)ulAddr); - OUTREG(0x3c0a, (UCHAR)ulData); - OUTREG(0x3c00, ucIndex); + OUTREG8(0x3c00, (UCHAR)ulAddr); + OUTREG8(0x3c0a, (UCHAR)ulData); + OUTREG8(0x3c00, ucIndex); strcpy(sResult, "OK"); break; case 2: ucIndex = INREG8(0x1fd4); - OUTREG(0x1fd4, (UCHAR)ulAddr); - OUTREG(0x1fd5, (UCHAR)ulData); - OUTREG(0x1fd4, ucIndex); + OUTREG8(0x1fd4, (UCHAR)ulAddr); + OUTREG8(0x1fd5, (UCHAR)ulData); + OUTREG8(0x1fd4, ucIndex); strcpy(sResult, "OK"); break; case 3: ucIndex = INREG8(0x1fde); - OUTREG(0x1fde, (UCHAR)ulAddr); - OUTREG(0x1fdf, (UCHAR)ulData); - OUTREG(0x1fde, ucIndex); + OUTREG8(0x1fde, (UCHAR)ulAddr); + OUTREG8(0x1fdf, (UCHAR)ulData); + OUTREG8(0x1fde, ucIndex); strcpy(sResult, "OK"); break; default: @@ -752,13 +753,13 @@ void MGAExecuteEscCmd(ScrnInfoPtr pScrn, char *cmdline , char *sResult, DisplayM if (pMga->SecondCrtc) { - ulScreen = 1; + ulScreen = 1; } else { ulScreen = 0; } - + if (FunctionTable[0].function && GetEscCommand(cmdline, &EscCmd) ) { @@ -773,7 +774,7 @@ void MGAExecuteEscCmd(ScrnInfoPtr pScrn, char *cmdline , char *sResult, DisplayM { EscCmd.parameters[0] &= 0xffff; EscCmd.parameters[0] |= ulScreen << 16; - + FunctionTable[i].funcptr(pScrn, EscCmd.parameters, sResult, pMode); } else diff --git a/src/mga_g450pll.c b/src/mga_g450pll.c index 6176549..526d859 100644 --- a/src/mga_g450pll.c +++ b/src/mga_g450pll.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_g450pll.c,v 1.8 2002/09/16 18:05:56 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_g450pll.c,v 1.8tsi Exp $ */ /* All drivers should typically include these */ #include "xf86.h" @@ -43,11 +43,10 @@ static CARD32 G450RemovePFactor(ScrnInfoPtr pScrn, CARD8 ucP, CARD32 *pulFIn) static CARD32 G450CalculVCO(ScrnInfoPtr pScrn, CARD32 ulMNP, CARD32 *pulF) { - CARD8 ucM, ucN, ucP; + CARD8 ucM, ucN; ucM = (CARD8)((ulMNP >> 16) & 0xff); ucN = (CARD8)((ulMNP >> 8) & 0xff); - ucP = (CARD8)(ulMNP & 0x03); *pulF = (27000 * (2 * (ucN + 2)) + ((ucM + 1) >> 1)) / (ucM + 1); @@ -193,9 +192,6 @@ static CARD32 G450FindFirstPLLParam(ScrnInfoPtr pScrn, CARD32 ulFout, static CARD32 G450WriteMNP(ScrnInfoPtr pScrn, CARD32 ulMNP) { MGAPtr pMga = MGAPTR(pScrn); - MGARegPtr pReg; - - pReg = &pMga->ModeReg; if (!pMga->SecondCrtc) { outMGAdac(MGA1064_PIX_PLLC_M, (CARD8)(ulMNP >> 16)); @@ -212,11 +208,8 @@ static CARD32 G450WriteMNP(ScrnInfoPtr pScrn, CARD32 ulMNP) static CARD32 G450ReadMNP(ScrnInfoPtr pScrn) { MGAPtr pMga = MGAPTR(pScrn); - MGARegPtr pReg; CARD32 ret = 0; - pReg = &pMga->ModeReg; - if (!pMga->SecondCrtc) { ret = (CARD8)inMGAdac(MGA1064_PIX_PLLC_M) << 16; ret |= (CARD8)inMGAdac(MGA1064_PIX_PLLC_N) << 8; diff --git a/src/mga_halmod.c b/src/mga_halmod.c index 4308f85..61ef298 100644 --- a/src/mga_halmod.c +++ b/src/mga_halmod.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_halmod.c,v 1.1 2000/12/06 15:35:21 eich Exp $ */ +/* $XFree86$ */ #include "xf86Module.h" #ifdef XFree86LOADER @@ -15,7 +15,7 @@ static XF86ModuleVersionInfo halVersRec = MODULEVENDORSTRING, MODINFOSTRING1, MODINFOSTRING2, - XF86_VERSION_CURRENT, + XORG_VERSION_CURRENT, HAL_MAJOR_VERSION, HAL_MINOR_VERSION, HAL_PATCHLEVEL, ABI_CLASS_VIDEODRV, /* This is a video driver */ ABI_VIDEODRV_VERSION, diff --git a/src/mga_hwcurs.c b/src/mga_hwcurs.c index 8b4e66b..50da1c5 100644 --- a/src/mga_hwcurs.c +++ b/src/mga_hwcurs.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_hwcurs.c,v 1.9 1999/03/14 03:22:00 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_hwcurs.c,v 1.8tsi Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" diff --git a/src/mga_macros.h b/src/mga_macros.h index d985081..9515879 100644 --- a/src/mga_macros.h +++ b/src/mga_macros.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_macros.h,v 1.22 2002/02/20 17:17:50 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_macros.h,v 1.21 2001/09/26 12:59:17 alanh Exp $ */ #ifndef _MGA_MACROS_H_ #define _MGA_MACROS_H_ diff --git a/src/mga_map.h b/src/mga_map.h index b41ca69..323e2a9 100644 --- a/src/mga_map.h +++ b/src/mga_map.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_map.h,v 1.2 2001/07/25 15:05:06 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_map.h,v 1.1 1997/03/06 23:16:01 hohndel Exp $ */ #if !defined(UNIXCPP) || defined(ANSICPP) #define CATNAME(prefix,subname) prefix##subname diff --git a/src/mga_merge.c b/src/mga_merge.c index 986b0cb..b06466c 100644 --- a/src/mga_merge.c +++ b/src/mga_merge.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_merge.c,v 1.3 2003/08/23 15:03:03 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_merge.c,v 1.4 2003/09/24 02:43:24 dawes Exp $ */ /* All drivers should typically include these */ #include "xf86.h" @@ -204,7 +204,7 @@ GenerateModeList(ScrnInfoPtr pScrn, char* str, xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "Mode: \"%s\" is not a supported mode for monitor 2\n",mode1->name); xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, - "Skipping clone mode \"%s\".\n"); + "Skipping clone mode \"%s\".\n", mode1->name); mode1 = NULL; } else { result = CopyModeNLink(pScrn,result,mode1,mode2,sr); @@ -428,7 +428,8 @@ MGAPreInitMergedFB(ScrnInfoPtr pScrn1, int flags) pMga->MinClock / 1000); /* Override on 2nd crtc */ - if (pMga->ChipRev >= 0x80) { /* G450 */ + if (pMga->ChipRev >= 0x80 || (pMga->Chipset == PCI_CHIP_MGAG550)) { + /* G450, G550 */ pMga->MaxClock = 234000; } else { pMga->MaxClock = 135000; diff --git a/src/mga_reg.h b/src/mga_reg.h index 0d6a20b..c5fe9c3 100644 --- a/src/mga_reg.h +++ b/src/mga_reg.h @@ -2,7 +2,7 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_reg.h,v 1.18 2001/09/26 12:59:18 alanh Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_reg.h,v 1.17 2001/04/25 14:23:00 dawes Exp $ */ diff --git a/src/mga_shadow.c b/src/mga_shadow.c index b1c228b..c3d8eea 100644 --- a/src/mga_shadow.c +++ b/src/mga_shadow.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_shadow.c,v 1.3 2000/02/08 13:13:18 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_shadow.c,v 1.1 1999/08/14 10:49:48 dawes Exp $ */ /* Copyright (c) 1999, The XFree86 Project Inc. diff --git a/src/mgareg_flags.h b/src/mgareg_flags.h index 69050fc..f45afbf 100644 --- a/src/mgareg_flags.h +++ b/src/mgareg_flags.h @@ -19,7 +19,7 @@ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mgareg_flags.h,v 1.2 2003/01/12 03:55:47 tsi Exp $ */ +/* $XFree86$ */ #ifndef _MGAREGS_H_ #define _MGAREGS_H_ |