sna/gen7: Prefer the BLT for self-copies

Looking at the test results for a third time, gives the edge to the BLT
again.
This commit is contained in:
Chris Wilson 2012-08-01 20:20:29 +01:00
parent e4a3cd3d16
commit ca46d1c7a1
1 changed files with 16 additions and 3 deletions

View File

@ -2470,6 +2470,13 @@ try_blt(struct sna *sna,
if (can_switch_rings(sna)) {
if (sna_picture_is_solid(src, NULL))
return true;
if (dst->pDrawable == src->pDrawable)
return true;
if (src->pDrawable &&
get_drawable_pixmap(dst->pDrawable) == get_drawable_pixmap(src->pDrawable))
return true;
}
return false;
@ -3311,7 +3318,8 @@ static inline bool prefer_blt_copy(struct sna *sna,
}
static inline bool
overlaps(struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy,
overlaps(struct sna *sna,
struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy,
struct kgem_bo *dst_bo, int16_t dst_dx, int16_t dst_dy,
const BoxRec *box, int n)
{
@ -3320,6 +3328,9 @@ overlaps(struct kgem_bo *src_bo, int16_t src_dx, int16_t src_dy,
if (src_bo != dst_bo)
return false;
if (can_switch_rings(sna))
return true;
extents = box[0];
while (--n) {
box++;
@ -3352,7 +3363,8 @@ gen7_render_copy_boxes(struct sna *sna, uint8_t alu,
DBG(("%s (%d, %d)->(%d, %d) x %d, alu=%x, self-copy=%d, overlaps? %d\n",
__FUNCTION__, src_dx, src_dy, dst_dx, dst_dy, n, alu,
src_bo == dst_bo,
overlaps(src_bo, src_dx, src_dy,
overlaps(sna,
src_bo, src_dx, src_dy,
dst_bo, dst_dx, dst_dy,
box, n)));
@ -3391,7 +3403,8 @@ gen7_render_copy_boxes(struct sna *sna, uint8_t alu,
}
if (!(alu == GXcopy || alu == GXclear) ||
overlaps(src_bo, src_dx, src_dy,
overlaps(sna,
src_bo, src_dx, src_dy,
dst_bo, dst_dx, dst_dy,
box, n)) {
fallback_blt: