diff options
author | Adam Jackson <ajax@redhat.com> | 2011-05-10 19:00:02 -0400 |
---|---|---|
committer | Jeremy Huddleston <jeremyhu@apple.com> | 2011-10-15 21:18:46 -0700 |
commit | 342f3eac8460fc48cfad1f1d7be939d671e6e1cd (patch) | |
tree | f3bf462ab1399ec651997a09ee8374f64f10858b | |
parent | 7757b8092474c4f4ec04f4ebd1272236416154c3 (diff) |
int10: Port internal users off xf86MapVidMem
This API is apparently semi-deprecated even by XFree86 standards, and
there are only four drivers left using it. Let's start chopping it off.
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
-rw-r--r-- | hw/xfree86/int10/generic.c | 4 | ||||
-rw-r--r-- | hw/xfree86/int10/helper_exec.c | 14 |
2 files changed, 11 insertions, 7 deletions
diff --git a/hw/xfree86/int10/generic.c b/hw/xfree86/int10/generic.c index 53cd52567..fbc9b8507 100644 --- a/hw/xfree86/int10/generic.c +++ b/hw/xfree86/int10/generic.c @@ -103,8 +103,8 @@ xf86ExtendedInitInt10(int entityIndex, int Flags) MapVRam(pInt); #ifdef _PC if (!sysMem) - sysMem = xf86MapVidMem(screen, VIDMEM_MMIO, V_BIOS, - BIOS_SIZE + SYS_BIOS - V_BIOS); + pci_device_map_legacy(pInt->dev, V_BIOS, BIOS_SIZE + SYS_BIOS - V_BIOS, + PCI_DEV_MAP_FLAG_WRITABLE, &sysMem); INTPriv(pInt)->sysMem = sysMem; if (xf86ReadBIOS(0, 0, base, LOW_PAGE_SIZE) < 0) { diff --git a/hw/xfree86/int10/helper_exec.c b/hw/xfree86/int10/helper_exec.c index f74da4787..638f5668b 100644 --- a/hw/xfree86/int10/helper_exec.c +++ b/hw/xfree86/int10/helper_exec.c @@ -680,10 +680,12 @@ static void SetResetBIOSVars(xf86Int10InfoPtr pInt, Bool set) { int pagesize = getpagesize(); - unsigned char* base = xf86MapVidMem(pInt->scrnIndex, - VIDMEM_MMIO, 0, pagesize); + unsigned char* base; int i; + if (pci_device_map_legacy(pInt->dev, 0, pagesize, PCI_DEV_MAP_FLAG_WRITABLE, (void **)&base)) + return; /* eek */ + if (set) { for (i = BIOS_SCRATCH_OFF; i < BIOS_SCRATCH_END; i++) MEM_WW(pInt, i, *(base + i)); @@ -692,7 +694,7 @@ SetResetBIOSVars(xf86Int10InfoPtr pInt, Bool set) *(base + i) = MEM_RW(pInt, i); } - xf86UnMapVidMem(pInt->scrnIndex,base,pagesize); + pci_device_unmap_legacy(pInt->dev, base, pagesize); } void @@ -706,7 +708,9 @@ xf86Int10SaveRestoreBIOSVars(xf86Int10InfoPtr pInt, Bool save) || (!save && !pInt->BIOSScratch)) return; - base = xf86MapVidMem(pInt->scrnIndex, VIDMEM_MMIO, 0, pagesize); + if (pci_device_map_legacy(pInt->dev, 0, pagesize, PCI_DEV_MAP_FLAG_WRITABLE, (void **)&base)) + return; /* eek */ + base += BIOS_SCRATCH_OFF; if (save) { if ((pInt->BIOSScratch @@ -722,7 +726,7 @@ xf86Int10SaveRestoreBIOSVars(xf86Int10InfoPtr pInt, Bool save) } } - xf86UnMapVidMem(pInt->scrnIndex,base - BIOS_SCRATCH_OFF ,pagesize); + pci_device_unmap_legacy(pInt->dev, base, pagesize); } #endif |