summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaul Fernandes <rgfernandes@gmail.com>2013-07-30 09:26:05 -0400
committerAlex Deucher <alexander.deucher@amd.com>2013-07-30 09:26:05 -0400
commit6a278369c05a298a4367306d986467a9ceacae8c (patch)
treed3f2040eabdf9f2b3972a7a4ca25bea61477d784
parent4375a6e75e5d41139be7031a0dee58c057ecbd07 (diff)
EXA/6xx/7xx: optimize non-overlapping Copy
In case dst and src rectangles of a Copy operation in the same surface don't overlap, it is safe to skip the scratch surface. This is a common case. Based on evergreen/ni patch from Grigori Goronzy. Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--src/r600_exa.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/r600_exa.c b/src/r600_exa.c
index b2432346..a354ccd0 100644
--- a/src/r600_exa.c
+++ b/src/r600_exa.c
@@ -643,7 +643,12 @@ R600Copy(PixmapPtr pDst,
if (accel_state->vsync)
RADEONVlineHelperSet(pScrn, dstX, dstY, dstX + w, dstY + h);
- if (accel_state->same_surface && accel_state->copy_area) {
+ if (accel_state->same_surface &&
+ (srcX + w <= dstX || dstX + w <= srcX || srcY + h <= dstY || dstY + h <= srcY)) {
+ R600DoPrepareCopy(pScrn);
+ R600AppendCopyVertex(pScrn, srcX, srcY, dstX, dstY, w, h);
+ R600DoCopyVline(pDst);
+ } else if (accel_state->same_surface && accel_state->copy_area) {
uint32_t orig_dst_domain = accel_state->dst_obj.domain;
uint32_t orig_src_domain = accel_state->src_obj[0].domain;
uint32_t orig_src_tiling_flags = accel_state->src_obj[0].tiling_flags;