From d8072750f830173e3c9eefae8364d12190b20c26 Mon Sep 17 00:00:00 2001 From: Egbert Eich Date: Wed, 3 Mar 2004 12:12:19 +0000 Subject: Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004 --- man/mga.man | 2 +- src/binding.h | 2 +- src/mga.h | 31 +++++++++------- src/mga_arc.c | 5 +-- src/mga_common.h | 2 +- src/mga_dac3026.c | 8 +++-- src/mga_dacG.c | 29 +++++++++++---- src/mga_dga.c | 2 +- src/mga_dh.c | 2 +- src/mga_dri.c | 2 +- src/mga_dri.h | 2 +- src/mga_dripriv.h | 2 +- src/mga_driver.c | 101 ++++++++++++++++++++++++----------------------------- src/mga_esc.c | 2 +- src/mga_g450pll.c | 2 +- src/mga_halmod.c | 2 +- src/mga_hwcurs.c | 2 +- src/mga_macros.h | 2 +- src/mga_map.h | 2 +- src/mga_merge.c | 2 +- src/mga_reg.h | 2 +- src/mga_sarea.h | 2 +- src/mga_shadow.c | 2 +- src/mga_storm.c | 6 ++-- src/mga_video.c | 17 +++++++-- src/mgareg_flags.h | 2 +- util/README | 2 +- util/stormdwg.c | 2 +- 28 files changed, 134 insertions(+), 105 deletions(-) diff --git a/man/mga.man b/man/mga.man index 0a1209d..28b9eed 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__ diff --git a/src/binding.h b/src/binding.h index f44de3e..7fe7f68 100644 --- a/src/binding.h +++ b/src/binding.h @@ -13,7 +13,7 @@ @end ***************************************************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/HALlib/binding.h,v 1.5 2000/12/06 20:39:52 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/HALlib/binding.h,v 1.3 2000/10/24 22:45:08 dawes Exp $ */ #ifndef _BINDING #define _BINDING diff --git a/src/mga.h b/src/mga.h index 9a7a934..38bea3d 100644 --- a/src/mga.h +++ b/src/mga.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h,v 1.87 2003/10/08 15:48:41 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h,v 1.87tsi Exp $ */ /* * MGA Millennium (MGA2064W) functions * @@ -99,18 +99,23 @@ typedef enum { #define OUTREG16(addr, val) MMIO_OUT16(pMga->IOBase, addr, val) #define OUTREG(addr, val) MMIO_OUT32(pMga->IOBase, addr, val) #else /* !EXTRADEBUG */ -CARD8 dbg_inreg8(ScrnInfoPtr,int,int); -CARD16 dbg_inreg16(ScrnInfoPtr,int,int); -CARD32 dbg_inreg32(ScrnInfoPtr,int,int); -void dbg_outreg8(ScrnInfoPtr,int,int); -void dbg_outreg16(ScrnInfoPtr,int,int); -void dbg_outreg32(ScrnInfoPtr,int,int); -#define INREG8(addr) dbg_inreg8(pScrn,addr,1) -#define INREG16(addr) dbg_inreg16(pScrn,addr,1) -#define INREG(addr) dbg_inreg32(pScrn,addr,1) -#define OUTREG8(addr,val) dbg_outreg8(pScrn,addr,val) -#define OUTREG16(addr,val) dbg_outreg16(pScrn,addr,val) -#define OUTREG(addr,val) dbg_outreg32(pScrn,addr,val) +CARD8 MGAdbg_inreg8(ScrnInfoPtr, int, int, char*); +CARD16 MGAdbg_inreg16(ScrnInfoPtr, int, int, char*); +CARD32 MGAdbg_inreg32(ScrnInfoPtr, int, int, char*); +void MGAdbg_outreg8(ScrnInfoPtr, int, int, char*); +void MGAdbg_outreg16(ScrnInfoPtr, int,int, char*); +void MGAdbg_outreg32(ScrnInfoPtr, int,int, char*); +#ifndef __GNUC__ +# define MGA_STRINGIZE(x) #x +# define MGA_STRINGIFY(x) MGA_STRINGIZE(x) +# define __FUNCTION__ MGA_STRINGIFY(__FILE__) ", line " MGA_STRINGIFY(__LINE__) +#endif +#define INREG8(addr) MGAdbg_inreg8(pScrn, addr, 1, __FUNCTION__) +#define INREG16(addr) MGAdbg_inreg16(pScrn, addr, 1, __FUNCTION__) +#define INREG(addr) MGAdbg_inreg32(pScrn, addr, 1, __FUNCTION__) +#define OUTREG8(addr,val) MGAdbg_outreg8(pScrn, addr, val, __FUNCTION__) +#define OUTREG16(addr,val) MGAdbg_outreg16(pScrn, addr, val, __FUNCTION__) +#define OUTREG(addr,val) MGAdbg_outreg32(pScrn, addr, val, __FUNCTION__) #endif /* EXTRADEBUG */ /* diff --git a/src/mga_arc.c b/src/mga_arc.c index 5c9a9cb..d282967 100644 --- a/src/mga_arc.c +++ b/src/mga_arc.c @@ -23,7 +23,7 @@ used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. ********************************************************/ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_arc.c,v 1.12 2003/07/16 03:08:37 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_arc.c,v 1.12tsi Exp $ */ #include "X.h" @@ -70,7 +70,8 @@ MGAZeroArc( ){ int yoffset, dyoffset, x, y, a, b, d, mask, k1, k3, dx, dy, tmp; XAAInfoRecPtr infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - MGAPtr pMga = MGAPTR(infoRec->pScrn); + ScrnInfoPtr pScrn = infoRec->pScrn; + MGAPtr pMga = MGAPTR(pScrn); miZeroArcRec info; Bool do360; DDXPointRec org, orgo; 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 * - * $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_dac3026.c b/src/mga_dac3026.c index d97e870..7cbec19 100644 --- a/src/mga_dac3026.c +++ b/src/mga_dac3026.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dac3026.c,v 1.58 2003/11/03 05:11:17 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dac3026.c,v 1.58tsi Exp $ */ /* * Copyright 1994 by Robin Cutshaw * @@ -984,7 +984,8 @@ MGA3026_ddc1Read(ScrnInfoPtr pScrn) static void MGA3026_I2CGetBits(I2CBusPtr b, int *clock, int *data) { - MGAPtr pMga = MGAPTR(xf86Screens[b->scrnIndex]); + ScrnInfoPtr pScrn = xf86Screens[b->scrnIndex]; + MGAPtr pMga = MGAPTR(pScrn); unsigned char val; /* Get the result. */ @@ -1005,7 +1006,8 @@ MGA3026_I2CGetBits(I2CBusPtr b, int *clock, int *data) static void MGA3026_I2CPutBits(I2CBusPtr b, int clock, int data) { - MGAPtr pMga = MGAPTR(xf86Screens[b->scrnIndex]); + ScrnInfoPtr pScrn = xf86Screens[b->scrnIndex]; + MGAPtr pMga = MGAPTR(pScrn); unsigned char val,drv; /* Write the values */ diff --git a/src/mga_dacG.c b/src/mga_dacG.c index 842e75e..0a3a7e2 100644 --- a/src/mga_dacG.c +++ b/src/mga_dacG.c @@ -2,7 +2,7 @@ * MGA-1064, MGA-G100, MGA-G200, MGA-G400, MGA-G550 RAMDAC driver */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dacG.c,v 1.54 2003/11/03 05:11:17 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dacG.c,v 1.54tsi Exp $ */ /* * This is a first cut at a non-accelerated version to work with the @@ -548,6 +548,14 @@ MGAGInit(ScrnInfoPtr pScrn, DisplayModePtr mode) MGACRTC2GetPitch(pScrn, &ModeInfo); MGACRTC2GetDisplayStart(pScrn, &ModeInfo,0,0,0); } + +#if X_BYTE_ORDER == X_BIG_ENDIAN + /* Disable byte-swapping for big-endian architectures - the XFree + driver seems to like a little-endian framebuffer -ReneR */ + /* pReg->Option |= 0x80000000; */ + pReg->Option &= ~0x80000000; +#endif + return(TRUE); } @@ -670,6 +678,14 @@ MGAGRestore(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, MGARegPtr mgaReg, } if(!pMga->SecondCrtc) { + /* Do not set the memory config for primary cards as it + should be correct already. Only on little endian architectures + since we need to modify the byteswap bit. -ReneR */ +#if X_BYTE_ORDER == X_BIG_ENDIAN + optionMask = OPTION1_MASK; +#else + optionMask = (pMga->Primary) ? OPTION1_MASK_PRIMARY : OPTION1_MASK; +#endif MGA_NOT_HAL( /* @@ -695,10 +711,6 @@ MGA_NOT_HAL( outMGAdac(i, mgaReg->DacRegs[i]); } - /* Do not set the memory config for primary cards as it - should be correct already */ - optionMask = (pMga->Primary) ? OPTION1_MASK_PRIMARY : OPTION1_MASK; - if (!MGAISGx50(pMga)) { /* restore pci_option register */ pciSetBitsLong(pMga->PciTag, PCI_OPTION_REG, optionMask, @@ -939,6 +951,7 @@ MGAGSetCursorPosition(ScrnInfoPtr pScrn, int x, int y) MGAPtr pMga = MGAPTR(pScrn); x += 64; y += 64; + #ifdef USEMGAHAL MGA_HAL( x += pMga->HALGranularityOffX; @@ -1033,7 +1046,8 @@ MGAG_ddc1Read(ScrnInfoPtr pScrn) static void MGAG_I2CGetBits(I2CBusPtr b, int *clock, int *data) { - MGAPtr pMga = MGAPTR(xf86Screens[b->scrnIndex]); + ScrnInfoPtr pScrn = xf86Screens[b->scrnIndex]; + MGAPtr pMga = MGAPTR(pScrn); unsigned char val; /* Get the result. */ @@ -1054,7 +1068,8 @@ MGAG_I2CGetBits(I2CBusPtr b, int *clock, int *data) static void MGAG_I2CPutBits(I2CBusPtr b, int clock, int data) { - MGAPtr pMga = MGAPTR(xf86Screens[b->scrnIndex]); + ScrnInfoPtr pScrn = xf86Screens[b->scrnIndex]; + MGAPtr pMga = MGAPTR(pScrn); unsigned char drv, val; val = (clock ? DDC_SCL_MASK : 0) | (data ? DDC_SDA_MASK : 0); diff --git a/src/mga_dga.c b/src/mga_dga.c index 3148fec..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.17 2003/10/08 15:48:41 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" diff --git a/src/mga_dh.c b/src/mga_dh.c index e283795..db4f4f2 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.5 2003/11/03 05:11:17 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dh.c,v 1.4tsi Exp $ */ /********************************************************************* * G450: This is for Dual Head. * Matrox Graphics diff --git a/src/mga_dri.c b/src/mga_dri.c index e08a2a4..755c0db 100644 --- a/src/mga_dri.c +++ b/src/mga_dri.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c,v 1.32 2003/11/06 18:38:04 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.c,v 1.31tsi Exp $ */ /* * Copyright 2000 VA Linux Systems Inc., Fremont, California. diff --git a/src/mga_dri.h b/src/mga_dri.h index b9ed1c2..fdd1272 100644 --- a/src/mga_dri.h +++ b/src/mga_dri.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.h,v 1.8 2002/11/29 11:06:42 eich Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dri.h,v 1.6 2001/04/10 16:08:01 dawes Exp $ */ /* * Copyright 2000 VA Linux Systems Inc., Fremont, California. 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_driver.c b/src/mga_driver.c index c5871f6..7e45fc4 100644 --- a/src/mga_driver.c +++ b/src/mga_driver.c @@ -45,7 +45,7 @@ * Added digital screen option for first head */ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c,v 1.244 2003/11/03 05:11:17 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_driver.c,v 1.244tsi Exp $ */ /* * This is a first cut at a non-accelerated version to work with the @@ -134,7 +134,7 @@ static void MGASave(ScrnInfoPtr pScrn); static void MGARestore(ScrnInfoPtr pScrn); static Bool MGAModeInit(ScrnInfoPtr pScrn, DisplayModePtr mode); static void MGABlockHandler(int, pointer, pointer, pointer); -static void MGAG100BlackMagic(MGAPtr pMga); +static void MGAG100BlackMagic(ScrnInfoPtr pScrn); static int MGAEntityIndex = -1; @@ -926,7 +926,7 @@ MGACountRam(ScrnInfoPtr pScrn) return 16384; } } - ProbeSize = 16384; + ProbeSize = 8192; break; case PCI_CHIP_MGAG100: case PCI_CHIP_MGAG100_PCI: @@ -954,11 +954,14 @@ MGACountRam(ScrnInfoPtr pScrn) tmp = INREG8(MGAREG_CRTCEXT_DATA); OUTREG8(MGAREG_CRTCEXT_DATA, tmp | 0x80); - /* write, read and compare method */ + /* write, read and compare method + split into two loops to make it more reliable on RS/6k -ReneR */ for(i = ProbeSize; i > 2048; i -= 2048) { base[(i * 1024) - 1] = 0xAA; - OUTREG8(MGAREG_CRTC_INDEX, 0); /* flush the cache */ - usleep(1); /* twart write combination */ + } + OUTREG8(MGAREG_CRTC_INDEX, 0); /* flush the cache */ + usleep(4); /* twart write combination */ + for(i = ProbeSize; i > 2048; i -= 2048) { if(base[(i * 1024) - 1] == 0xAA) { SizeFound = i; break; @@ -1262,12 +1265,7 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) pMga->Access.AccessDisable = VgaIODisable; pMga->Access.AccessEnable = VgaIOEnable; pMga->Access.arg = pMga; - /* please check if this is correct. I've impiled that the VGA fb - is handled locally and not visible outside. If the VGA fb is - handeled by the same function the third argument has to be set, - too.*/ - xf86SetAccessFuncs(pMga->pEnt, &pMga->Access, &pMga->Access, - &pMga->Access, NULL); + xf86SetAccessFuncs(pMga->pEnt, &pMga->Access, &pMga->Access); #endif /* Set pScrn->monitor */ @@ -1764,7 +1762,9 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) } pMga->IOAddress = pMga->device->IOBase; from = X_CONFIG; - } else { + } else +#endif + { /* details: mgabase1 sdk pp 4-11 */ int i = ((pMga->Chipset == PCI_CHIP_MGA1064 && pMga->ChipRev < 3) || pMga->Chipset == PCI_CHIP_MGA2064) ? 0 : 1; @@ -1778,9 +1778,6 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) return FALSE; } } -#else - pMga->IOAddress = pMga->PciInfo->memBase[0]; -#endif xf86DrvMsg(pScrn->scrnIndex, from, "MMIO registers at 0x%lX\n", (unsigned long)pMga->IOAddress); @@ -2506,7 +2503,6 @@ MGAMapMem(ScrnInfoPtr pScrn) pMga->FbStart = pMga->FbBase + pMga->YDstOrg * (pScrn->bitsPerPixel / 8); - /* Map the ILOAD transfer window if there is one. We only make DWORD access on DWORD boundaries to this window */ if (pMga->ILOADAddress) { @@ -3074,7 +3070,7 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) if ((pMga->Chipset == PCI_CHIP_MGAG100) || (pMga->Chipset == PCI_CHIP_MGAG100_PCI)) - MGAG100BlackMagic(pMga); + MGAG100BlackMagic(pScrn); if (pMga->DualHeadEnabled) { DevUnion *pPriv; @@ -4059,96 +4055,88 @@ MGABlockHandler ( (*pMga->RenderCallback)(pScrn); } -#if defined (DEBUG) +#if defined (EXTRADEBUG) /* * some functions to track input/output in the server */ CARD8 -dbg_inreg8(ScrnInfoPtr pScrn,int addr,int verbose) +MGAdbg_inreg8(ScrnInfoPtr pScrn,int addr,int verbose, char* func) { - MGAPtr pMga; CARD8 ret; - pMga = MGAPTR(pScrn); - ret = *(volatile CARD8 *)(pMga->IOBase + (addr)); + ret = MMIO_IN8(MGAPTR(pScrn)->IOBase,addr); if(verbose) xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "inreg8 : 0x%8x = 0x%x\n",addr,ret); + "inreg8 : %s: 0x%8x = 0x%x\n",func, addr,ret); return ret; } CARD16 -dbg_inreg16(ScrnInfoPtr pScrn,int addr,int verbose) +MGAdbg_inreg16(ScrnInfoPtr pScrn,int addr,int verbose, char* func) { - MGAPtr pMga; CARD16 ret; - pMga = MGAPTR(pScrn); - ret = *(volatile CARD16 *)(pMga->IOBase + (addr)); + ret = MMIO_IN16(MGAPTR(pScrn)->IOBase,addr); if(verbose) xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "inreg16: 0x%8x = 0x%x\n",addr,ret); + "inreg16: %s: 0x%8x = 0x%x\n",func, addr,ret); return ret; } CARD32 -dbg_inreg32(ScrnInfoPtr pScrn,int addr,int verbose) +MGAdbg_inreg32(ScrnInfoPtr pScrn,int addr,int verbose, char* func) { - MGAPtr pMga; CARD32 ret; - pMga = MGAPTR(pScrn); - ret = *(volatile CARD32 *)(pMga->IOBase + (addr)); + ret = MMIO_IN32(MGAPTR(pScrn)->IOBase,addr); if(verbose) xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "inreg32: 0x%8x = 0x%x\n",addr,ret); + "inreg32: %s: 0x%8x = 0x%x\n",func, addr,ret); return ret; } void -dbg_outreg8(ScrnInfoPtr pScrn,int addr,int val) +MGAdbg_outreg8(ScrnInfoPtr pScrn,int addr,int val, char* func) { - MGAPtr pMga; CARD8 ret; - pMga = MGAPTR(pScrn); #if 0 if( addr = MGAREG_CRTCEXT_DATA ) return; #endif if( addr != 0x3c00 ) { - ret = dbg_inreg8(pScrn,addr,0); + ret = MGAdbg_inreg8(pScrn,addr,0,func); xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "outreg8 : 0x%8x = 0x%x was 0x%x\n",addr,val,ret); + "outreg8 : %s: 0x%8x = 0x%x was 0x%x\n", + func,addr,val,ret); } else { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "outreg8 : index 0x%x\n",val); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "outreg8 : %s: index 0x%x\n", + func,val); } - *(volatile CARD8 *)(pMga->IOBase + (addr)) = (val); + MMIO_OUT8(MGAPTR(pScrn)->IOBase,addr,val); } void -dbg_outreg16(ScrnInfoPtr pScrn,int addr,int val) +MGAdbg_outreg16(ScrnInfoPtr pScrn,int addr,int val, char* func) { - MGAPtr pMga; CARD16 ret; #if 0 if (addr == MGAREG_CRTCEXT_INDEX) return; #endif - pMga = MGAPTR(pScrn); - ret = dbg_inreg16(pScrn,addr,0); + ret = MGAdbg_inreg16(pScrn,addr,0, func); xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "outreg16 : 0x%8x = 0x%x was 0x%x\n",addr,val,ret); - *(volatile CARD16 *)(pMga->IOBase + (addr)) = (val); + "outreg16: %s: 0x%8x = 0x%x was 0x%x\n", + func,addr,val,ret); + MMIO_OUT16(MGAPTR(pScrn)->IOBase,addr,val); } void -dbg_outreg32(ScrnInfoPtr pScrn,int addr,int val) +MGAdbg_outreg32(ScrnInfoPtr pScrn,int addr,int val, char* func) { - MGAPtr pMga; CARD32 ret; if (((addr & 0xff00) == 0x1c00) @@ -4162,20 +4150,23 @@ dbg_outreg32(ScrnInfoPtr pScrn,int addr,int val) && (addr != 0x1c98) && (addr != 0x1c9c) ) { - xf86DrvMsg(pScrn->scrnIndex, X_INFO, "refused address 0x%x\n",addr); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "%s: refused address 0x%x\n", + func,addr); return; } - pMga = MGAPTR(pScrn); - ret = dbg_inreg32(pScrn,addr,0); + ret = MGAdbg_inreg32(pScrn,addr,0, func); xf86DrvMsg(pScrn->scrnIndex, X_INFO, - "outreg32 : 0x%8x = 0x%x was 0x%x\n",addr,val,ret); - *(volatile CARD32 *)(pMga->IOBase + (addr)) = (val); + "outreg32: %s: 0x%8x = 0x%x was 0x%x\n", + func,addr,val,ret); + MMIO_OUT32(MGAPTR(pScrn)->IOBase,addr,val); } #endif /* DEBUG */ static void -MGAG100BlackMagic(MGAPtr pMga) +MGAG100BlackMagic(ScrnInfoPtr pScrn) { + MGAPtr pMga = MGAPTR(pScrn); + OUTREG(MGAREG_PLNWT, ~(CARD32)0x0); /* reset memory */ OUTREG(MGAREG_MACCESS, 1<<15); diff --git a/src/mga_esc.c b/src/mga_esc.c index c813f8c..2478184 100644 --- a/src/mga_esc.c +++ b/src/mga_esc.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_esc.c,v 1.3 2003/10/31 15:06:25 tsi Exp $ */ +/* $XFree86$ */ /**************************************************************************** * mga_esc.c * diff --git a/src/mga_g450pll.c b/src/mga_g450pll.c index 7abba9f..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.9 2003/11/03 05:11:18 tsi 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" diff --git a/src/mga_halmod.c b/src/mga_halmod.c index 4308f85..a5bb425 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 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 ab3d20e..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.5 2003/11/02 04:24:36 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" 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_sarea.h b/src/mga_sarea.h index 616dee5..cb1c3e9 100644 --- a/src/mga_sarea.h +++ b/src/mga_sarea.h @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_sarea.h,v 1.1 2001/03/21 17:11:47 dawes Exp $ */ +/* $XFree86$ */ /* * Copyright 2000 Gareth Hughes 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/mga_storm.c b/src/mga_storm.c index 1ddbed9..aa14f6f 100644 --- a/src/mga_storm.c +++ b/src/mga_storm.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c,v 1.99 2004/01/29 03:28:25 dawes Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_storm.c,v 1.99tsi Exp $ */ /* All drivers should typically include these */ @@ -2361,6 +2361,7 @@ MGAPolyPoint ( BoxPtr pbox; MGAPtr pMga; int xorg, yorg; + ScrnInfoPtr pScrn; if(!numRects) return; @@ -2370,7 +2371,8 @@ MGAPolyPoint ( } infoRec = GET_XAAINFORECPTR_FROM_GC(pGC); - pMga = MGAPTR(infoRec->pScrn); + pScrn = infoRec->pScrn; + pMga = MGAPTR(pScrn); xorg = pDraw->x; yorg = pDraw->y; diff --git a/src/mga_video.c b/src/mga_video.c index 62bb2ad..4b4afba 100644 --- a/src/mga_video.c +++ b/src/mga_video.c @@ -1,4 +1,4 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c,v 1.33 2003/11/10 18:22:23 tsi Exp $ */ +/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_video.c,v 1.33tsi Exp $ */ #include "xf86.h" #include "xf86_OSproc.h" @@ -460,6 +460,7 @@ MGACopyData( ){ w <<= 1; while(h--) { + /* XXX Maybe this one needs big-endian fixes, too? -ReneR */ memcpy(dst, src, w); src += srcPitch; dst += dstPitch; @@ -489,16 +490,27 @@ MGACopyMungedData( s1 = src1; s2 = src2; s3 = src3; i = w; while(i > 4) { +#if X_BYTE_ORDER == X_LITTLE_ENDIAN dst[0] = s1[0] | (s1[1] << 16) | (s3[0] << 8) | (s2[0] << 24); dst[1] = s1[2] | (s1[3] << 16) | (s3[1] << 8) | (s2[1] << 24); dst[2] = s1[4] | (s1[5] << 16) | (s3[2] << 8) | (s2[2] << 24); dst[3] = s1[6] | (s1[7] << 16) | (s3[3] << 8) | (s2[3] << 24); +#else + dst[0] = (s1[0] << 16) | s1[1] | (s3[0] << 24) | (s2[0] << 8); + dst[1] = (s1[2] << 16) | s1[3] | (s3[1] << 24) | (s2[1] << 8); + dst[2] = (s1[4] << 16) | s1[5] | (s3[2] << 24) | (s2[2] << 8); + dst[3] = (s1[6] << 16) | s1[7] | (s3[3] << 24) | (s2[3] << 8); +#endif dst += 4; s2 += 4; s3 += 4; s1 += 8; i -= 4; } while(i--) { +#if X_BYTE_ORDER == X_LITTLE_ENDIAN dst[0] = s1[0] | (s1[1] << 16) | (s3[0] << 8) | (s2[0] << 24); +#else + dst[0] = (s1[0] << 16) | s1[1] | (s3[0] << 24) | (s2[0] << 8); +#endif dst++; s2++; s3++; s1 += 2; } @@ -1008,7 +1020,8 @@ MGAStopSurface( OffscreenPrivPtr pPriv = (OffscreenPrivPtr)surface->devPrivate.ptr; if(pPriv->isOn) { - MGAPtr pMga = MGAPTR(surface->pScrn); + ScrnInfoPtr pScrn = surface->pScrn; + MGAPtr pMga = MGAPTR(pScrn); OUTREG(MGAREG_BESCTL, 0); pPriv->isOn = FALSE; } 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 /* #include */ -- cgit v1.2.3