[PATCH] Use memcpy instead of memove for RADEONSwapCopy.

Pauli Nieminen suokkos at gmail.com
Mon Feb 15 03:45:28 PST 2010


memcpy has about 25% better performance than memmove when
destination is GTT (wc caching). Changing memmove to memcpy
in SwapCopy will reduce CPU time spent moving data between
host and GPU.

memcpy will specially help Xv when playing high resolution
videos.

The swap path doesn't support overlapping memory copies either
so extra safety is not worth the performance hit in commonly
used code path.

Signed-off-by: Pauli Nieminen <suokkos at gmail.com>
---
 src/radeon_accel.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/radeon_accel.c b/src/radeon_accel.c
index 02905dd..3d28a8a 100644
--- a/src/radeon_accel.c
+++ b/src/radeon_accel.c
@@ -980,7 +980,7 @@ void RADEONCopySwap(uint8_t *dst, uint8_t *src, unsigned int size, int swap)
 	}
     }
     if (src != dst)
-	    memmove(dst, src, size);
+        memcpy(dst,src, size);
 }
 
 /* Copies a single pass worth of data for a hostdata blit set up by
-- 
1.6.3.3



More information about the xorg-driver-ati mailing list