[PATCH:xf86-video-xgi] Add missing check for libpciaccess
Connor Behan
connor.behan at gmail.com
Mon Aug 10 12:11:23 PDT 2015
The code for finding the BIOS forgets to provide both map / unmap
methods.
Signed-off-by: Connor Behan <connor.behan at gmail.com>
---
src/xgi_driver.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/xgi_driver.c b/src/xgi_driver.c
index 5380ab2..ad8fca6 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;
}
--
2.4.5
More information about the xorg-devel
mailing list