xf86-video-ati: Branch 'master'

Dave Airlie airlied at kemper.freedesktop.org
Tue Mar 25 23:27:42 PDT 2008


 src/atividmem.c |   20 +++++++++++++++-----
 1 file changed, 15 insertions(+), 5 deletions(-)

New commits:
commit 89a9ad75f3e50e25275b803617d5e74709ead269
Author: Yi Zhan <yi.zhan at intel.com>
Date:   Wed Mar 26 16:13:08 2008 +1000

    mach64: on IA64 systems the pciaccess page size mapping was getting E2BIG
    
    As the ia64 pagesize was 16k, and aperture was only 4k, this was messing up
    on ia64 machines.
    
    Modified fix from RH BZ 438947 - airlied

diff --git a/src/atividmem.c b/src/atividmem.c
index 986ac0f..8950f84 100644
--- a/src/atividmem.c
+++ b/src/atividmem.c
@@ -146,7 +146,12 @@ ATIUnmapMMIO
 #ifndef XSERVER_LIBPCIACCESS
         xf86UnMapVidMem(iScreen, pATI->pMMIO, getpagesize());
 #else
-        pci_device_unmap_range(pATI->PCIInfo, pATI->pMMIO, getpagesize());
+        unsigned long size;
+
+        size = PCI_REGION_SIZE(pATI->PCIInfo, 2);
+        if (!size || size > getpagesize())
+                size = getpagesize();
+        pci_device_unmap_range(pATI->PCIInfo, pATI->pMMIO, size);
 #endif
     }
 
@@ -340,10 +345,15 @@ ATIMapApertures
 
         int mode = PCI_DEV_MAP_FLAG_WRITABLE;
 
-        int err = pci_device_map_range(pVideo,
-                                       MMIOBase,
-                                       PageSize,
-                                       mode, &pATI->pMMIO);
+        int err;
+        int size;
+
+        size = PCI_REGION_SIZE(pVideo, 2);
+        if (!size || size > PageSize)
+               size = PageSize;
+
+	err = pci_device_map_range(pVideo, MMIOBase,
+                                   size, mode, &pATI->pMMIO);
 
         if (err)
         {


More information about the xorg-commit mailing list