summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/savage_driver.c14
-rw-r--r--src/savage_exa.c21
2 files changed, 20 insertions, 15 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;
}
diff --git a/src/savage_exa.c b/src/savage_exa.c
index aa6905a..6320e18 100644
--- a/src/savage_exa.c
+++ b/src/savage_exa.c
@@ -460,7 +460,6 @@ SavageUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int
CARD32 * srcp;
Bpp = pDst->drawable.bitsPerPixel / 8;
- dwords = (((w * Bpp) + 3) >> 2) * h;
psav->sbd_offset = exaGetPixmapOffset(pDst);
psav->sbd_high = SavageSetBD(psav, pDst);
@@ -486,17 +485,19 @@ SavageUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int
BCI_SEND(BCI_X_Y(x, y));
BCI_SEND(BCI_W_H(w, h));
- srcp = (CARD32 *)src;
queue = 120 * 1024;
- while (dwords) {
- if (queue < 4) {
- BCI_RESET;
- queue = 120 * 1024;
+ dwords = (((w * Bpp) + 3) >> 2);
+ for (i = 0; i < h; i++) {
+ srcp = (CARD32 *)src;
+ for (j = 0; j < dwords; j++) {
+ if (queue < 4) {
+ BCI_RESET;
+ queue = 120 * 1024;
+ }
+ BCI_SEND(*srcp++);
+ queue -= 4;
}
- BCI_SEND(*srcp);
- queue -= 4;
- dwords--;
- srcp++;
+ src += src_pitch;
}
/*exaWaitSync(pDst->drawable.pScreen);*/