mirror of
https://github.com/X11Libre/xf86-video-sis.git
synced 2026-03-24 01:25:01 +00:00
switch vga over to pciaccess
This commit is contained in:
committed by
Dave Airlie
parent
585e03e687
commit
0e4dc89b7f
@@ -1717,8 +1717,17 @@ SiSVGAMapMem(ScrnInfoPtr pScrn)
|
||||
if(pSiS->VGAMapPhys == 0) pSiS->VGAMapPhys = 0xA0000;
|
||||
|
||||
#if XF86_VERSION_CURRENT >= XF86_VERSION_NUMERIC(4,3,0,0,0)
|
||||
#if XSERVER_LIBPCIACCESS
|
||||
/* XXX This is cacheable, right? Right? */
|
||||
if(pci_device_map_range(pSiS->PciInfo, pSiS->VGAMapPhys, pSiS->VGAMapSize,
|
||||
PCI_DEV_MAP_FLAG_WRITABLE|PCI_DEV_MAP_FLAG_CACHABLE,
|
||||
&pSiS->VGAMemBase)) {
|
||||
return FALSE;
|
||||
}
|
||||
#else
|
||||
pSiS->VGAMemBase = xf86MapDomainMemory(pScrn->scrnIndex, VIDMEM_MMIO_32BIT,
|
||||
pSiS->PciTag, pSiS->VGAMapPhys, pSiS->VGAMapSize);
|
||||
#endif
|
||||
#else
|
||||
pSiS->VGAMemBase = xf86MapVidMem(pScrn->scrnIndex, VIDMEM_MMIO_32BIT,
|
||||
pSiS->VGAMapPhys, pSiS->VGAMapSize);
|
||||
@@ -1733,8 +1742,11 @@ SiSVGAUnmapMem(ScrnInfoPtr pScrn)
|
||||
SISPtr pSiS = SISPTR(pScrn);
|
||||
|
||||
if(pSiS->VGAMemBase == NULL) return;
|
||||
|
||||
#if XSERVER_LIBPCIACCESS
|
||||
pci_device_unmap_range(pSiS->PciInfo, pSiS->VGAMemBase, pSiS->VGAMapSize);
|
||||
#else
|
||||
xf86UnMapVidMem(pScrn->scrnIndex, pSiS->VGAMemBase, pSiS->VGAMapSize);
|
||||
#endif
|
||||
pSiS->VGAMemBase = NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user