diff options
author | Grigori Goronzy <greg@chown.ath.cx> | 2012-07-27 17:31:53 +0200 |
---|---|---|
committer | Grigori Goronzy <greg@chown.ath.cx> | 2013-07-22 05:05:43 +0200 |
commit | 5bb04351c43a91a1d60348b7293544da05d75e72 (patch) | |
tree | f61b98d20b56c080e6183c499a4240a52554505f /src | |
parent | c08e09b7bec441c4bf93b4cae4de1260754bf940 (diff) |
EXA/evergreen/ni: 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.
Diffstat (limited to 'src')
-rw-r--r-- | src/evergreen_exa.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/evergreen_exa.c b/src/evergreen_exa.c index 86f455de..2cdce0f5 100644 --- a/src/evergreen_exa.c +++ b/src/evergreen_exa.c @@ -575,7 +575,12 @@ EVERGREENCopy(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)) { + EVERGREENDoPrepareCopy(pScrn); + EVERGREENAppendCopyVertex(pScrn, srcX, srcY, dstX, dstY, w, h); + EVERGREENDoCopyVline(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; |