summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2014-09-30 10:21:58 -0400
committerAdam Jackson <ajax@redhat.com>2014-09-30 10:21:58 -0400
commit30a4b73644ee22904824d4847e44ca69369fad02 (patch)
tree6dd906f4bb1d2398e83df69245aa16a60cc0ba38
parent3a3ee1c45e54a808947cc26ca11f0a5299571053 (diff)
Fix build against xserver 1.17
Also port from pci_device_map_region to pci_device_map_range. Somewhat alarming that the previous code was using map_region but unmap_range... Signed-off-by: Adam Jackson <ajax@redhat.com>
-rw-r--r--src/rendition.c20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/rendition.c b/src/rendition.c
index 888bb4a..9677850 100644
--- a/src/rendition.c
+++ b/src/rendition.c
@@ -1371,6 +1371,18 @@ renditionMapMem(ScrnInfoPtr pScreenInfo)
/* Override on users request */
WriteCombine
= xf86ReturnOptValBool(pRendition->Options, OPTION_FBWC, WriteCombine);
+#ifdef XSERVER_LIBPCIACCESS
+ mapOption = PCI_DEV_MAP_FLAG_WRITABLE;
+ if (WriteCombine)
+ mapOption |= PCI_DEV_MAP_FLAG_WRITE_COMBINE;
+
+ err = pci_device_map_range(pRendition->PciInfo,
+ pRendition->PciInfo->regions[0].base_addr,
+ pRendition->PciInfo->regions[0].size,
+ mapOption, (void *)&pRendition->board.vmem_base);
+
+ return (err == 0);
+#else
if (WriteCombine) {
xf86DrvMsg(pScreenInfo->scrnIndex, X_CONFIG,
("Requesting Write-Combined memory access\n"));
@@ -1381,12 +1393,6 @@ renditionMapMem(ScrnInfoPtr pScreenInfo)
mapOption = VIDMEM_MMIO;
}
-#ifdef XSERVER_LIBPCIACCESS
- err = pci_device_map_region(pRendition->PciInfo, 0, TRUE);
- pRendition->board.vmem_base = pRendition->PciInfo->regions[0].memory;
-
- return (err == 0);
-#else
pRendition->board.vmem_base=
xf86MapPciMem(pScreenInfo->scrnIndex, mapOption,
pRendition->pcitag,
@@ -1415,7 +1421,7 @@ renditionUnmapMem(ScrnInfoPtr pScreenInfo)
#else
pci_device_unmap_range(pRendition->PciInfo,
pRendition->board.vmem_base,
- pScreenInfo->videoRam * 1024);
+ pRendition->PciInfo->regions[0].size);
#endif
return TRUE;
#ifdef DEBUG0