Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 189678 Details for
Bug 265100
x11-drivers/xf86-video-mga-1.4.9: dualhead bug
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch to fix problem wih dualhead
dualhead-fix.patch (text/plain), 5.79 KB, created by
Axel Mueller
on 2009-04-28 06:14:05 UTC
(
hide
)
Description:
patch to fix problem wih dualhead
Filename:
MIME Type:
Creator:
Axel Mueller
Created:
2009-04-28 06:14:05 UTC
Size:
5.79 KB
patch
obsolete
>diff -urN old-src/mga_driver.c src/mga_driver.c >--- old-src/mga_driver.c 2008-11-13 15:11:35.000000000 +0000 >+++ src/mga_driver.c 2008-11-13 15:17:24.000000000 +0000 >@@ -1454,6 +1454,10 @@ > xf86PrintEDID(MonInfo); > xf86DrvMsg(pScrn->scrnIndex, X_INFO, "end of I2C Monitor info\n"); > xf86SetDDCproperties(pScrn, MonInfo); >+ >+ MGARestore(pScrn); >+ MGAUnmapMem(pScrn); >+ > return MonInfo; > } > >@@ -2990,30 +2994,57 @@ > #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; > >- 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]); >+ 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); > >- if (err) { >+ if (err) { > xf86DrvMsg(pScrn->scrnIndex, X_ERROR, >- "Unable to map BAR %i. %s (%d)\n", >- i, strerror(err), err); >+ "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 ++; >+ > #else > /* > * For Alpha, we need to map SPARSE memory, since we need >@@ -3055,16 +3086,28 @@ > if (pMga->iload_bar != -1) { > #ifdef XSERVER_LIBPCIACCESS > region = &dev->regions[pMga->iload_bar]; >- err = pci_device_map_range(dev, >+ >+ 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 (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 | >@@ -3094,10 +3137,21 @@ > > 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); >@@ -3110,8 +3164,18 @@ > > if ((pMga->iload_bar != -1) && (pMga->ILOADBase != NULL)) { > #ifdef XSERVER_LIBPCIACCESS >- pci_device_unmap_range(dev, pMga->ILOADBase, >+ 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 >diff -urN old-src/mga.h src/mga.h >--- old-src/mga.h 2008-11-13 15:11:35.000000000 +0000 >+++ src/mga.h 2008-11-13 15:17:13.000000000 +0000 >@@ -333,6 +333,13 @@ > int mastervideoRam; > int slavevideoRam; > Bool directRenderingEnabled; >+ >+ void * mappedIOBase; >+ int mappedIOUsage; >+ >+ void * mappedILOADBase; >+ int mappedILOADUsage; >+ > ScrnInfoPtr pScrn_1; > ScrnInfoPtr pScrn_2; > } MGAEntRec, *MGAEntPtr;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 265100
:
189677
| 189678