diff options
author | Florent Thoumie <flz@FreeBSD.org> | 2008-01-02 13:23:51 +0000 |
---|---|---|
committer | Florent Thoumie <flz@FreeBSD.org> | 2008-01-02 13:23:51 +0000 |
commit | 6d246b980f6c9eb32d0a1a3656cba6aaaea41789 (patch) | |
tree | a3172aaeac67258ecc77f644a3523515c011229e /x11-drivers/xf86-video-mga | |
parent | 2dc03f7358a0b9c07d6652f292ffc9c8a23608b8 (diff) | |
download | ports-6d246b980f6c9eb32d0a1a3656cba6aaaea41789.tar.gz ports-6d246b980f6c9eb32d0a1a3656cba6aaaea41789.zip |
Notes
Diffstat (limited to 'x11-drivers/xf86-video-mga')
-rw-r--r-- | x11-drivers/xf86-video-mga/Makefile | 3 | ||||
-rw-r--r-- | x11-drivers/xf86-video-mga/distinfo | 6 | ||||
-rw-r--r-- | x11-drivers/xf86-video-mga/files/patch-1.4.7-master-20080102 | 151 |
3 files changed, 156 insertions, 4 deletions
diff --git a/x11-drivers/xf86-video-mga/Makefile b/x11-drivers/xf86-video-mga/Makefile index aabc4cb9762e..722ef60f7ffb 100644 --- a/x11-drivers/xf86-video-mga/Makefile +++ b/x11-drivers/xf86-video-mga/Makefile @@ -6,7 +6,8 @@ # PORTNAME= xf86-video-mga -PORTVERSION= 1.9.100 +PORTVERSION= 1.4.7 +PORTEPOCH= 1 CATEGORIES= x11-drivers MAINTAINER= x11@FreeBSD.org diff --git a/x11-drivers/xf86-video-mga/distinfo b/x11-drivers/xf86-video-mga/distinfo index 7dd87686dccd..76b33640feaa 100644 --- a/x11-drivers/xf86-video-mga/distinfo +++ b/x11-drivers/xf86-video-mga/distinfo @@ -1,3 +1,3 @@ -MD5 (xorg/driver/xf86-video-mga-1.9.100.tar.bz2) = 3e80cfb84b62866d2f94774ecbf3e46c -SHA256 (xorg/driver/xf86-video-mga-1.9.100.tar.bz2) = e8efee8d5269eb29f9bd499db3d47a6a4d3c320d4b0a24874cdf7b598ad77a5c -SIZE (xorg/driver/xf86-video-mga-1.9.100.tar.bz2) = 369119 +MD5 (xorg/driver/xf86-video-mga-1.4.7.tar.bz2) = a7f0857a1d7fa0f615bd18515775d2af +SHA256 (xorg/driver/xf86-video-mga-1.4.7.tar.bz2) = a1c3a91f3d5f17ffc21fdb5ed3c1bcc953ab6602fbfaae2954ae7bd5e9ee5952 +SIZE (xorg/driver/xf86-video-mga-1.4.7.tar.bz2) = 389212 diff --git a/x11-drivers/xf86-video-mga/files/patch-1.4.7-master-20080102 b/x11-drivers/xf86-video-mga/files/patch-1.4.7-master-20080102 new file mode 100644 index 000000000000..760a262e81a1 --- /dev/null +++ b/x11-drivers/xf86-video-mga/files/patch-1.4.7-master-20080102 @@ -0,0 +1,151 @@ +diff --git src/mga_driver.c src/mga_driver.c +index d9b786f..be26e89 100644 +--- src/mga_driver.c ++++ src/mga_driver.c +@@ -2775,30 +2775,31 @@ MGAMapMem(ScrnInfoPtr pScrn) + MGAPtr pMga = MGAPTR(pScrn); + #ifdef XSERVER_LIBPCIACCESS + struct pci_device *const dev = pMga->PciInfo; +- int err; ++ struct pci_mem_region *region; ++ void **memory[2]; ++ int i, err; + #endif + + + if (!pMga->FBDev) { + #ifdef XSERVER_LIBPCIACCESS +- err = pci_device_map_region(dev, 0, TRUE); +- if (err) { +- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, +- "Unable to map BAR 0. %s (%d)\n", +- strerror(err), err); +- return FALSE; +- } ++ memory[pMga->io_bar] = &pMga->IOBase; ++ memory[pMga->framebuffer_bar] = &pMga->FbBase; + +- err = pci_device_map_region(dev, 1, TRUE); +- if (err) { +- xf86DrvMsg(pScrn->scrnIndex, X_ERROR, +- "Unable to map BAR 1. %s (%d)\n", +- strerror(err), err); +- return FALSE; +- } ++ 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]); + +- pMga->IOBase = dev->regions[ pMga->io_bar ].memory; +- pMga->FbBase = dev->regions[ pMga->framebuffer_bar ].memory; ++ 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 +@@ -2839,15 +2840,17 @@ MGAMapMem(ScrnInfoPtr pScrn) + pMga->ILOADBase = NULL; + if (pMga->iload_bar != -1) { + #ifdef XSERVER_LIBPCIACCESS +- err = pci_device_map_region(dev, pMga->iload_bar, TRUE); ++ 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; + } +- +- pMga->ILOADBase = dev->regions[pMga->iload_bar].memory; + #else + pMga->ILOADBase = xf86MapPciMem(pScrn->scrnIndex, + VIDMEM_MMIO | VIDMEM_MMIO_32BIT | +@@ -2877,8 +2880,10 @@ MGAUnmapMem(ScrnInfoPtr pScrn) + + if (!pMga->FBDev) { + #ifdef XSERVER_LIBPCIACCESS +- pci_device_unmap_region(dev, 0); +- pci_device_unmap_region(dev, 1); ++ pci_device_unmap_range(dev, pMga->IOBase, ++ dev->regions[pMga->io_bar].size); ++ pci_device_unmap_range(dev, pMga->FbBase, ++ dev->regions[pMga->framebuffer_bar].size); + #else + xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pMga->IOBase, 0x4000); + xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pMga->FbBase, pMga->FbMapSize); +@@ -2889,15 +2894,10 @@ MGAUnmapMem(ScrnInfoPtr pScrn) + fbdevHWUnmapMMIO(pScrn); + } + +- if ((pMga->iload_bar != -1) ++ if ((pMga->iload_bar != -1) && (pMga->ILOADBase != NULL)) { + #ifdef XSERVER_LIBPCIACCESS +- && (dev->regions[pMga->iload_bar].memory != NULL) +-#else +- && (pMga->ILOADBase != NULL) +-#endif +- ) { +-#ifdef XSERVER_LIBPCIACCESS +- pci_device_unmap_region(dev, pMga->iload_bar); ++ pci_device_unmap_range(dev, pMga->ILOADBase, ++ dev->regions[pMga->iload_bar].size); + #else + xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pMga->ILOADBase, 0x800000); + #endif +@@ -4286,6 +4286,13 @@ MGAValidMode(int scrnIndex, DisplayModePtr mode, Bool verbose, int flags) + ScrnInfoPtr pScrn = xf86Screens[scrnIndex]; + 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; ++ } ++ + lace = 1 + ((mode->Flags & V_INTERLACE) != 0); + + if ((mode->CrtcHDisplay <= 2048) && +diff --git src/mga_exa.c src/mga_exa.c +index bfb78e7..9321452 100644 +--- src/mga_exa.c ++++ src/mga_exa.c +@@ -758,6 +758,7 @@ mgaWaitMarker(ScreenPtr pScreen, int marker) + while (INREG (MGAREG_Status) & 0x10000); + } + ++#ifdef XF86DRI + static void + init_dri(ScrnInfoPtr pScrn) + { +@@ -831,6 +832,7 @@ init_dri(ScrnInfoPtr pScrn) + MGA_BUFFER_ALIGN) & ~MGA_BUFFER_ALIGN; + dri->backPitch = widthBytes; + } ++#endif /* XF86DRI */ + + Bool + mgaExaInit(ScreenPtr pScreen) +@@ -891,8 +893,10 @@ mgaExaInit(ScreenPtr pScreen) + pExa->UploadToScreen = mgaUploadToScreen; + pExa->DownloadFromScreen = mgaDownloadFromScreen; + ++#ifdef XF86DRI + if (pMga->directRenderingEnabled) + init_dri(pScrn); ++#endif + + return exaDriverInit(pScreen, pExa); + } |