diff options
author | Ian Romanick <idr@us.ibm.com> | 2006-12-11 15:06:03 -0800 |
---|---|---|
committer | Ian Romanick <idr@us.ibm.com> | 2006-12-11 15:06:03 -0800 |
commit | d0e03622811fd94c830c0b5233ff505392c0d331 (patch) | |
tree | d52e44dc616a677e9f2901d36f99e0ed579cf87e | |
parent | 8fee907cac7e5924630e3648bfb72ad9bd021ea8 (diff) | |
parent | 1dd6e6995d7a37338dce6ee5b1aa4ee9dd848e1d (diff) |
Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/driver/xf86-video-mga into pci-rework
Conflicts:
src/mga_macros.h
-rw-r--r-- | configure.ac | 4 | ||||
-rw-r--r-- | src/mga.h | 6 | ||||
-rw-r--r-- | src/mga_dacG.c | 17 | ||||
-rw-r--r-- | src/mga_driver.c | 16 | ||||
-rw-r--r-- | src/mga_macros.h | 3 |
5 files changed, 24 insertions, 22 deletions
diff --git a/configure.ac b/configure.ac index 8cddbac..702d9ce 100644 --- a/configure.ac +++ b/configure.ac @@ -21,8 +21,10 @@ # Process this file with autoconf to produce a configure script AC_PREREQ(2.57) + +# When the version number is modified here, also modify it in src/mga.h. AC_INIT([xf86-video-mga], - 1.4.2, + 1.4.4, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xf86-video-mga) @@ -157,7 +157,7 @@ void MGAdbg_outreg32(ScrnInfoPtr, int,int, char*); #define MGA_DRIVER_NAME "mga" #define MGA_MAJOR_VERSION 1 #define MGA_MINOR_VERSION 4 -#define MGA_PATCHLEVEL 1 +#define MGA_PATCHLEVEL 4 typedef struct { unsigned char ExtVga[6]; @@ -417,6 +417,10 @@ typedef struct { xf86AccessRec Access; int Chipset; int ChipRev; + + int is_Gx50:1; + int is_G200SE:1; + Bool Primary; Bool Interleave; int HwBpp; diff --git a/src/mga_dacG.c b/src/mga_dacG.c index 0111a85..c67490a 100644 --- a/src/mga_dacG.c +++ b/src/mga_dacG.c @@ -236,8 +236,7 @@ MGAGSetPCLK( ScrnInfoPtr pScrn, long f_out ) return; } - if ((pMga->Chipset == PCI_CHIP_MGAG200_SE_A_PCI) || - (pMga->Chipset == PCI_CHIP_MGAG200_SE_B_PCI)) { + if (pMga->is_G200SE) { MGAG200SEComputePLLParam(pScrn, f_out, &m, &n, &p); pReg->DacRegs[ MGA1064_PIX_PLLC_M ] = m; @@ -755,9 +754,8 @@ MGA_NOT_HAL( ((i == 0x2c) || (i == 0x2d) || (i == 0x2e) || (i == 0x4c) || (i == 0x4d) || (i == 0x4e)))) continue; - if (((pMga->Chipset == PCI_CHIP_MGAG200_SE_A_PCI) || - (pMga->Chipset == PCI_CHIP_MGAG200_SE_B_PCI)) && - (i == 0x2C) || (i == 0x2D) || (i == 0x2E)) + if (pMga->is_G200SE + && ((i == 0x2C) || (i == 0x2D) || (i == 0x2E))) continue; outMGAdac(i, mgaReg->DacRegs[i]); } @@ -800,8 +798,7 @@ MGA_NOT_HAL( OUTREG16(0x1FDE, (mgaReg->ExtVga[i] << 8) | i); /* This handles restoring the generic VGA registers. */ - if ((pMga->Chipset == PCI_CHIP_MGAG200_SE_A_PCI) || - (pMga->Chipset == PCI_CHIP_MGAG200_SE_B_PCI)) { + if (pMga->is_G200SE) { vgaHWRestore(pScrn, vgaReg, VGA_SR_MODE); if (restoreFonts) MGAG200SERestoreFonts(pScrn, vgaReg); @@ -901,8 +898,7 @@ MGAGSave(ScrnInfoPtr pScrn, vgaRegPtr vgaReg, MGARegPtr mgaReg, * This function will handle creating the data structure and filling * in the generic VGA portion. */ - if ((pMga->Chipset == PCI_CHIP_MGAG200_SE_A_PCI) || - (pMga->Chipset == PCI_CHIP_MGAG200_SE_B_PCI)) { + if (pMga->is_G200SE) { vgaHWSave(pScrn, vgaReg, VGA_SR_MODE); if (saveFonts) MGAG200SESaveFonts(pScrn, vgaReg); @@ -1117,8 +1113,7 @@ MGAG_ddc1Read(ScrnInfoPtr pScrn) outMGAdacmsk(MGA1064_GEN_IO_CTL, ~(DDC_P1_SCL_MASK | DDC_P1_SDA_MASK), 0); /* wait for Vsync */ - if ((pMga->Chipset == PCI_CHIP_MGAG200_SE_A_PCI) || - (pMga->Chipset == PCI_CHIP_MGAG200_SE_B_PCI)) { + if (pMga->is_G200SE) { usleep(4); } else { while( INREG( MGAREG_Status ) & 0x08 ); diff --git a/src/mga_driver.c b/src/mga_driver.c index fbaab0c..8fa36ff 100644 --- a/src/mga_driver.c +++ b/src/mga_driver.c @@ -829,9 +829,7 @@ MGACountRam(ScrnInfoPtr pScrn) OUTREG8(MGAREG_CRTCEXT_DATA, tmp | 0x80); /* apparently the G200SE doesn't have a BIOS to read */ - if ((pMga->Chipset == PCI_CHIP_MGAG200_SE_A_PCI) || - (pMga->Chipset == PCI_CHIP_MGAG200_SE_B_PCI)) { - + if (pMga->is_G200SE) { CARD32 MemoryAt0, MemoryAt1, Offset; CARD32 FirstMemoryVal1, FirstMemoryVal2; CARD32 SecondMemoryVal1, SecondMemoryVal2; @@ -1282,6 +1280,12 @@ MGAPreInit(ScrnInfoPtr pScrn, int flags) } else { xf86ErrorF("\n"); } + + pMga->is_Gx50 = ((pMga->Chipset == PCI_CHIP_MGAG400) && (pMga->ChipRev >= 0x80)) + || (pMga->Chipset == PCI_CHIP_MGAG550); + pMga->is_G200SE = (pMga->Chipset == PCI_CHIP_MGAG200_SE_A_PCI) + || (pMga->Chipset == PCI_CHIP_MGAG200_SE_B_PCI); + #ifdef USEMGAHAL if (pMga->chip_attribs->HAL_chipset) { Bool loadHal = TRUE; @@ -2968,8 +2972,7 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) pMga = MGAPTR(pScrn); MGAdac = &pMga->Dac; - if ((pMga->Chipset == PCI_CHIP_MGAG200_SE_A_PCI) || - (pMga->Chipset == PCI_CHIP_MGAG200_SE_B_PCI)) { + if (pMga->is_G200SE) { VRTemp = pScrn->videoRam; FBTemp = pMga->FbMapSize; pScrn->videoRam = 4096; @@ -3053,8 +3056,7 @@ MGAScreenInit(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) ); /* MGA_HAL */ #endif } - if ((pMga->Chipset == PCI_CHIP_MGAG200_SE_A_PCI) || - (pMga->Chipset == PCI_CHIP_MGAG200_SE_B_PCI)) { + if (pMga->is_G200SE) { pScrn->videoRam = VRTemp; pMga->FbMapSize = FBTemp; } diff --git a/src/mga_macros.h b/src/mga_macros.h index b5554b4..1b913a8 100644 --- a/src/mga_macros.h +++ b/src/mga_macros.h @@ -75,8 +75,7 @@ while(INREG(MGAREG_DWGSYNC) != MGA_SYNC_XTAG) ; \ #define MGA_NOT_HAL(x) { x; } #endif -#define MGAISGx50(x) ( (((x)->Chipset == PCI_CHIP_MGAG400) && ((x)->ChipRev >= 0x80)) || \ - ((x)->Chipset == PCI_CHIP_MGAG550) ) +#define MGAISGx50(x) ((x)->is_Gx50) #define MGA_DH_NEEDS_HAL(x) (((x)->Chipset == PCI_CHIP_MGAG400) && \ ((x)->ChipRev < 0x80)) |