summaryrefslogtreecommitdiff
path: root/src/savage_driver.c
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2008-05-21 16:03:25 -0400
committerAdam Jackson <ajax@redhat.com>2008-05-21 16:03:25 -0400
commit5c0617874a49533f16b97277cd42584abb80f720 (patch)
treed4efda282bc7decce6ba4066c9c03ea16c5853cd /src/savage_driver.c
parent97a9d2476868befc989b7ddb8067ac791bf2672e (diff)
parenta01c9d12938f977a4310e0547866f01517059a3e (diff)
Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/driver/xf86-video-savage
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;
}