diff options
author | Dave Airlie <airlied@linux.ie> | 2008-05-07 01:19:39 +1000 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2008-05-07 01:19:39 +1000 |
commit | 4568cb820d567c6909a4be956d7e79b91232535e (patch) | |
tree | bd18717aa30a755bb9a70d099ef09f44bab847c9 /src/radeon_driver.c | |
parent | ca81fa086b21633a7fd926833fb6d1d4fa080646 (diff) |
radeon: zaphod fixes for pciaccess not allowing multiple MMIO maps
Diffstat (limited to 'src/radeon_driver.c')
-rw-r--r-- | src/radeon_driver.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/src/radeon_driver.c b/src/radeon_driver.c index 202a1904..2701f57a 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -357,6 +357,12 @@ static void RADEONFreeRec(ScrnInfoPtr pScrn) static Bool RADEONMapMMIO(ScrnInfoPtr pScrn) { RADEONInfoPtr info = RADEONPTR(pScrn); + RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn); + + if (pRADEONEnt->MMIO) { + info->MMIO = pRADEONEnt->MMIO; + return TRUE; + } #ifndef XSERVER_LIBPCIACCESS @@ -367,7 +373,6 @@ static Bool RADEONMapMMIO(ScrnInfoPtr pScrn) info->MMIOSize); if (!info->MMIO) return FALSE; - #else void** result = (void**)&info->MMIO; @@ -386,6 +391,7 @@ static Bool RADEONMapMMIO(ScrnInfoPtr pScrn) #endif + pRADEONEnt->MMIO = info->MMIO; return TRUE; } @@ -395,6 +401,13 @@ static Bool RADEONMapMMIO(ScrnInfoPtr pScrn) static Bool RADEONUnmapMMIO(ScrnInfoPtr pScrn) { RADEONInfoPtr info = RADEONPTR(pScrn); + RADEONEntPtr pRADEONEnt = RADEONEntPriv(pScrn); + + if (info->IsPrimary || info->IsSecondary) { + /* never unmap on zaphod */ + info->MMIO = NULL; + return TRUE; + } #ifndef XSERVER_LIBPCIACCESS xf86UnMapVidMem(pScrn->scrnIndex, info->MMIO, info->MMIOSize); @@ -402,6 +415,7 @@ static Bool RADEONUnmapMMIO(ScrnInfoPtr pScrn) pci_device_unmap_range(info->PciInfo, info->MMIO, info->MMIOSize); #endif + pRADEONEnt->MMIO = NULL; info->MMIO = NULL; return TRUE; } |