diff options
author | Adam Jackson <ajax@redhat.com> | 2008-05-21 16:03:25 -0400 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2008-05-21 16:03:25 -0400 |
commit | 5c0617874a49533f16b97277cd42584abb80f720 (patch) | |
tree | d4efda282bc7decce6ba4066c9c03ea16c5853cd /src | |
parent | 97a9d2476868befc989b7ddb8067ac791bf2672e (diff) | |
parent | a01c9d12938f977a4310e0547866f01517059a3e (diff) |
Merge branch 'master' of git+ssh://git.freedesktop.org/git/xorg/driver/xf86-video-savage
Diffstat (limited to 'src')
-rw-r--r-- | src/savage_driver.c | 14 | ||||
-rw-r--r-- | src/savage_exa.c | 21 |
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);*/ |