summaryrefslogtreecommitdiff
path: root/src/atividmem.c
diff options
context:
space:
mode:
authorYi Zhan <yi.zhan@intel.com>2008-03-26 16:13:08 +1000
committerDave Airlie <airlied@clockrh9.(none)>2008-03-26 16:13:08 +1000
commit89a9ad75f3e50e25275b803617d5e74709ead269 (patch)
tree16af7e06700dac18b649cf0daa291fcc911ab5e2 /src/atividmem.c
parent6127349c9625ae3b50c40fd3641847be3ca18795 (diff)
mach64: on IA64 systems the pciaccess page size mapping was getting E2BIGxf86-video-mach64-6.8.0
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
Diffstat (limited to 'src/atividmem.c')
-rw-r--r--src/atividmem.c20
1 files changed, 15 insertions, 5 deletions
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)
{