summaryrefslogtreecommitdiff
path: root/src/i830_video.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2008-04-09 16:27:40 -0500
committerKeith Packard <keithp@keithp.com>2008-04-10 16:58:12 -0500
commitd5a80e1e3ab5724d34b20f9ee6f830efd0f5b076 (patch)
tree575555f4cf9a428581914762bad8b0d384626ae7 /src/i830_video.c
parentac97f2b1487df5574875350a9cded958dae33afa (diff)
Single memcpy when pitches align on planar image transfer
Diffstat (limited to 'src/i830_video.c')
-rw-r--r--src/i830_video.c39
1 files changed, 24 insertions, 15 deletions
diff --git a/src/i830_video.c b/src/i830_video.c
index 4e1f725d..24372886 100644
--- a/src/i830_video.c
+++ b/src/i830_video.c
@@ -1382,11 +1382,14 @@ I830CopyPlanarData(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv,
switch (pPriv->rotation) {
case RR_Rotate_0:
- for (i = 0; i < h; i++) {
- memcpy(dst1, src1, w);
- src1 += srcPitch;
- dst1 += dstPitch2;
- }
+ if (srcPitch == dstPitch2)
+ memcpy (dst1, src1, srcPitch * h);
+ else
+ for (i = 0; i < h; i++) {
+ memcpy(dst1, src1, w);
+ src1 += srcPitch;
+ dst1 += dstPitch2;
+ }
break;
case RR_Rotate_90:
for (i = 0; i < h; i++) {
@@ -1437,11 +1440,14 @@ I830CopyPlanarData(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv,
switch (pPriv->rotation) {
case RR_Rotate_0:
- for (i = 0; i < h / 2; i++) {
- memcpy(dst2, src2, w / 2);
- src2 += srcPitch2;
- dst2 += dstPitch;
- }
+ if (srcPitch2 == dstPitch)
+ memcpy (dst2, src2, h/2 * srcPitch2);
+ else
+ for (i = 0; i < h / 2; i++) {
+ memcpy(dst2, src2, w / 2);
+ src2 += srcPitch2;
+ dst2 += dstPitch;
+ }
break;
case RR_Rotate_90:
for (i = 0; i < (h/2); i++) {
@@ -1493,11 +1499,14 @@ I830CopyPlanarData(ScrnInfoPtr pScrn, I830PortPrivPtr pPriv,
switch (pPriv->rotation) {
case RR_Rotate_0:
- for (i = 0; i < h / 2; i++) {
- memcpy(dst3, src3, w / 2);
- src3 += srcPitch2;
- dst3 += dstPitch;
- }
+ if (srcPitch2 == dstPitch)
+ memcpy (dst3, src3, srcPitch2 * h/2);
+ else
+ for (i = 0; i < h / 2; i++) {
+ memcpy(dst3, src3, w / 2);
+ src3 += srcPitch2;
+ dst3 += dstPitch;
+ }
break;
case RR_Rotate_90:
for (i = 0; i < (h/2); i++) {