From aa96769c01d342bbe247640134d46fdefe68b4ac Mon Sep 17 00:00:00 2001 From: =?utf-8?q?Alex=20Villac=C3=ADs=20Lasso?= Date: Thu, 10 Jan 2008 01:45:29 -0500 Subject: [PATCH] BCI can only handle widths that are multiple of 16, so only use BCI for these (for now). Small optimizations (use memcpy instead of copy loop). --- src/savage_video.c | 17 +++++++---------- 1 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/savage_video.c b/src/savage_video.c index 64dcef1..511c820 100644 --- a/src/savage_video.c +++ b/src/savage_video.c @@ -1189,21 +1189,15 @@ SavageCopyPlanarDataBCI( BCI_GET_PTR; /* copy Y planar */ - for (i=0;i>1);i++) { - dstCopy[i] = srcV[i]; - } + memcpy(dstCopy, srcV, srcPitch2 * (h>>1)); /* copy U planar */ dstCopy = dstCopy + srcPitch2 * (h>>1); - for (i=0;i>1);i++) { - dstCopy[i] = srcU[i]; - } + memcpy(dstCopy, srcU, srcPitch2 * (h>>1)); /* * Transfer pixel data from one memory location to another location @@ -1253,6 +1247,9 @@ SavageCopyData( int w ){ w <<= 1; + if (w == srcPitch && w == dstPitch) { + memcpy(dst, src, w * h); + } else while(h--) { memcpy(dst, src, w); src += srcPitch; @@ -1937,7 +1934,7 @@ SavagePutImage( offsetU += tmp; offsetV += tmp; nlines = ((((y2 + 0xffff) >> 16) + 1) & ~1) - top; - if (S3_SAVAGE4_SERIES(psav->Chipset) && psav->BCIforXv) { + if (S3_SAVAGE4_SERIES(psav->Chipset) && psav->BCIforXv && (npixels & 0xF) == 0) { SavageCopyPlanarDataBCI( pScrn, buf + (top * srcPitch) + (left >> 1), -- 1.5.3.7