summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/savage_exa.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/src/savage_exa.c b/src/savage_exa.c
index 7c6efb3..538e000 100644
--- a/src/savage_exa.c
+++ b/src/savage_exa.c
@@ -495,13 +495,21 @@ SavageUploadToScreen(PixmapPtr pDst, int x, int y, int w, int h, char *src, int
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;
+
+ if (4 * dwords <= queue) {
+ /* WARNING: breaking BCI_PTR abstraction here */
+ memcpy(bci_ptr, srcp, 4 * dwords);
+ bci_ptr += dwords;
+ queue -= 4 * dwords;
+ } else {
+ for (j = 0; j < dwords; j++) {
+ if (queue < 4) {
+ BCI_RESET;
+ queue = 120 * 1024;
+ }
+ BCI_SEND(*srcp++);
+ queue -= 4;
}
- BCI_SEND(*srcp++);
- queue -= 4;
}
src += src_pitch;
}