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 | |
parent | ca81fa086b21633a7fd926833fb6d1d4fa080646 (diff) |
radeon: zaphod fixes for pciaccess not allowing multiple MMIO maps
-rw-r--r-- | src/radeon_driver.c | 16 | ||||
-rw-r--r-- | src/radeon_probe.h | 1 |
2 files changed, 16 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; } diff --git a/src/radeon_probe.h b/src/radeon_probe.h index 79839700..f03e9970 100644 --- a/src/radeon_probe.h +++ b/src/radeon_probe.h @@ -588,6 +588,7 @@ typedef struct RADEONSaveRec ModeReg; /* Current mode */ RADEONSaveRec SavedReg; /* Original (text) mode */ + void *MMIO; /* Map of MMIO region */ } RADEONEntRec, *RADEONEntPtr; /* radeon_probe.c */ |