diff options
author | Mark Kettenis <mark.kettenis@xs4all.nl> | 2009-05-04 21:54:30 +0200 |
---|---|---|
committer | Matthieu Herrb <matthieu.herrb@laas.fr> | 2009-05-04 21:57:20 +0200 |
commit | cee4cdf061ca8e6376846c0eac2fc6d57711129e (patch) | |
tree | 56defae6d588ca585debe5e0bfe536fe563c726c | |
parent | 8bd4dc99bbaa8bf8c6649dc25fc75859e16e35ec (diff) |
Properly unmap things with libpciaccess.
If the xf86-vide-i128 is compiled with XSERVER_LIBPCIACCESS, registers and
frmaebuffer memory are mapped through libpciaccess. However, I128UnmapMem
tried to unmap things vy using xf86UnmapVidMem. This failed because the memory
wasn't registered (which only happens if you mapped the memory using
xf86MapPciMem.
Fixes bugzilla #20541
Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
-rw-r--r-- | src/i128_driver.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/i128_driver.c b/src/i128_driver.c index 72a69e7..0c80ce4 100644 --- a/src/i128_driver.c +++ b/src/i128_driver.c @@ -1442,12 +1442,21 @@ I128UnmapMem(ScrnInfoPtr pScrn) /* * Unmap IO registers to virtual address space */ +#ifndef XSERVER_LIBPCIACCESS xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pI128->mem.mw0_ad, pI128->MemorySize*1024); +#else + pci_device_unmap_range(pI128->PciInfo, pI128->mem.mw0_ad, + pI128->MemorySize*1024); +#endif pI128->mem.mw0_ad = NULL; pI128->MemoryPtr = NULL; +#ifndef XSERVER_LIBPCIACCESS xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pI128->mem.rbase_g, 64*1024); +#else + pci_device_unmap_range(pI128->PciInfo, pI128->mem.rbase_g, 64*1024); +#endif pI128->mem.rbase_g = NULL; pI128->mem.rbase_w = NULL; pI128->mem.rbase_a = NULL; |