summaryrefslogtreecommitdiff
path: root/src/savage_driver.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/savage_driver.c')
-rw-r--r--src/savage_driver.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/savage_driver.c b/src/savage_driver.c
index 1b94d1f..919bd1a 100644
--- a/src/savage_driver.c
+++ b/src/savage_driver.c
@@ -3121,10 +3121,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
@@ -3132,8 +3138,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) {
@@ -3152,7 +3156,7 @@ static Bool SavageMapMem(ScrnInfoPtr pScrn)
#endif
if (err) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Internal error: cound not map framebuffer range (%d, %s).\n",
+ "Internal error: could not map framebuffer range (%d, %s).\n",
err, strerror(err));
return FALSE;
}
@@ -3178,7 +3182,7 @@ static Bool SavageMapMem(ScrnInfoPtr pScrn)
#endif
if (err) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Internal error: cound not map aperture range (%d, %s).\n",
+ "Internal error: could not map aperture range (%d, %s).\n",
err, strerror(err));
return FALSE;
}
@@ -3203,7 +3207,7 @@ static Bool SavageMapMem(ScrnInfoPtr pScrn)
#endif
if (err) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
- "Internal error: cound not map MMIO range (%d, %s).\n",
+ "Internal error: could not map MMIO range (%d, %s).\n",
err, strerror(err));
return FALSE;
}