diff options
author | Jordan Crouse <jordan.crouse@amd.com> | 2008-06-10 12:08:52 -0600 |
---|---|---|
committer | Jordan Crouse <jordan.crouse@amd.com> | 2008-06-10 14:18:54 -0600 |
commit | 489546dfd2dd295db63f31e123b0073a6fa330a9 (patch) | |
tree | b17253833caaada32b0e119ab4a0b11ee79d5b9e | |
parent | 739eb15da7bb0d2ca681eeb9a308b1297ee4eca7 (diff) |
geode: Unmap the PCI memory when we close the screen
-rw-r--r-- | src/lx_driver.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/lx_driver.c b/src/lx_driver.c index 48aff44..d44fb94 100644 --- a/src/lx_driver.c +++ b/src/lx_driver.c @@ -418,6 +418,13 @@ map_pci_mem(ScrnInfoPtr pScrni, int vram, return NULL; return ptr; } + +static inline int +unmap_pci_mem(ScrnInfoPtr pScrni, struct pci_device *dev, void *ptr, int size) +{ + return pci_device_unmap_range(dev, ptr, size); +} + #endif static Bool @@ -848,15 +855,23 @@ static Bool LXUnmapMem(ScrnInfoPtr pScrni) { GeodeRec *pGeode = GEODEPTR(pScrni); + pciVideoPtr pci = xf86GetPciInfoForEntity(pGeode->pEnt->index); +#ifndef XSERVER_LIBPCIACCESS xf86UnMapVidMem(pScrni->scrnIndex, (pointer) cim_gp_ptr, LX_GP_REG_SIZE); xf86UnMapVidMem(pScrni->scrnIndex, (pointer) cim_vg_ptr, LX_VG_REG_SIZE); xf86UnMapVidMem(pScrni->scrnIndex, (pointer) cim_vid_ptr, LX_VID_REG_SIZE); xf86UnMapVidMem(pScrni->scrnIndex, (pointer) cim_vip_ptr, LX_VIP_REG_SIZE); +#else + unmap_pci_mem(pScrni, pci, cim_gp_ptr, LX_GP_REG_SIZE); + unmap_pci_mem(pScrni, pci, cim_vg_ptr, LX_VG_REG_SIZE); + unmap_pci_mem(pScrni, pci, cim_vid_ptr, LX_VID_REG_SIZE); + unmap_pci_mem(pScrni, pci, cim_vip_ptr, LX_VIP_REG_SIZE); + unmap_pci_mem(pScrni, pci, cim_fb_ptr, pGeode->FBAvail + CIM_CMD_BFR_SZ); +#endif - xf86UnMapVidMem(pScrni->scrnIndex, cim_fb_ptr, pGeode->FBAvail); xf86UnMapVidMem(pScrni->scrnIndex, XpressROMPtr, 0x10000); return TRUE; |