summaryrefslogtreecommitdiff
path: root/src/sna/sna_blt.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-05-01 13:15:11 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-05-01 13:18:51 +0100
commit81608b4da5b35993cd2071098235c14920b7236d (patch)
tree7d1278f203947a018e43264f78d53378678b0ee8 /src/sna/sna_blt.c
parent150458c402f2a93e87924dacd3d0e99def512b85 (diff)
sna: Do not discard damage when using the CPU to perform BLT spans
The BLT paths are only taken when we know we are overwriting the target contents, and so we do not have to worry about reads along those paths. However, in terms of migrating the damage for a pixmap, we have to be careful in case we do not write to the full area of the composite rectangle, in which case we have to treat it as a read to that area and migrate the damage. Regression from commit a13781d19defc97af6a279c11a85e33ef825020e [2.20.10] Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Sun Aug 19 09:45:12 2012 +0100 sna: Enable BLT composite functions to target CPU buffers Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reported-by: Matti Hämäläinen Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_blt.c')
-rw-r--r--src/sna/sna_blt.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c
index f68d9510..75a65f4b 100644
--- a/src/sna/sna_blt.c
+++ b/src/sna/sna_blt.c
@@ -2521,8 +2521,7 @@ clear:
hint = 0;
if (can_render(sna)) {
hint |= PREFER_GPU;
- if (dst->pCompositeClip->data == NULL &&
- (flags & COMPOSITE_PARTIAL) == 0) {
+ if ((flags & COMPOSITE_PARTIAL) == 0) {
hint |= IGNORE_CPU;
if (width == tmp->dst.pixmap->drawable.width &&
height == tmp->dst.pixmap->drawable.height)
@@ -2545,8 +2544,10 @@ clear:
region.extents = dst_box;
region.data = NULL;
- if (!sna_drawable_move_region_to_cpu(dst->pDrawable, &region,
- MOVE_INPLACE_HINT | MOVE_WRITE))
+ hint = MOVE_WRITE | MOVE_INPLACE_HINT;
+ if (flags & COMPOSITE_PARTIAL)
+ hint |= MOVE_READ;
+ if (!sna_drawable_move_region_to_cpu(dst->pDrawable, &region, hint))
return false;
}
@@ -2610,8 +2611,7 @@ fill:
hint = 0;
if (can_render(sna)) {
hint |= PREFER_GPU;
- if (dst->pCompositeClip->data == NULL &&
- (flags & COMPOSITE_PARTIAL) == 0) {
+ if ((flags & COMPOSITE_PARTIAL) == 0) {
hint |= IGNORE_CPU;
if (width == tmp->dst.pixmap->drawable.width &&
height == tmp->dst.pixmap->drawable.height)
@@ -2634,8 +2634,10 @@ fill:
region.extents = dst_box;
region.data = NULL;
- if (!sna_drawable_move_region_to_cpu(dst->pDrawable, &region,
- MOVE_INPLACE_HINT | MOVE_WRITE))
+ hint = MOVE_WRITE | MOVE_INPLACE_HINT;
+ if (flags & COMPOSITE_PARTIAL)
+ hint |= MOVE_READ;
+ if (!sna_drawable_move_region_to_cpu(dst->pDrawable, &region, hint))
return false;
}
@@ -2775,8 +2777,7 @@ fill:
hint = 0;
if (bo || can_render(sna)) {
hint |= PREFER_GPU;
- if (dst->pCompositeClip->data == NULL &&
- (flags & COMPOSITE_PARTIAL) == 0) {
+ if ((flags & COMPOSITE_PARTIAL) == 0) {
hint |= IGNORE_CPU;
if (width == tmp->dst.pixmap->drawable.width &&
height == tmp->dst.pixmap->drawable.height)
@@ -2824,7 +2825,7 @@ put:
if (tmp->dst.bo == NULL) {
hint = MOVE_INPLACE_HINT | MOVE_WRITE;
- if (dst->pCompositeClip->data)
+ if (flags & COMPOSITE_PARTIAL)
hint |= MOVE_READ;
region.extents = dst_box;