[xf86-video-apm,4/4] Use libpciaccess for newer X Servers when unmapping video RAM

Submitted by Kevin Brace on Dec. 17, 2018, 10 p.m.

Details

Message ID 1545084036-32413-4-git-send-email-kevinbrace@gmx.com
State New
Series "Series without cover letter"
Headers show

Commit Message

Kevin Brace Dec. 17, 2018, 10 p.m.
Commit d1e29902483a82e86b07cd30d41d411e71b776ea missed using
XSERVER_LIBPCIACCESS conditional compilation keyword when unmapping
video RAM. This meant that the code was not getting compiled correctly
for newer X Servers due to the missing xf86UnMapVidMem.

Signed-off-by: Kevin Brace <kevinbrace@gmx.com>
---
 src/apm_driver.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/apm_driver.c b/src/apm_driver.c
index 4be81de..3c41b1c 100644
--- a/src/apm_driver.c
+++ b/src/apm_driver.c
@@ -752,7 +752,11 @@  ApmPreInit(ScrnInfoPtr pScrn, int flags)
 	LinMap[0xFFECDB] = db;
 	LinMap[0xFFECD9] = d9;
 	/*pciWriteLong(pApm->PciTag, PCI_CMD_STAT_REG, save);*/
+#ifndef XSERVER_LIBPCIACCESS
 	xf86UnMapVidMem(pScrn->scrnIndex, (pointer)LinMap, pApm->LinMapSize);
+#else
+	pci_device_unmap_range(pApm->PciInfo, (pointer)LinMap, pApm->LinMapSize);
+#endif
 	from = X_PROBED;
     }
     else {
@@ -1135,11 +1139,19 @@  ApmUnmapMem(ScrnInfoPtr pScrn)
 	    WRXB(0xDB, pApm->db);
 	}
 	WRXB(0xC9, pApm->c9);
+#ifndef XSERVER_LIBPCIACCESS
 	xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pApm->LinMap, pApm->LinMapSize);
+#else
+	pci_device_unmap_range(pApm->PciInfo, (pointer)pApm->LinMap, pApm->LinMapSize);
+#endif
 	pApm->LinMap = NULL;
     }
     else if (pApm->FbBase)
+#ifndef XSERVER_LIBPCIACCESS
 	xf86UnMapVidMem(pScrn->scrnIndex, (pointer)pApm->LinMap, 0x10000);
+#else
+	pci_device_unmap_range(pApm->PciInfo, (pointer)pApm->LinMap, 0x10000);
+#endif
 
     return TRUE;
 }