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 | |
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.
-rw-r--r-- | man/mga.man | 8 | ||||
-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 | ||||
-rw-r--r-- | util/README | 2 | ||||
-rw-r--r-- | util/stormdwg.c | 2 |
17 files changed, 74 insertions, 57 deletions
diff --git a/man/mga.man b/man/mga.man index 0a1209d..be09143 100644 --- a/man/mga.man +++ b/man/mga.man @@ -1,4 +1,4 @@ -.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga.man,v 1.8 2003/04/03 07:42:13 herrb Exp $ +.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga.man,v 1.7 2003/04/03 07:11:03 herrb Exp $ .\" shorthand for double quote that works everywhere. .ds q \N'34' .TH MGA __drivermansuffix__ __vendorversion__ @@ -14,7 +14,7 @@ mga \- Matrox video driver .fi .SH DESCRIPTION .B mga -is an XFree86 driver for Matrox video cards. The driver is fully +is an __xservername__ driver for Matrox video cards. The driver is fully accelerated, and provides support for the following framebuffer depths: 8, 15, 16, 24, and an 8+24 overlay mode. All visual types are supported for depth 8, and both TrueColor and DirectColor @@ -55,7 +55,7 @@ Millennium G200 and Mystique G200 .TP 12 .B G550 .SH CONFIGURATION DETAILS -Please refer to XF86Config(__filemansuffix__) for general configuration +Please refer to __xconfigfile__(__filemansuffix__) for general configuration details. This section only covers configuration details specific to this driver. .PP @@ -150,7 +150,7 @@ This option is only supported by the G200 and G400, and only in 16 and 32 bits per pixel. Default: off. .SH "SEE ALSO" -XFree86(1), XF86Config(__filemansuffix__), xf86config(1), Xserver(1), X(__miscmansuffix__) +__xservername__(__appmansuffix__), __xconfigfile__(__filemansuffix__), xorgconfig(__appmansuffix__), Xserver(__appmansuffix__), X(__miscmansuffix__) .SH AUTHORS Authors include: Radoslaw Kapitan, Mark Vojkovich, and also David Dawes, Guy Desbief, Dirk Hohndel, Doug Merritt, Andrew E. Mileski, Andrew van der Stock, 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_ diff --git a/util/README b/util/README index 9a87e53..e4863ff 100644 --- a/util/README +++ b/util/README @@ -22,4 +22,4 @@ ajv@greebo.net -$XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/util/README,v 1.2 1999/11/19 13:54:41 hohndel Exp $ +$XFree86: $ diff --git a/util/stormdwg.c b/util/stormdwg.c index e13916c..d3707bc 100644 --- a/util/stormdwg.c +++ b/util/stormdwg.c @@ -2,7 +2,7 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/util/stormdwg.c,v 1.1 1997/04/12 14:11:29 hohndel Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/dwg.c,v 1.1 1997/03/06 23:15:58 hohndel Exp $ */ #include <stdio.h> /* #include <stdlib.h> */ |