summaryrefslogtreecommitdiff
path: root/src/savage_exa.c
diff options
context:
space:
mode:
authorAlex VillacĂ­s Lasso <a_villacis@palosanto.com>2009-01-16 16:22:42 -0500
committerAlex Deucher <alexdeucher@gmail.com>2009-01-16 16:22:42 -0500
commit8241b8edaf1f100b0d9f308fdf921b2ab548f3dc (patch)
treeee3030d3491b5d86c8553fd307b601909e8dd1b0 /src/savage_exa.c
parent50bcd4bd6f32ed2fd9631b3607a203a187b2e4a2 (diff)
EXA: UTS Optimization
use one memcpy per scanline instead of a conditional inside a loop for every dword
Diffstat (limited to 'src/savage_exa.c')
-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;
}