summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConnor Behan <connor.behan@gmail.com>2015-08-10 15:01:44 -0400
committerConnor Behan <connor.behan@gmail.com>2015-08-17 18:57:20 -0400
commitcf9c4f1a851ff930492d5864bc1cc0079c601518 (patch)
treeff3e6e4d81360f5d134cc57efefa71a2cd51a92a
parentb2f8aeb64004c6c280cf291e1af217607a862028 (diff)
Add missing check for libpciaccess
The code for finding the BIOS forgets to provide both map / unmap methods. Signed-off-by: Connor Behan <connor.behan@gmail.com>
-rwxr-xr-xsrc/xgi_driver.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/xgi_driver.c b/src/xgi_driver.c
index 5380ab2..21468d2 100755
--- a/src/xgi_driver.c
+++ b/src/xgi_driver.c
@@ -6575,7 +6575,11 @@ XGI_GetSetBIOSScratch(ScrnInfoPtr pScrn, USHORT offset, unsigned char value)
#if (defined(i386) || defined(__i386) || defined(__i386__) || defined(__AMD64__))
unsigned char *base;
+#ifdef XSERVER_LIBPCIACCESS
+ pci_device_map_legacy(XGIPTR(pScrn)->PciInfo, 0, 0x2000, 1, (void**)&base);
+#else
base = xf86MapVidMem(pScrn->scrnIndex, VIDMEM_MMIO, 0, 0x2000);
+#endif
if (!base) {
XGIErrorLog(pScrn, "(Could not map BIOS scratch area)\n");
return 0;
@@ -6587,8 +6591,12 @@ XGI_GetSetBIOSScratch(ScrnInfoPtr pScrn, USHORT offset, unsigned char value)
if (value != 0xff)
*(base + offset) = value;
+#ifdef XSERVER_LIBPCIACCESS
+ pci_device_unmap_legacy(XGIPTR(pScrn)->PciInfo, (void*)base, 0x2000);
+#else
xf86UnMapVidMem(pScrn->scrnIndex, base, 0x2000);
#endif
+#endif
return ret;
}