From 8241b8edaf1f100b0d9f308fdf921b2ab548f3dc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20Villac=C3=ADs=20Lasso?= Date: Fri, 16 Jan 2009 16:22:42 -0500 Subject: EXA: UTS Optimization use one memcpy per scanline instead of a conditional inside a loop for every dword --- src/savage_exa.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3