diff options
author | Dave Airlie <airlied@linux.ie> | 2008-05-10 15:06:18 +1000 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2008-05-10 15:06:18 +1000 |
commit | a01c9d12938f977a4310e0547866f01517059a3e (patch) | |
tree | 1773411acd8a258bb3c082c7dbd26a136343fe9f /src | |
parent | 69eca3b8340966874ee3ffdc0d0a3f73de7a816a (diff) |
savage/pciaccess: don't try to map aperture larger than region window
Diffstat (limited to 'src')
-rw-r--r-- | src/savage_driver.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/savage_driver.c b/src/savage_driver.c index 5fd7d66..2205dc8 100644 --- a/src/savage_driver.c +++ b/src/savage_driver.c @@ -3097,10 +3097,16 @@ static Bool SavageMapMem(ScrnInfoPtr pScrn) /* On Paramount and Savage 2000, aperture 0 is PCI base 2. On other * chipsets it's in the same BAR as the framebuffer. */ + + psav->ApertureRegion.size = (psav->IsPrimary || psav->IsSecondary) + ? (0x01000000 * 2) : (0x01000000 * 5); + if ((psav->Chipset == S3_SUPERSAVAGE) || (psav->Chipset == S3_SAVAGE2000)) { #ifdef XSERVER_LIBPCIACCESS psav->ApertureRegion.base = psav->PciInfo->regions[2].base_addr; + if (psav->ApertureRegion.size > psav->PciInfo->regions[2].size) + psav->ApertureRegion.size = psav->PciInfo->regions[2].size; #else psav->ApertureRegion.base = psav->PciInfo->memBase[2]; #endif @@ -3108,8 +3114,6 @@ static Bool SavageMapMem(ScrnInfoPtr pScrn) psav->ApertureRegion.base = psav->FbRegion.base + 0x02000000; } - psav->ApertureRegion.size = (psav->IsPrimary || psav->IsSecondary) - ? (0x01000000 * 2) : (0x01000000 * 5); if (psav->FbRegion.size != 0) { |