diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-01-22 13:42:57 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-01-22 13:42:57 +0000 |
commit | 77ee92248582d65a03619d1bb1d93a74468eea00 (patch) | |
tree | 589954f50eebfcec8c30015a21fce9779476c58e | |
parent | dd079dd1f64e7832c6343c24958aa9eeb2f58789 (diff) |
sna: Use full usage flags for moving the dst pixmap for a copy
Now that the migration code can decide for itself when to not move
damage, we can pass the hints to the code rather than perform the
optimisation in sna_copy_boxes.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_accel.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 8801477e..37385ebe 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -3090,7 +3090,8 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc, goto fallback; } - if (alu != GXcopy && !sna_pixmap_move_to_gpu(dst_pixmap, MOVE_READ | MOVE_WRITE)) { + if (!sna_pixmap_move_to_gpu(dst_pixmap, + MOVE_WRITE | (alu_overwrites(alu) ? 0 : MOVE_READ))) { DBG(("%s: fallback - not a pure copy and failed to move dst to GPU\n", __FUNCTION__)); goto fallback; @@ -3121,9 +3122,6 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc, assert_pixmap_contains_box(dst_pixmap, RegionExtents(®ion)); sna_damage_add(&dst_priv->gpu_damage, ®ion); - if (alu == GXcopy) - sna_damage_subtract(&dst_priv->cpu_damage, - ®ion); RegionTranslate(®ion, -dst_dx, -dst_dy); } } @@ -3152,9 +3150,6 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc, assert_pixmap_contains_box(dst_pixmap, RegionExtents(®ion)); sna_damage_add(&dst_priv->gpu_damage, ®ion); - if (alu == GXcopy) - sna_damage_subtract(&dst_priv->cpu_damage, - ®ion); RegionTranslate(®ion, -dst_dx, -dst_dy); } } @@ -3262,8 +3257,6 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc, RegionExtents(®ion)); sna_damage_add(&dst_priv->gpu_damage, ®ion); - sna_damage_subtract(&dst_priv->cpu_damage, - ®ion); RegionTranslate(®ion, -dst_dx, -dst_dy); } } |