--- xserver-xorg-video-mga-1.4.13.dfsg.orig/autogen.sh +++ xserver-xorg-video-mga-1.4.13.dfsg/autogen.sh @@ -0,0 +1,12 @@ +#! /bin/sh + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + +ORIGDIR=`pwd` +cd $srcdir + +autoreconf -v --install || exit 1 +cd $ORIGDIR || exit $? + +$srcdir/configure --enable-maintainer-mode "$@" --- xserver-xorg-video-mga-1.4.13.dfsg.orig/ChangeLog +++ xserver-xorg-video-mga-1.4.13.dfsg/ChangeLog @@ -1,3 +1,76 @@ +commit 01ca2186ea028b2549de509b51726aa08519fce0 +Author: Christian Toutant +Date: Tue Sep 20 13:07:16 2011 -0400 + + Reset tagfifo for renesas. + + For renesas, we need to reset tagfifo after a mode switch. + + Signed-off-by: Christian Toutant + +commit c083bf0a66bef9a4345847f39be5fb895c211f79 +Author: Christian Toutant +Date: Wed Aug 3 09:45:13 2011 -0400 + + Added support for G200SE Pilot3 + + Optimize use of bandwidth and increase maximum resolution to 1920x1200 + + Signed-off-by: Christian Toutant + +commit 43280e6521815582f219d42821d896093c9c0d5f +Author: Adam Jackson +Date: Wed Jun 22 17:02:29 2011 -0400 + + Don't include xf86Priv.h + + Signed-off-by: Adam Jackson + +commit 5f1b04e86e79938c8158055a777280a649f95510 +Author: Yannick Heneault +Date: Fri Dec 17 09:00:46 2010 -0500 + + added support for G200ER. + +commit f7a2ef60e18e2cc464f69c1cad4681096c645651 +Author: Alan Coopersmith +Date: Sat Oct 30 09:38:31 2010 -0700 + + Sun's copyrights now belong to Oracle + + Signed-off-by: Alan Coopersmith + +commit 636c3c88e7e9cb30010fe1731cd7356849f3f172 +Author: Adam Jackson +Date: Thu Oct 14 14:36:06 2010 -0400 + + Don't allow the config file to override BIOS location + + Signed-off-by: Adam Jackson + +commit 0bd44fad450843b7f1c35c70ab356a2b250d107d +Author: Jesse Adkins +Date: Tue Sep 28 13:29:51 2010 -0700 + + Purge cvs tags. + + Signed-off-by: Jesse Adkins + Signed-off-by: Alan Coopersmith + +commit 951474c7fcd1b28d3178a6644d58958cb3bdf5a8 +Author: Yannick Heneault +Date: Wed Aug 25 11:16:27 2010 -0400 + + modified G200SE conditionnal statement about revision register for products compatibility. + +commit c08b112bfe14fbfe713e4757eb0b704c8ed1f339 +Author: Adam Jackson +Date: Tue Aug 10 10:58:41 2010 -0400 + + xf86-video-mga 1.4.13 + + Signed-off-by: Adam Jackson + commit 411570523550e1997bbd83815990bdda8cfd129c Author: Gaetan Nadon Date: Wed Jul 21 16:49:04 2010 -0400 --- xserver-xorg-video-mga-1.4.13.dfsg.orig/src/mga.h +++ xserver-xorg-video-mga-1.4.13.dfsg/src/mga.h @@ -1,4 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga.h,v 1.87tsi Exp $ */ /* * MGA Millennium (MGA2064W) functions * @@ -137,6 +136,10 @@ #define PCI_CHIP_MGAG200_EH_PCI 0x0533 #endif +#ifndef PCI_CHIP_MGAG200_ER_PCI +#define PCI_CHIP_MGAG200_ER_PCI 0x0534 +#endif + /* * Read/write to the DAC via MMIO */ @@ -200,7 +203,9 @@ typedef struct { unsigned char ExtVga[6]; unsigned char DacClk[6]; - unsigned char * DacRegs; + unsigned char ExtVga_Index24; + unsigned char Dac_Index90; + unsigned char * DacRegs; unsigned long crtc2[0x58]; unsigned char dac2[0x21]; CARD32 Option; @@ -479,6 +484,7 @@ int is_G200WB:1; int is_G200EV:1; int is_G200EH:1; + int is_G200ER:1; int KVM; --- xserver-xorg-video-mga-1.4.13.dfsg.orig/src/mga_dri.h +++ xserver-xorg-video-mga-1.4.13.dfsg/src/mga_dri.h @@ -1,5 +1,3 @@ -/* $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. * All Rights Reserved. --- xserver-xorg-video-mga-1.4.13.dfsg.orig/src/mga_driver.c +++ xserver-xorg-video-mga-1.4.13.dfsg/src/mga_driver.c @@ -1,4 +1,3 @@ -/* $XConsortium: mga_driver.c /main/12 1996/10/28 05:13:26 kaleb $ */ /* * MGA Millennium (MGA2064W) with Ti3026 RAMDAC driver v.1.1 * @@ -404,6 +403,21 @@ 8192, 0x4000, /* Memory probe size & offset values */ }, + /* G200ER */ + [15] = { 0, 1, 0, 0, 1, 0, 0, 0, new_BARs, + (TRANSC_SOLID_FILL | TWO_PASS_COLOR_EXPAND | USE_LINEAR_EXPANSION), + { + { 50000, 230000 }, /* System VCO frequencies */ + { 50000, 203400 }, /* Pixel VCO frequencies */ + { 0, 0 }, /* Video VCO frequencies */ + 45000, /* Memory clock */ + 27050, /* PLL reference frequency */ + 0, /* Supports fast bitblt? */ + MGA_HOST_PCI /* Host interface */ + }, + + 16384, 0x4000, /* Memory probe size & offset values */ + } }; #ifdef XSERVER_LIBPCIACCESS @@ -433,6 +447,8 @@ MGA_DEVICE_MATCH( PCI_CHIP_MGAG200_EH_PCI, 14 ), + MGA_DEVICE_MATCH(PCI_CHIP_MGAG200_ER_PCI, 15 ), + { 0, 0, 0 }, }; #endif @@ -450,6 +466,7 @@ { PCI_CHIP_MGAG200_SE_A_PCI, "mgag200 SE A PCI" }, { PCI_CHIP_MGAG200_SE_B_PCI, "mgag200 SE B PCI" }, { PCI_CHIP_MGAG200_EV_PCI, "mgag200 EV Maxim" }, + { PCI_CHIP_MGAG200_ER_PCI, "mgag200 ER SH7757" }, { PCI_CHIP_MGAG200_WINBOND_PCI, "mgag200 eW Nuvoton" }, { PCI_CHIP_MGAG200_EH_PCI, "mgag200eH" }, { PCI_CHIP_MGAG400, "mgag400" }, @@ -472,6 +489,8 @@ RES_SHARED_VGA }, { PCI_CHIP_MGAG200_EV_PCI, PCI_CHIP_MGAG200_EV_PCI, RES_SHARED_VGA }, + { PCI_CHIP_MGAG200_ER_PCI, PCI_CHIP_MGAG200_ER_PCI, + RES_SHARED_VGA }, { PCI_CHIP_MGAG200_WINBOND_PCI, PCI_CHIP_MGAG200_WINBOND_PCI, RES_SHARED_VGA }, { PCI_CHIP_MGAG200_EH_PCI, PCI_CHIP_MGAG200_EH_PCI, @@ -913,6 +932,11 @@ case PCI_CHIP_MGAG200_EH_PCI: attrib_no = 14; break; + + case PCI_CHIP_MGAG200_ER_PCI: + attrib_no = 15; + break; + default: return FALSE; @@ -1081,7 +1105,7 @@ if (pMga->is_G200SE) pMga->reg_1e24 = INREG(0x1e24); /* stash the model for later */ - if (pMga->reg_1e24 == 0x01) { + if (pMga->reg_1e24 >= 0x01) { MGAUnmapMem(pScrn); ProbeSize = 16384; ProbeSizeOffset = 0x10000; @@ -1286,6 +1310,11 @@ MGASave(pScrn); /* It is now safe to talk to the card */ + /* Allow access to DDC */ + if (pMga->is_G200ER) { + CARD8 ucData = inMGAdac(MGA1064_GEN_IO_CTL2); + outMGAdac(MGA1064_GEN_IO_CTL2, ucData | 1); + } /* Initialize I2C buses - used by DDC if available */ if (pMga->i2cInit) { @@ -1327,6 +1356,12 @@ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "end of monitor info\n"); } + /* Remove access to DDC */ + if (pMga->is_G200ER) { + CARD8 ucData = inMGAdac(MGA1064_GEN_IO_CTL2); + outMGAdac(MGA1064_GEN_IO_CTL2, ucData & ~1); + } + /* Restore previous state and unmap MGA memory and MMIO areas */ MGARestore(pScrn); MGAUnmapMem(pScrn); @@ -1620,6 +1655,7 @@ pMga->is_G200EV = (pMga->Chipset == PCI_CHIP_MGAG200_EV_PCI); pMga->is_G200WB = (pMga->Chipset == PCI_CHIP_MGAG200_WINBOND_PCI); pMga->is_G200EH = (pMga->Chipset == PCI_CHIP_MGAG200_EH_PCI); + pMga->is_G200ER = (pMga->Chipset == PCI_CHIP_MGAG200_ER_PCI); #ifdef USEMGAHAL if (pMga->chip_attribs->HAL_chipset) { @@ -1780,15 +1816,9 @@ #ifndef XSERVER_LIBPCIACCESS /* * Find the BIOS base. Get it from the PCI config if possible. Otherwise - * use the VGA default. Allow the config file to override this. + * use the VGA default. */ - pMga->BiosFrom = X_NONE; - if (pMga->device->BiosBase != 0) { - /* XXX This isn't used */ - pMga->BiosAddress = pMga->device->BiosBase; - pMga->BiosFrom = X_CONFIG; - } else { /* details: rombase sdk pp 4-15 */ if (pMga->PciInfo->biosBase != 0) { pMga->BiosAddress = pMga->PciInfo->biosBase & 0xffff0000; @@ -1797,7 +1827,6 @@ pMga->BiosAddress = 0xc0000; pMga->BiosFrom = X_DEFAULT; } - } if (pMga->BiosAddress) { xf86DrvMsg(pScrn->scrnIndex, pMga->BiosFrom, "BIOS at 0x%lX\n", (unsigned long)pMga->BiosAddress); @@ -2142,6 +2171,7 @@ case PCI_CHIP_MGAG200_WINBOND_PCI: case PCI_CHIP_MGAG200_EV_PCI: case PCI_CHIP_MGAG200_EH_PCI: + case PCI_CHIP_MGAG200_ER_PCI: case PCI_CHIP_MGAG400: case PCI_CHIP_MGAG550: MGAGSetupFuncs(pScrn); @@ -2255,6 +2285,7 @@ case PCI_CHIP_MGAG200_WINBOND_PCI: case PCI_CHIP_MGAG200_EV_PCI: case PCI_CHIP_MGAG200_EH_PCI: + case PCI_CHIP_MGAG200_ER_PCI: pMga->SrcOrg = 0; pMga->DstOrg = 0; break; @@ -2432,16 +2463,17 @@ maxPitch = 2048; break; case PCI_CHIP_MGAG200_SE_A_PCI: - if (pScrn->videoRam < 2048){ + if (pScrn->videoRam < 2048){ maxPitch = 1280; - } - break; + } + break; case PCI_CHIP_MGAG200: case PCI_CHIP_MGAG200_PCI: case PCI_CHIP_MGAG200_SE_B_PCI: case PCI_CHIP_MGAG200_WINBOND_PCI: case PCI_CHIP_MGAG200_EV_PCI: case PCI_CHIP_MGAG200_EH_PCI: + case PCI_CHIP_MGAG200_ER_PCI: case PCI_CHIP_MGAG400: case PCI_CHIP_MGAG550: maxPitch = 4096; @@ -3250,15 +3282,93 @@ outb(0xfac, 0x02); } - MGA_NOT_HAL( - if (pMga->is_G200SE) { + /* Reset tagfifo*/ + if (pMga->is_G200ER) + { + CARD32 ulMemCtl = INREG(MGAREG_MEMCTL); + CARD8 ucSeq1; + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Reset tagfifo\n"); + /* Screen off */ + OUTREG8(MGAREG_SEQ_INDEX, 0x01); /* Select SEQ1 */ + ucSeq1 = INREG8(MGAREG_SEQ_DATA) | 0x20; + OUTREG8(MGAREG_SEQ_DATA, ucSeq1); + + /* Reset tagfifo */ + OUTREG(MGAREG_MEMCTL, ulMemCtl | 0x002000000); + usleep(1000); /* wait 1ms */ + OUTREG(MGAREG_MEMCTL, ulMemCtl & ~0x002000000); + + /* Screen on */ + OUTREG8(MGAREG_SEQ_DATA, ucSeq1 & ~0x20); + + } + + /* + This function optimize the Priority Request control + Higher HiPriLvl will reduce drawing performance + We need to give enough bandwith to crtc to avoid visual artifact + */ + if (pMga->is_G200SE) + { + if (pMga->reg_1e24 >= 0x02) + { + /* Calulate CRTC Priority value */ + CARD8 ucHiPriLvl; + CARD32 ulBitsPerPixel; + CARD32 ulMemoryBandwidth; + + /* uiBitsPerPixel can only be 8,16 or32 */ + if (pScrn->bitsPerPixel > 16) + { + ulBitsPerPixel = 32; + } + else if (pScrn->bitsPerPixel > 8) + { + ulBitsPerPixel = 16; + } + else + { + ulBitsPerPixel = 8; + } + + + ulMemoryBandwidth = (mode->Clock * ulBitsPerPixel) / 1000; + + if (ulMemoryBandwidth > 3100) ucHiPriLvl = 0; + else if (ulMemoryBandwidth > 2600) ucHiPriLvl = 1; + else if (ulMemoryBandwidth > 1900) ucHiPriLvl = 2; + else if (ulMemoryBandwidth > 1160) ucHiPriLvl = 3; + else if (ulMemoryBandwidth > 440) ucHiPriLvl = 4; + else ucHiPriLvl = 5; + OUTREG8(0x1FDE, 0x06); - if (pMga->reg_1e24 == 0x01) - OUTREG8(0x1FDF, 0x03); - else - OUTREG8(0x1FDF, 0x14); + OUTREG8(0x1FDF, ucHiPriLvl); + + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Clock == %d\n", mode->Clock); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "BitsPerPixel == %d\n", pScrn->bitsPerPixel); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "MemoryBandwidth == %d\n", ulMemoryBandwidth); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "HiPriLvl == %02X\n", ucHiPriLvl); } - ); + else + { + MGA_NOT_HAL( + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Clock == %d\n", mode->Clock); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "BitsPerPixel == %d\n", pScrn->bitsPerPixel); + OUTREG8(0x1FDE, 0x06); + if (pMga->reg_1e24 >= 0x01) + { + OUTREG8(0x1FDF, 0x03); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "HiPriLvl == 03\n"); + } + else + { + OUTREG8(0x1FDF, 0x14); + xf86DrvMsg(pScrn->scrnIndex, X_INFO, "HiPriLvl == 14h\n"); + } + ); + } + } pMga->CurrentLayout.mode = mode; @@ -4322,13 +4432,23 @@ MGAPtr pMga = MGAPTR(pScrn); if (pMga->Chipset == PCI_CHIP_MGAG200_SE_A_PCI) { - if (mode->HDisplay > 1600) - return MODE_VIRTUAL_X; - if (mode->VDisplay > 1200) - return MODE_VIRTUAL_Y; - if (pMga->reg_1e24 == 0x01 && - xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 244) - return MODE_BANDWIDTH; + if (pMga->reg_1e24 == 0x01) { + if (mode->HDisplay > 1600) + return MODE_VIRTUAL_X; + if (mode->VDisplay > 1200) + return MODE_VIRTUAL_Y; + if (xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 244) + return MODE_BANDWIDTH; + } else { + if (pMga->reg_1e24 >= 0x02) { + if (mode->HDisplay > 1920) + return MODE_VIRTUAL_X; + if (mode->VDisplay > 1200) + return MODE_VIRTUAL_Y; + if (xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 301) + return MODE_BANDWIDTH; + } + } } else if (pMga->is_G200WB){ if (mode->Flags & V_DBLSCAN) return MODE_NO_DBLESCAN; @@ -4340,10 +4460,13 @@ return MODE_BANDWIDTH; } else if (pMga->is_G200EV && (xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 327)) { - return MODE_BANDWIDTH; + return MODE_BANDWIDTH; } else if (pMga->is_G200EH && (xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 375)) { return MODE_BANDWIDTH; + } else if (pMga->is_G200ER + && (xf86ModeBandwidth(mode, pScrn->bitsPerPixel) > 550)) { + return MODE_BANDWIDTH; } lace = 1 + ((mode->Flags & V_INTERLACE) != 0); --- xserver-xorg-video-mga-1.4.13.dfsg.orig/src/mga_dripriv.h +++ xserver-xorg-video-mga-1.4.13.dfsg/src/mga_dripriv.h @@ -1,5 +1,3 @@ -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_dripriv.h,v 1.4 2001/04/10 16:08:01 dawes Exp $ */ - /* * Copyright 2000 VA Linux Systems Inc., Fremont, California. * All Rights Reserved. --- xserver-xorg-video-mga-1.4.13.dfsg.orig/src/mga_merge.c +++ xserver-xorg-video-mga-1.4.13.dfsg/src/mga_merge.c @@ -363,6 +363,7 @@ case PCI_CHIP_MGAG200_WINBOND_PCI: case PCI_CHIP_MGAG200_EV_PCI: case PCI_CHIP_MGAG200_EH_PCI: + case PCI_CHIP_MGAG200_ER_PCI: case PCI_CHIP_MGAG400: case PCI_CHIP_MGAG550: MGAGSetupFuncs(pScrn); @@ -518,6 +519,7 @@ case PCI_CHIP_MGAG200_WINBOND_PCI: case PCI_CHIP_MGAG200_EV_PCI: case PCI_CHIP_MGAG200_EH_PCI: + case PCI_CHIP_MGAG200_ER_PCI: case PCI_CHIP_MGAG400: case PCI_CHIP_MGAG550: maxPitch = 4096; --- xserver-xorg-video-mga-1.4.13.dfsg.orig/src/mga_dri.c +++ xserver-xorg-video-mga-1.4.13.dfsg/src/mga_dri.c @@ -32,7 +32,6 @@ #include "xf86.h" #include "xf86_OSproc.h" -#include "xf86Priv.h" #include "xf86PciInfo.h" #include "xf86Pci.h" --- xserver-xorg-video-mga-1.4.13.dfsg.orig/src/mga_dacG.c +++ xserver-xorg-video-mga-1.4.13.dfsg/src/mga_dacG.c @@ -444,6 +444,116 @@ outMGAdac(MGA1064_REMHEADCTL, ucTempByte); } +#define G200ER_PLLREF 48000 +#define G200ER_VCOMIN 1056000 +#define G200ER_VCOMAX 1488000 + +static void MGAG200ERComputePLLParam(ScrnInfoPtr pScrn, long lFo, int *piM, int *piN, int *piP) +{ + + int ulM; + int ulN; + int ulO; + int ulR; + + CARD32 ulComputedFo; + CARD32 ulVco; + CARD32 ulFDelta; + CARD32 ulFTmpDelta; + + CARD32 aulMDivValue[] = {1, 2, 4, 8}; + + CARD32 ulFo = lFo; + + ulFDelta = 0xFFFFFFFF; + + for (ulR = 0; ulR < 4; ulR++) + { + if(ulFDelta==0) break; + for (ulN = 5; (ulN <= 128) ; ulN++) + { + if(ulFDelta==0) break; + for (ulM = 3; ulM >= 0; ulM--) + { + if(ulFDelta==0) break; + for (ulO = 5; ulO <= 32; ulO++) + { + ulVco = (G200ER_PLLREF * (ulN+1)) / (ulR+1); + // Validate vco + if (ulVco < G200ER_VCOMIN) continue; + if (ulVco > G200ER_VCOMAX) continue; + ulComputedFo = ulVco / (aulMDivValue[ulM] * (ulO+1)); + + if (ulComputedFo > ulFo) + { + ulFTmpDelta = ulComputedFo - ulFo; + } + else + { + ulFTmpDelta = ulFo - ulComputedFo; + } + + if (ulFTmpDelta < ulFDelta) + { + ulFDelta = ulFTmpDelta; + // XG200ERPIXPLLCM M<1:0> O<7:3> + *piM = (CARD8)ulM | (CARD8)(ulO<<3); + // + // XG200ERPIXPLLCN N<6:0> + *piN = (CARD8)ulN; + // + // XG200ERPIXPLLCP R<1:0> cg<7:4> (Use R value) + *piP = (CARD8)ulR | (CARD8)(ulR<<3); + + // Test + int ftest = (G200ER_PLLREF * (ulN+1)) / ((ulR+1) * aulMDivValue[ulM] * (ulO+1)); + ftest=ftest; + } + } // End O Loop + } // End M Loop + } // End N Loop + } // End R Loop +} + +static void +MGAG200ERPIXPLLSET(ScrnInfoPtr pScrn, MGARegPtr mgaReg) +{ + //TODO G200ER Validate sequence + CARD8 ucPixCtrl, ucTempByte; + MGAPtr pMga = MGAPTR(pScrn); + + + // Set pixclkdis to 1 + ucPixCtrl = inMGAdac(MGA1064_PIX_CLK_CTL); + ucPixCtrl |= MGA1064_PIX_CLK_CTL_CLK_DIS; + outMGAdac(MGA1064_PIX_CLK_CTL, ucPixCtrl); + + ucTempByte = inMGAdac(MGA1064_REMHEADCTL); + ucTempByte |= MGA1064_REMHEADCTL_CLKDIS; + outMGAdac(MGA1064_REMHEADCTL, ucTempByte); + + // Select PLL Set C + ucTempByte = INREG8(MGAREG_MEM_MISC_READ); + ucTempByte |= (0x3<<2) | 0xc0; //select MGA pixel clock + OUTREG8(MGAREG_MEM_MISC_WRITE, ucTempByte); + + ucPixCtrl &= ~MGA1064_PIX_CLK_CTL_CLK_DIS; + ucPixCtrl |= MGA1064_PIX_CLK_CTL_CLK_POW_DOWN; + outMGAdac(MGA1064_PIX_CLK_CTL, ucPixCtrl); + + // Wait 500 us + usleep(500); + + // Program the Pixel PLL Register + outMGAdac(MGA1064_ER_PIX_PLLC_N, mgaReg->PllN); + outMGAdac(MGA1064_ER_PIX_PLLC_M, mgaReg->PllM); + outMGAdac(MGA1064_ER_PIX_PLLC_P, mgaReg->PllP); + + // Wait 50 us + usleep(50); + +} + static void MGAG200WBPrepareForModeSwitch(ScrnInfoPtr pScrn) { @@ -768,8 +878,13 @@ pReg->PllM = m; pReg->PllN = n; - pReg->PllP = p; - } else { + pReg->PllP = p; + } else if (pMga->is_G200ER) { + MGAG200ERComputePLLParam(pScrn, f_out, &m, &n, &p); + pReg->PllM = m; + pReg->PllN = n; + pReg->PllP = p; + } else { /* Do the calculations for m, n, p and s */ MGAGCalcClock( pScrn, f_out, &m, &n, &p, &s ); @@ -966,6 +1081,10 @@ pReg->Option2 = 0x0000b000; break; + case PCI_CHIP_MGAG200_ER_PCI: + pReg->Dac_Index90 = 0; + break; + case PCI_CHIP_MGAG200_EH_PCI: pReg->DacRegs[MGA1064_MISC_CTL] = MGA1064_MISC_CTL_VGA8 | @@ -1088,6 +1207,7 @@ if (pMga->is_G200WB){ pReg->ExtVga[1] |= 0x88; } + pReg->ExtVga_Index24 = 0x05; pVga->CRTC[0] = ht - 4; pVga->CRTC[1] = hd; @@ -1327,10 +1447,15 @@ if ( (pMga->is_G200EV || pMga->is_G200WB || pMga->is_G200EH) && (i >= 0x44) && (i <= 0x4E)) continue; - + outMGAdac(i, mgaReg->DacRegs[i]); } + if (pMga->is_G200ER) + { + outMGAdac(0x90, mgaReg->Dac_Index90); + } + if (!MGAISGx50(pMga)) { /* restore pci_option register */ #ifdef XSERVER_LIBPCIACCESS @@ -1361,7 +1486,9 @@ #endif } - if (pMga->is_G200EV) { + if (pMga->is_G200ER) { + MGAG200ERPIXPLLSET(pScrn, mgaReg); + } else if (pMga->is_G200EV) { MGAG200EVPIXPLLSET(pScrn, mgaReg); } else if (pMga->is_G200WB) { MGAG200WBPIXPLLSET(pScrn, mgaReg); @@ -1388,6 +1515,11 @@ for (i = 0; i < 6; i++) OUTREG16(MGAREG_CRTCEXT_INDEX, (mgaReg->ExtVga[i] << 8) | i); + if (pMga->is_G200ER) { + OUTREG8(MGAREG_CRTCEXT_INDEX, 0x24); + OUTREG8(MGAREG_CRTCEXT_DATA, mgaReg->ExtVga_Index24); + } + /* This handles restoring the generic VGA registers. */ if (pMga->is_G200SE) { MGAG200SERestoreMode(pScrn, vgaReg); @@ -1404,7 +1536,7 @@ OUTREG16(MGAREG_CRTCEXT_INDEX, 6); OUTREG16(MGAREG_CRTCEXT_DATA, 0); } - + /* * this is needed to properly restore start address */ @@ -1555,6 +1687,11 @@ mgaReg->PllM = inMGAdac(MGA1064_EH_PIX_PLLC_M); mgaReg->PllN = inMGAdac(MGA1064_EH_PIX_PLLC_N); mgaReg->PllP = inMGAdac(MGA1064_EH_PIX_PLLC_P); + } else if (pMga->is_G200ER) { + mgaReg->PllM = inMGAdac(MGA1064_ER_PIX_PLLC_M); + mgaReg->PllN = inMGAdac(MGA1064_ER_PIX_PLLC_N); + mgaReg->PllP = inMGAdac(MGA1064_ER_PIX_PLLC_P); + mgaReg->Dac_Index90 = inMGAdac(0x90); } mgaReg->PIXPLLCSaved = TRUE; @@ -1583,6 +1720,11 @@ OUTREG8(MGAREG_CRTCEXT_INDEX, i); mgaReg->ExtVga[i] = INREG8(MGAREG_CRTCEXT_DATA); } + if (pMga->is_G200ER) + { + OUTREG8(MGAREG_CRTCEXT_INDEX, 0x24); + mgaReg->ExtVga_Index24 = INREG8(MGAREG_CRTCEXT_DATA); + } #ifdef DEBUG ErrorF("Saved values:\nDAC:"); @@ -1737,7 +1879,7 @@ { (1 << 0), (1 << 2) }, { (1 << 4), (1 << 5) }, { (1 << 0), (1 << 1) }, /* G200SE, G200EV and G200WB I2C bits */ - { (1 << 1), (1 << 0) }, /* G200EH I2C bits */ + { (1 << 1), (1 << 0) }, /* G200EH, G200ER I2C bits */ }; @@ -1750,7 +1892,7 @@ if (pMga->is_G200SE || pMga->is_G200WB || pMga->is_G200EV) i2c_index = 3; - else if (pMga->is_G200EH) + else if (pMga->is_G200EH || pMga->is_G200ER) i2c_index = 4; else i2c_index = 0; @@ -1851,7 +1993,7 @@ if (pMga->is_G200SE || pMga->is_G200WB || pMga->is_G200EV) i2c_index = 3; - else if (pMga->is_G200EH) + else if (pMga->is_G200EH || pMga->is_G200ER) i2c_index = 4; else i2c_index = 0; @@ -1976,7 +2118,7 @@ pMga->Save = MGAGSave; pMga->Restore = MGAGRestore; pMga->ModeInit = MGAGInit; - if (!pMga->is_G200WB){ + if ((!pMga->is_G200WB) && (!pMga->is_G200ER)) { pMga->ddc1Read = MGAG_ddc1Read; /* vgaHWddc1SetSpeed will only work if the card is in VGA mode */ pMga->DDC1SetSpeed = vgaHWddc1SetSpeedWeak(); --- xserver-xorg-video-mga-1.4.13.dfsg.orig/src/mga_reg.h +++ xserver-xorg-video-mga-1.4.13.dfsg/src/mga_reg.h @@ -1,11 +1,3 @@ -/* $XConsortium: mgareg.h /main/2 1996/10/25 10:33:21 kaleb $ */ - - - -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/mga_reg.h,v 1.18 2001/09/26 12:59:18 alanh Exp $ */ - - - /* * MGA Millennium (MGA2064W) functions * MGA Mystique (MGA1064SG) functions @@ -127,6 +119,9 @@ #define MGAREG_WACCEPTSEQ 0x1dd4 #define MGAREG_WMISC 0x1e70 + +#define MGAREG_MEMCTL 0x2E08 + /* OPMODE register additives */ #define MGAOPM_DMA_GENERAL (0x00 << 2) @@ -377,6 +372,7 @@ #define MGA1064_MISC_CTL_VGA8 ( 0x01 << 3 ) #define MGA1064_MISC_CTL_DAC_RAM_CS ( 0x01 << 4 ) +#define MGA1064_GEN_IO_CTL2 0x29 #define MGA1064_GEN_IO_CTL 0x2a #define MGA1064_GEN_IO_DATA 0x2b #define MGA1064_SYS_PLL_M 0x2c @@ -437,6 +433,10 @@ #define MGA1064_EH_PIX_PLLC_N 0xb7 #define MGA1064_EH_PIX_PLLC_P 0xb8 +/* Modified PLL for G200 Maxim (G200ER) */ +#define MGA1064_ER_PIX_PLLC_M 0xb7 +#define MGA1064_ER_PIX_PLLC_N 0xb6 +#define MGA1064_ER_PIX_PLLC_P 0xb8 #define MGA1064_DISP_CTL 0x8a #define MGA1064_DISP_CTL_DAC1OUTSEL_MASK 0x01 --- xserver-xorg-video-mga-1.4.13.dfsg.orig/src/mga_macros.h +++ xserver-xorg-video-mga-1.4.13.dfsg/src/mga_macros.h @@ -1,5 +1,3 @@ -/* $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_ --- xserver-xorg-video-mga-1.4.13.dfsg.orig/src/mga_storm.c +++ xserver-xorg-video-mga-1.4.13.dfsg/src/mga_storm.c @@ -1131,6 +1131,7 @@ case PCI_CHIP_MGAG200_WINBOND_PCI: case PCI_CHIP_MGAG200_EV_PCI: case PCI_CHIP_MGAG200_EH_PCI: + case PCI_CHIP_MGAG200_ER_PCI: pMga->SrcOrg = 0; OUTREG(MGAREG_SRCORG, pMga->realSrcOrg); OUTREG(MGAREG_DSTORG, pMga->DstOrg); --- xserver-xorg-video-mga-1.4.13.dfsg.orig/src/mgareg_flags.h +++ xserver-xorg-video-mga-1.4.13.dfsg/src/mgareg_flags.h @@ -19,7 +19,6 @@ * 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 $ */ #ifndef _MGAREGS_H_ #define _MGAREGS_H_ --- xserver-xorg-video-mga-1.4.13.dfsg.orig/src/binding.h +++ xserver-xorg-video-mga-1.4.13.dfsg/src/binding.h @@ -13,7 +13,6 @@ @end ***************************************************************************************/ -/* $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 --- xserver-xorg-video-mga-1.4.13.dfsg.orig/src/mga_common.h +++ xserver-xorg-video-mga-1.4.13.dfsg/src/mga_common.h @@ -25,8 +25,6 @@ * 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 $ - * */ #ifndef _MGA_COMMON_H_ --- xserver-xorg-video-mga-1.4.13.dfsg.orig/src/mga_sarea.h +++ xserver-xorg-video-mga-1.4.13.dfsg/src/mga_sarea.h @@ -1,5 +1,3 @@ -/* $XFree86$ */ - /* * Copyright 2000 Gareth Hughes * All Rights Reserved. --- xserver-xorg-video-mga-1.4.13.dfsg.orig/debian/compat +++ xserver-xorg-video-mga-1.4.13.dfsg/debian/compat @@ -0,0 +1 @@ +8 --- xserver-xorg-video-mga-1.4.13.dfsg.orig/debian/copyright +++ xserver-xorg-video-mga-1.4.13.dfsg/debian/copyright @@ -0,0 +1,241 @@ +This package was downloaded from +git://anongit.freedesktop.org/git/xorg/driver/xf86-video-mga. +Release tarballs are available at +http://xorg.freedesktop.org/releases/individual/driver/ + +Copyright (C) 1994-2003 The XFree86 Project, Inc. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is fur- +nished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FIT- +NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CON- +NECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the XFree86 Project shall not +be used in advertising or otherwise to promote the sale, use or other deal- +ings in this Software without prior written authorization from the XFree86 +Project. + +*********************************************************** + +Copyright 1989, 1998 The Open Group + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation. + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + +*********************************************************** + +Copyright 1994 by Robin Cutshaw + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the name of Robin Cutshaw not be used in +advertising or publicity pertaining to distribution of the software without +specific, written prior permission. Robin Cutshaw makes no representations +about the suitability of this software for any purpose. It is provided +"as is" without express or implied warranty. + +ROBIN CUTSHAW DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +EVENT SHALL ROBIN CUTSHAW BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. + +*********************************************************** + +Copyright 2000 VA Linux Systems Inc., Fremont, California. +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next +paragraph) shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES +OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +*********************************************************** + +Copyright 2006 Red Hat, Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software") +to deal in the software without restriction, including without limitation +on the rights to use, copy, modify, merge, publish, distribute, sub +license, and/or sell copies of the Software, and to permit persons to whom +them Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next +paragraph) shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTIBILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES, OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT, OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*********************************************************** + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +STEPHEN CROWLEY, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE +OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*********************************************************** + +Copyright 2002 Tungsten Graphics, Inc., Cedar Park, Texas. +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next +paragraph) shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. + +*********************************************************** + +(c) 1999 Matrox Graphics Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +MATROX GRAPHICS INC., OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE +OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +*********************************************************** + +Copyright © 1997, Matrox Graphics Inc. +All Rights Reserved. + +*********************************************************** + +Copyright 2000 Gareth Hughes +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom the +Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next +paragraph) shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +GARETH HUGHES BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Authors: + Gareth Hughes + +*********************************************************** + +(C) Copyright IBM Corporation 2005 +All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and associated documentation files (the "Software"), +to deal in the Software without restriction, including without limitation +on the rights to use, copy, modify, merge, publish, distribute, sub +license, and/or sell copies of the Software, and to permit persons to whom +the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice (including the next +paragraph) shall be included in all copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL +IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. --- xserver-xorg-video-mga-1.4.13.dfsg.orig/debian/README.source +++ xserver-xorg-video-mga-1.4.13.dfsg/debian/README.source @@ -0,0 +1,49 @@ +------------------------------------------------------ +Quick Guide To Patching This Package For The Impatient +------------------------------------------------------ + +1. Make sure you have quilt installed +2. Unpack the package as usual with "dpkg-source -x" +3. Run the "patch" target in debian/rules +4. Create a new patch with "quilt new" (see quilt(1)) +5. Edit all the files you want to include in the patch with "quilt edit" + (see quilt(1)). +6. Write the patch with "quilt refresh" (see quilt(1)) +7. Run the "clean" target in debian/rules + +Alternatively, instead of using quilt directly, you can drop the patch in to +debian/patches and add the name of the patch to debian/patches/series. + +------------------------------------ +Guide To The X Strike Force Packages +------------------------------------ + +The X Strike Force team maintains X packages in git repositories on +git.debian.org in the pkg-xorg subdirectory. Most upstream packages +are actually maintained in git repositories as well, so they often +just need to be pulled into git.debian.org in a "upstream-*" branch. +Otherwise, the upstream sources are manually installed in the Debian +git repository. + +The .orig.tar.gz upstream source file could be generated using this +"upstream-*" branch in the Debian git repository but it is actually +copied from upstream tarballs directly. + +Due to X.org being highly modular, packaging all X.org applications +as their own independent packages would have created too many Debian +packages. For this reason, some X.org applications have been grouped +into larger packages: xutils, xutils-dev, x11-apps, x11-session-utils, +x11-utils, x11-xfs-utils, x11-xkb-utils, x11-xserver-utils. +Most packages, including the X.org server itself and all libraries +and drivers are, however maintained independently. + +The Debian packaging is added by creating the "debian-*" git branch +which contains the aforementioned "upstream-*" branch plus the debian/ +repository files. +When a patch has to be applied to the Debian package, two solutions +are involved: +* If the patch is available in one of the upstream branches, it + may be git'cherry-picked into the Debian repository. In this + case, it appears directly in the .diff.gz. +* Otherwise, the patch is added to debian/patches/ which is managed + with quilt as documented in /usr/share/doc/quilt/README.source. --- xserver-xorg-video-mga-1.4.13.dfsg.orig/debian/control +++ xserver-xorg-video-mga-1.4.13.dfsg/debian/control @@ -0,0 +1,46 @@ +Source: xserver-xorg-video-mga +Section: x11 +Priority: optional +Maintainer: Debian X Strike Force +Uploaders: + Cyril Brulebois , + Tormod Volden +Build-Depends: + debhelper (>= 8), + dh-autoreconf, + pkg-config, + xserver-xorg-dev (>= 2:1.11.2.902), + x11proto-gl-dev, + x11proto-video-dev, + libgl1-mesa-dev | libgl-dev, + x11proto-core-dev, + x11proto-fonts-dev, + x11proto-randr-dev, + x11proto-render-dev, + x11proto-xext-dev, + libdrm-dev (>> 2.0) [!hurd-i386], + x11proto-xf86dri-dev, + quilt, + xutils-dev (>= 1:7.5+4) +Standards-Version: 3.9.2 +Vcs-Git: git://git.debian.org/git/pkg-xorg/driver/xserver-xorg-video-mga +Vcs-Browser: http://git.debian.org/?p=pkg-xorg/driver/xserver-xorg-video-mga.git + +Package: xserver-xorg-video-mga +Architecture: any +Depends: + ${shlibs:Depends}, + ${misc:Depends}, + ${xviddriver:Depends}, +Provides: + ${xviddriver:Provides} +Suggests: + firmware-linux +Description: X.Org X server -- MGA display driver + This package provides the driver for the Matrox MGA family of chipsets, + including Matrox Millennium and Mystique cards. + . + More information about X.Org can be found at: + + . + This package is built from the X.org xf86-video-mga driver module. --- xserver-xorg-video-mga-1.4.13.dfsg.orig/debian/watch +++ xserver-xorg-video-mga-1.4.13.dfsg/debian/watch @@ -0,0 +1,4 @@ +#git=git://anongit.freedesktop.org/xorg/driver/xf86-video-mga +version=3 +opts=dversionmangle=s/\.dfsg$// \ + http://xorg.freedesktop.org/releases/individual/driver/ xf86-video-mga-(1\.[^9].*)\.tar\.gz debian debian/xsfbs/repack.sh --- xserver-xorg-video-mga-1.4.13.dfsg.orig/debian/rules +++ xserver-xorg-video-mga-1.4.13.dfsg/debian/rules @@ -0,0 +1,17 @@ +#!/usr/bin/make -f + +# Install in debian/tmp to retain control through dh_install: +override_dh_auto_install: + dh_auto_install --destdir=debian/tmp + +# Kill *.la files, and forget no-one: +override_dh_install: + find debian/tmp -name '*.la' -delete + dh_install --fail-missing + +# That's a plugin, use appropriate warning level: +override_dh_shlibdeps: + dh_shlibdeps -- --warnings=6 + +%: + dh $@ --with quilt,autoreconf,xsf --builddirectory=build/ --- xserver-xorg-video-mga-1.4.13.dfsg.orig/debian/changelog +++ xserver-xorg-video-mga-1.4.13.dfsg/debian/changelog @@ -0,0 +1,381 @@ +xserver-xorg-video-mga (1:1.4.13.dfsg-4build2) precise; urgency=low + + * Rebuild again to fix upload snafu + + -- Christopher James Halse Rogers Fri, 16 Dec 2011 09:56:57 +1100 + +xserver-xorg-video-mga (1:1.4.13.dfsg-4build1) precise; urgency=low + + * Rebuild to pick up new Xserver dependencies + + -- Christopher James Halse Rogers Fri, 16 Dec 2011 08:55:24 +1100 + +xserver-xorg-video-mga (1:1.4.13.dfsg-4) unstable; urgency=low + + [ Tormod Volden ] + * Merge from upstream up to 01ca2186ea028b2549de509b51726aa08519fce0 + - 01ca218... Reset tagfifo for renesas. + - c083bf0... Added support for G200SE Pilot3 + - 43280e6... Don't include xf86Priv.h + * Bump Standards-Version to 3.9.2 (no changes needed) + + -- Julien Cristau Sun, 23 Oct 2011 17:31:21 +0200 + +xserver-xorg-video-mga (1:1.4.13.dfsg-3) unstable; urgency=low + + * Merge from upstream up to 5f1b04e86e79938c8158055a777280a649f95510 + - 5f1b04e... added support for G200ER. + - f7a2ef6... Sun's copyrights now belong to Oracle + - 636c3c8... Don't allow the config file to override BIOS location + - 0bd44fa... Purge cvs tags. + - 951474c... modified G200SE conditionnal statement about revision + register for products compatibility. + * Add myself as uploader + + -- Tormod Volden Mon, 21 Feb 2011 23:54:24 +0100 + +xserver-xorg-video-mga (1:1.4.13.dfsg-2) unstable; urgency=low + + * Switch to dh: + - Use debhelper 8. + - Use dh-autoreconf. + - Bump xserver-xorg-dev build-dep for dh_xsf_substvars and xsf + debhelper sequence. + * Remove xsfbs (except repack.sh) accordingly. + * Update Uploaders list. Thanks, David & Brice! + * Remove long obsolete Replaces/Conflicts. + * Wrap Depends/Provides/Suggests. + * Bump Standards-Version to 3.9.1 (no changes needed). + + -- Cyril Brulebois Sat, 05 Feb 2011 14:51:41 +0100 + +xserver-xorg-video-mga (1:1.4.13.dfsg-1) experimental; urgency=low + + [ Robert Hooker ] + * New upstream release. + * Bump xutils-dev requirement for new util-macros. + + [ Cyril Brulebois ] + * Tweak watch file to match 1.* but not 1.9* so that 1.9* versions from + 2007 are ignored. + + -- Cyril Brulebois Sat, 20 Nov 2010 17:03:31 +0100 + +xserver-xorg-video-mga (1:1.4.11.dfsg-5) experimental; urgency=low + + * Build against Xserver 1.9.1 rc1. + + -- Cyril Brulebois Sat, 16 Oct 2010 18:59:45 +0200 + +xserver-xorg-video-mga (1:1.4.11.dfsg-4+squeeze1) unstable; urgency=low + + * Add patch: 02_tentatively_unbreak_dual_head.diff, tested by Ferenc + Wágner (thanks!). Patch by Andy MacLean, stolen from LP's #292214 + (hopefully closes: #562209). + + -- Cyril Brulebois Mon, 22 Nov 2010 18:05:24 +0100 + +xserver-xorg-video-mga (1:1.4.11.dfsg-4) unstable; urgency=low + + * Add support for G200EH, cherry-picked from upstream git (closes: #575271). + + -- Julien Cristau Tue, 11 May 2010 16:03:33 +0200 + +xserver-xorg-video-mga (1:1.4.11.dfsg-3) unstable; urgency=low + + [ Julien Cristau ] + * Rename the build directory to not include DEB_BUILD_GNU_TYPE for no + good reason. Thanks, Colin Watson! + * Remove myself from Uploaders + + [ Cyril Brulebois ] + * Update to new xsfbs, replace deprecated ${xserver:Depends} with + ${xviddriver:Depends} in Depends, and bump B-D on xserver-xorg-dev + accordingly. + * Add myself to Uploaders. + * Bump Standards-Version from 3.8.3 to 3.8.4 (no changes needed). + + -- Cyril Brulebois Mon, 03 May 2010 23:27:47 +0200 + +xserver-xorg-video-mga (1:1.4.11.dfsg-2) experimental; urgency=low + + [ Timo Aaltonen ] + * Bump Standards-Version to 3.8.3. + * Build against Xserver 1.7. + + [ Cyril Brulebois ] + * Upload to experimental. + + -- Cyril Brulebois Sun, 06 Dec 2009 02:47:06 +0100 + +xserver-xorg-video-mga (1:1.4.11.dfsg-1) unstable; urgency=low + + [ David Nusinow ] + * Remove 01_gen_pci_ids.diff. The X server now uses an internal table to + choose a driver during autoconfiguration. + * Renumber 03_no_nonfree.diff to 01. + + [ Brice Goglin ] + * New upstream release. + * Add README.source, bump Standards-Version to 3.8.2. + * Update debian/copyright from upstream's COPYING. + + -- Brice Goglin Thu, 30 Jul 2009 12:33:04 +0200 + +xserver-xorg-video-mga (1:1.4.10.dfsg-1) unstable; urgency=low + + * New upstream release. + * xserver-xorg-video-mga now suggests firmware-linux since + a firmware may be needed during driver initialization. + + -- Brice Goglin Mon, 27 Apr 2009 21:12:29 +0200 + +xserver-xorg-video-mga (1:1.4.9.dfsg-4) unstable; urgency=low + + * Upload to unstable. + + -- Julien Cristau Thu, 09 Apr 2009 10:33:47 +0100 + +xserver-xorg-video-mga (1:1.4.9.dfsg-3) experimental; urgency=low + + * Run autoreconf on build; add build-deps on automake, libtool, xutils-dev. + * Handle parallel builds. + * debian/watch, debian/xsfbs/repack.sh: repack the upstream tarball to + remove the non-free stuff. + * Build against xserver 1.6 rc. + + -- Julien Cristau Mon, 09 Feb 2009 19:45:45 +0100 + +xserver-xorg-video-mga (1:1.4.9.dfsg-2) experimental; urgency=low + + * Build against xserver 1.5. + + -- Julien Cristau Tue, 09 Sep 2008 23:50:05 +0100 + +xserver-xorg-video-mga (1:1.4.9.dfsg-1) unstable; urgency=low + + * New upstream release. + * Run dpkg-shlibdeps with --warnings=6. Drivers reference symbols from + /usr/bin/Xorg and other modules, and that's not a bug, so we want + dpkg-shlibdeps to shut up about symbols it can't find. Build-depend on + dpkg-dev >= 1.14.17. + * Bump Standards-Version to 3.7.3. + * Add myself to Uploaders. + + -- Julien Cristau Thu, 10 Jul 2008 13:32:32 +0200 + +xserver-xorg-video-mga (1:1.4.8.dfsg.1-1) unstable; urgency=low + + * New upstream release. + * Drop XS- prefix from Vcs-* fields. + + -- Brice Goglin Fri, 18 Jan 2008 23:43:57 +0100 + +xserver-xorg-video-mga (1:1.4.7.dfsg.1-3) unstable; urgency=low + + * Upload to unstable + + -- David Nusinow Sun, 16 Sep 2007 15:43:45 -0400 + +xserver-xorg-video-mga (1:1.4.7.dfsg.1-2) experimental; urgency=low + + * Add 01_gen_pci_ids.diff. This patch provides a set of PCI ID's supported + by the driver so that it can be autoloaded by the X server + + -- David Nusinow Thu, 13 Sep 2007 22:14:25 -0400 + +xserver-xorg-video-mga (1:1.4.7.dfsg.1-1) experimental; urgency=low + + * New upstream release. + + Increase the minimal frequency on G550 so that 320x240 works, + closes: #430112. + * Build against xserver 1.4. + * Add upstream URL to debian/copyright. + * Add myself to Uploaders, add remove Branden with his permission. + + -- Brice Goglin Thu, 13 Sep 2007 08:30:08 +0200 + +xserver-xorg-video-mga (1:1.4.6.1.dfsg.1-3) unstable; urgency=low + + [ Timo Aaltonen ] + * Replaces/Conflicts: xserver-xorg-driver-mga. + + [ Brice Goglin ] + * Don't build-dep on libdrm-dev on hurd-i386, thanks Michael Banck + (closes: #392874). + * Bump Build-Depends: xserver-xorg-dev to >= 2:1.2.99.902 + (needed to let xsfbs get access to serverminver). + * Add a link to www.X.org and a reference to the xf86-video-mga + module in the long description. + + -- Julien Cristau Sat, 19 May 2007 15:55:47 +0200 + +xserver-xorg-video-mga (1:1.4.6.1.dfsg.1-2) unstable; urgency=low + + * Build package non-native. + * Remove Fabio from uploaders, with his permission. + * Add XS-Vcs-*. + * Drop obsolete CVS information from the description. + * Install the upstream changelog. + * Upload to unstable. + + -- Julien Cristau Mon, 23 Apr 2007 06:25:20 +0200 + +xserver-xorg-video-mga (1:1.4.6.1.dfsg.1-1) experimental; urgency=low + + * New upstream release + * Remove obsolete patches 01_stupid_configure_error.diff and + 04-Bug-2168-Fix-graphics-corruptions-with-Mystique-rev-2.diff + * Generate server dependencies automatically from the ABI + + -- David Nusinow Wed, 21 Feb 2007 23:29:57 -0500 + +xserver-xorg-video-mga (1:1.4.4.dfsg.1-2) unstable; urgency=low + + [ Julien Cristau ] + * Add link to xserver-xorg-core bug script, so that bugreports contain + the user's config and log files. + * Bump dependency on xserver-xorg-core to >= 2:1.1.1-11, as previous + versions don't have the bug script. + * Steal patch from upstream git which should fix a graphics corruption with + Mystique rev2 cards (closes: #320328). + + -- David Nusinow Tue, 12 Dec 2006 21:10:04 -0500 + +xserver-xorg-video-mga (1:1.4.4.dfsg.1-1) unstable; urgency=low + + * New upstream release + + Fix some crasher bugs with DRI. Thanks Svante Signell. Closes: #395025 + * Remove manpage typos patch, which was accepted upstream + * Remove minumum clock patch + * Add 01_stupid_configure_error.diff + + -- David Nusinow Mon, 6 Nov 2006 23:53:51 -0500 + +xserver-xorg-video-mga (1:1.4.2.dfsg.1-1) unstable; urgency=low + + * New upstream release + + Fixes DRI locking issues. Thanks Sune Vuorela and Michel Dänzer. + Closes: #390287 + + -- David Nusinow Fri, 13 Oct 2006 17:31:27 -0400 + +xserver-xorg-video-mga (1:1.4.1.dfsg.1-4) unstable; urgency=low + + [ Steve Langasek ] + * Add missing build-dep on quilt. Closes: #388484. + + [ David Nusinow ] + * Manpage typo fixes. Thanks A. Costa. (closes: #364558) + * Update standards version to 3.7.2.0. No changes necessary. + + -- David Nusinow Thu, 21 Sep 2006 22:31:54 -0400 + +xserver-xorg-video-mga (1:1.4.1.dfsg.1-3) unstable; urgency=low + + [ Steve Langasek ] + * Upload to unstable + + -- David Nusinow Mon, 18 Sep 2006 19:57:41 -0400 + +xserver-xorg-video-mga (1:1.4.1.dfsg.1-2) experimental; urgency=low + + [ Drew Parsons ] + * Provides: xserver-xorg-video-1.0 not xserver-xorg-video. + + [ David Nusinow ] + * Bump xserver (build-)depends epochs to 2: to deal with botched + server upload + + -- David Nusinow Tue, 22 Aug 2006 23:46:33 +0000 + +xserver-xorg-video-mga (1:1.4.1.dfsg.1-1) experimental; urgency=low + + [ Andres Salomon ] + * Test for obj-$(DEB_BUILD_GNU_TYPE) before creating it during build; + idempotency fix. + * Run dh_install w/ --list-missing. + + [ David Nusinow ] + * New upstream release + * Bump dependency on xserver-xorg-core to >= 1:1.1.1. Do the same thing for + the build-dep on xserver-xorg-dev. + * Bump debhelper compat to 5 + * Remove obsolete patch 01_fix_matrox_display.diff + + -- David Nusinow Mon, 14 Aug 2006 23:20:38 +0000 + +xserver-xorg-video-mga (1:1.2.1.3.dfsg.1-2) unstable; urgency=low + + * Upload to modular + + -- David Nusinow Sun, 26 Mar 2006 20:25:42 -0500 + +xserver-xorg-video-mga (1:1.2.1.3.dfsg.1-1) experimental; urgency=low + + * Remove non-free mga_ucode.h and add it to the prune list. Add + 03_no_nonfree.diff to cope with its removal and autoreconf. + + -- David Nusinow Sun, 12 Mar 2006 13:35:30 -0500 + +xserver-xorg-video-mga (1:1.2.1.3-2) experimental; urgency=low + + * Port patches from trunk: + + general/032_fix_matrox_display.diff + + general/099m_mga_increase_minimum_pixel_clock.diff + + -- David Nusinow Sun, 26 Feb 2006 17:28:53 -0500 + +xserver-xorg-video-mga (1:1.2.1.3-1) experimental; urgency=low + + * First upload to Debian + * Change source package, package, and provides names to denote the + type of driver and that they are for xserver-xorg + + -- David Nusinow Fri, 13 Jan 2006 00:38:10 -0500 + +xserver-xorg-driver-mga (1:1.2.1.3-0ubuntu1) dapper; urgency=low + + * New upstream release. + * Add provides on xserver-xorg-driver. + + -- Daniel Stone Wed, 4 Jan 2006 19:58:26 +1100 + +xserver-xorg-driver-mga (1:1.2.1.2-0ubuntu1) dapper; urgency=low + + * New upstream release. + + -- Daniel Stone Mon, 19 Dec 2005 09:07:03 +1100 + +xserver-xorg-driver-mga (1:1.2.1.1-0ubuntu1) dapper; urgency=low + + * New upstream release. + * Bump Build-Depends on libdrm-dev to >> 2.0. + + -- Daniel Stone Mon, 12 Dec 2005 13:24:20 +1100 + +xserver-xorg-driver-mga (1:1.2.1-0ubuntu2) dapper; urgency=low + + * Add missing Build-Depends (x11proto-core-dev, x11proto-fonts-dev, + x11proto-randr-dev, x11proto-render-dev, x11proto-xext-dev, libdrm + (>> 1.0.5), x11proto-xf86dri-dev). + + -- Daniel Stone Mon, 5 Dec 2005 12:54:39 +1100 + +xserver-xorg-driver-mga (1:1.2.1-0ubuntu1) dapper; urgency=low + + * New upstream release. + + -- Daniel Stone Tue, 22 Nov 2005 13:31:50 +1100 + +xserver-xorg-driver-mga (1:1.2.0.1-1) dapper; urgency=low + + * New upstream version. + + -- Daniel Stone Tue, 25 Oct 2005 18:26:55 +1000 + +xserver-xorg-driver-mga (1:1.1.2-1) breezy; urgency=low + + * First xserver-xorg-driver-mga release. + + -- Daniel Stone Wed, 6 Jul 2005 15:48:17 +1000 --- xserver-xorg-video-mga-1.4.13.dfsg.orig/debian/xserver-xorg-video-mga.install +++ xserver-xorg-video-mga-1.4.13.dfsg/debian/xserver-xorg-video-mga.install @@ -0,0 +1,2 @@ +usr/lib/xorg/modules/drivers/*.so +usr/share/man/man4/* --- xserver-xorg-video-mga-1.4.13.dfsg.orig/debian/xserver-xorg-video-mga.links +++ xserver-xorg-video-mga-1.4.13.dfsg/debian/xserver-xorg-video-mga.links @@ -0,0 +1 @@ +usr/share/bug/xserver-xorg-core/script usr/share/bug/xserver-xorg-video-mga/script --- xserver-xorg-video-mga-1.4.13.dfsg.orig/debian/xsfbs/repack.sh +++ xserver-xorg-video-mga-1.4.13.dfsg/debian/xsfbs/repack.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +set -e + +if ! [ -d debian/prune ]; then + exit 0 +fi + +if [ "x$1" != x--upstream-version ]; then + exit 1 +fi + +version="$2" +filename="$3" + +if [ -z "$version" ] || ! [ -f "$filename" ]; then + exit 1 +fi + +dir="$(pwd)" +tempdir="$(mktemp -d)" + +cd "$tempdir" +tar xf "$dir/$filename" +cat "$dir"/debian/prune/* | while read file; do rm -f */$file; done + +tar czf "$dir/$filename" * +cd "$dir" +rm -rf "$tempdir" +echo "Done pruning upstream tarball" + +exit 0 --- xserver-xorg-video-mga-1.4.13.dfsg.orig/debian/prune/non-free +++ xserver-xorg-video-mga-1.4.13.dfsg/debian/prune/non-free @@ -0,0 +1 @@ +src/mga_ucode.h --- xserver-xorg-video-mga-1.4.13.dfsg.orig/debian/patches/series +++ xserver-xorg-video-mga-1.4.13.dfsg/debian/patches/series @@ -0,0 +1,2 @@ +01_no_nonfree.diff +02_tentatively_unbreak_dual_head.diff --- xserver-xorg-video-mga-1.4.13.dfsg.orig/debian/patches/02_tentatively_unbreak_dual_head.diff +++ xserver-xorg-video-mga-1.4.13.dfsg/debian/patches/02_tentatively_unbreak_dual_head.diff @@ -0,0 +1,175 @@ +From: Cyril Brulebois +Patch-By: Andy MacLean +Patch-Name: mga-driver-3.patch +Patch-URL: https://bugs.launchpad.net/ubuntu/+source/xserver-xorg-video-mga/+bug/292214 +--- a/src/mga.h ++++ b/src/mga.h +@@ -337,6 +337,13 @@ typedef struct { + int mastervideoRam; + int slavevideoRam; + Bool directRenderingEnabled; ++ ++ void * mappedIOBase; ++ int mappedIOUsage; ++ ++ void * mappedILOADBase; ++ int mappedILOADUsage; ++ + ScrnInfoPtr pScrn_1; + ScrnInfoPtr pScrn_2; + } MGAEntRec, *MGAEntPtr; +--- a/src/mga_driver.c ++++ b/src/mga_driver.c +@@ -2820,30 +2820,55 @@ MGAMapMem(ScrnInfoPtr pScrn) + #ifdef XSERVER_LIBPCIACCESS + struct pci_device *const dev = pMga->PciInfo; + struct pci_mem_region *region; +- void **memory[2]; + int i, err; + #endif + + + if (!pMga->FBDev) { + #ifdef XSERVER_LIBPCIACCESS +- memory[pMga->io_bar] = &pMga->IOBase; +- memory[pMga->framebuffer_bar] = &pMga->FbBase; ++ pciaddr_t fbaddr = pMga->FbAddress; ++ pciaddr_t fbsize = pMga->FbMapSize; ++ err = pci_device_map_range(dev, ++ fbaddr, fbsize, ++ PCI_DEV_MAP_FLAG_WRITABLE, ++ (void **)&pMga->FbBase); + +- for (i = 0; i < 2; i++) { +- region = &dev->regions[i]; +- err = pci_device_map_range(dev, +- region->base_addr, region->size, +- PCI_DEV_MAP_FLAG_WRITABLE, +- memory[i]); ++ if (err) { ++ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, ++ "Unable to map Framebuffer %08llX %llx. %s (%d)\n", ++ (long long)fbaddr, (long long)fbsize, ++ strerror(err), err); ++ return FALSE; ++ } ++ else ++ xf86DrvMsg(pScrn->scrnIndex, X_INFO, ++ "MAPPED Framebuffer %08llX %llx to %08llX.\n", ++ (long long)fbaddr, (long long)fbsize, ++ (long long)pMga->FbBase); ++ ++ if(pMga->entityPrivate == NULL || pMga->entityPrivate->mappedIOUsage == 0) { ++ region = &dev->regions[pMga->io_bar]; ++ err = pci_device_map_range(dev, ++ region->base_addr, region->size, ++ PCI_DEV_MAP_FLAG_WRITABLE, ++ &pMga->IOBase); ++ ++ if (err) { ++ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, ++ "Unable to map IO Region %i. %s (%d)\n", ++ pMga->io_bar, strerror(err), err); ++ return FALSE; ++ } ++ ++ if(pMga->entityPrivate != NULL) ++ pMga->entityPrivate->mappedIOBase = pMga->IOBase; ++ } ++ else ++ pMga->IOBase = pMga->entityPrivate->mappedIOBase; ++ ++ if(pMga->entityPrivate != NULL) ++ pMga->entityPrivate->mappedIOUsage ++; + +- if (err) { +- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, +- "Unable to map BAR %i. %s (%d)\n", +- i, strerror(err), err); +- return FALSE; +- } +- } + #else + /* + * For Alpha, we need to map SPARSE memory, since we need +@@ -2885,16 +2910,27 @@ MGAMapMem(ScrnInfoPtr pScrn) + if (pMga->iload_bar != -1) { + #ifdef XSERVER_LIBPCIACCESS + region = &dev->regions[pMga->iload_bar]; +- err = pci_device_map_range(dev, +- region->base_addr, region->size, +- PCI_DEV_MAP_FLAG_WRITABLE, +- (void *) &pMga->ILOADBase); +- if (err) { +- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, +- "Unable to map BAR 2 (ILOAD region). %s (%d)\n", +- strerror(err), err); +- return FALSE; ++ ++ if(pMga->entityPrivate == NULL || pMga->entityPrivate->mappedILOADUsage == 0) { ++ err = pci_device_map_range(dev, ++ region->base_addr, region->size, ++ PCI_DEV_MAP_FLAG_WRITABLE, ++ (void *) &pMga->ILOADBase); ++ if (err) { ++ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, ++ "Unable to map BAR 2 (ILOAD region). %s (%d)\n", ++ strerror(err), err); ++ return FALSE; ++ } ++ ++ if(pMga->entityPrivate != NULL) ++ pMga->entityPrivate->mappedILOADBase = pMga->ILOADBase; + } ++ else ++ pMga->ILOADBase = pMga->entityPrivate->mappedILOADBase; ++ ++ if(pMga->entityPrivate != NULL) ++ pMga->entityPrivate->mappedILOADUsage ++; + #else + pMga->ILOADBase = xf86MapPciMem(pScrn->scrnIndex, + VIDMEM_MMIO | VIDMEM_MMIO_32BIT | +@@ -2924,10 +2960,20 @@ MGAUnmapMem(ScrnInfoPtr pScrn) + + if (!pMga->FBDev) { + #ifdef XSERVER_LIBPCIACCESS +- pci_device_unmap_range(dev, pMga->IOBase, +- dev->regions[pMga->io_bar].size); ++ if(pMga->entityPrivate != NULL) ++ pMga->entityPrivate->mappedIOUsage--; ++ ++ if(pMga->entityPrivate == NULL || pMga->entityPrivate->mappedIOUsage == 0) { ++ pci_device_unmap_range(dev, pMga->IOBase, ++ dev->regions[pMga->io_bar].size); ++ ++ if(pMga->entityPrivate != NULL) ++ pMga->entityPrivate->mappedIOBase = NULL; ++ } ++ ++ xf86DrvMsg(pScrn->scrnIndex, X_INFO, "UNMAPPING framebuffer 0x%08llX, 0x%llX.\n", (long long)pMga->FbBase, (long long)pMga->FbMapSize); + pci_device_unmap_range(dev, pMga->FbBase, +- dev->regions[pMga->framebuffer_bar].size); ++ pMga->FbMapSize); + #else + xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pMga->IOBase, 0x4000); + xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pMga->FbBase, pMga->FbMapSize); +@@ -2940,8 +2986,17 @@ MGAUnmapMem(ScrnInfoPtr pScrn) + + if ((pMga->iload_bar != -1) && (pMga->ILOADBase != NULL)) { + #ifdef XSERVER_LIBPCIACCESS +- pci_device_unmap_range(dev, pMga->ILOADBase, +- dev->regions[pMga->iload_bar].size); ++ if(pMga->entityPrivate != NULL) ++ pMga->entityPrivate->mappedILOADUsage--; ++ ++ if(pMga->entityPrivate == NULL || pMga->entityPrivate->mappedILOADUsage == 0) { ++ pci_device_unmap_range(dev, pMga->ILOADBase, ++ dev->regions[pMga->iload_bar].size); ++ ++ if(pMga->entityPrivate != NULL) ++ pMga->entityPrivate->mappedILOADBase = NULL; ++ } ++ + #else + xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pMga->ILOADBase, 0x800000); + #endif --- xserver-xorg-video-mga-1.4.13.dfsg.orig/debian/patches/01_no_nonfree.diff +++ xserver-xorg-video-mga-1.4.13.dfsg/debian/patches/01_no_nonfree.diff @@ -0,0 +1,12 @@ +Index: xserver-xorg-video-mga/src/Makefile.am +=================================================================== +--- xserver-xorg-video-mga.orig/src/Makefile.am 2006-10-26 22:48:24.000000000 -0400 ++++ xserver-xorg-video-mga/src/Makefile.am 2006-11-06 23:40:03.000000000 -0500 +@@ -54,7 +54,6 @@ + mga_reg.h \ + mga_sarea.h \ + mga_shadow.c \ +- mga_ucode.h \ + mga_vga.c \ + mga_video.c + --- xserver-xorg-video-mga-1.4.13.dfsg.orig/util/stormdwg.c +++ xserver-xorg-video-mga-1.4.13.dfsg/util/stormdwg.c @@ -1,8 +1,3 @@ -/* $XConsortium: dwg.c /main/2 1996/10/28 06:57:55 kaleb $ */ - - - -/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/mga/util/stormdwg.c,v 1.1 1997/04/12 14:11:29 hohndel Exp $ */ #include #include --- xserver-xorg-video-mga-1.4.13.dfsg.orig/man/mga.man +++ xserver-xorg-video-mga-1.4.13.dfsg/man/mga.man @@ -1,4 +1,3 @@ -.\" $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__ --- xserver-xorg-video-mga-1.4.13.dfsg.orig/man/Makefile.am +++ xserver-xorg-video-mga-1.4.13.dfsg/man/Makefile.am @@ -1,5 +1,5 @@ # -# Copyright 2005 Sun Microsystems, Inc. All rights reserved. +# Copyright (c) 2005, Oracle and/or its affiliates. All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the "Software"), @@ -19,7 +19,7 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. -# +# drivermandir = $(DRIVER_MAN_DIR)