diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-09-09 11:19:19 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-09-09 11:19:19 +0100 |
commit | 6d5df67b3e4ed5d5b9f1aabf01b5657d4c9eeac7 (patch) | |
tree | 89016058605ef013367a6a22961dc91c2979e741 /src | |
parent | 634748486f33658f09c8a7f4508840fad6df85f2 (diff) |
sna: Remember to offset the box before asserting damage
When using sna_copy_boxes__inplace(), we need to remember that the
region is in destination space, so we need to offset the boxes when
comparing against the source. The assertion forgot to do so, and so
failed as soon as it met a little complexity.
Reported-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/sna/sna_accel.c | 4 | ||||
-rw-r--r-- | src/sna/sna_damage.h | 13 |
2 files changed, 15 insertions, 2 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 8a7a2490..9ddc6331 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -5109,8 +5109,8 @@ sna_copy_boxes__inplace(struct sna *sna, RegionPtr region, int alu, return false; } - assert(sna_damage_contains_box(src_priv->gpu_damage, ®ion->extents) == PIXMAN_REGION_IN); - assert(sna_damage_contains_box(src_priv->cpu_damage, ®ion->extents) == PIXMAN_REGION_OUT); + assert(sna_damage_contains_box(src_priv->gpu_damage, ®ion->extents, dx, dy) == PIXMAN_REGION_IN); + assert(sna_damage_contains_box(src_priv->cpu_damage, ®ion->extents, dx, dy) == PIXMAN_REGION_OUT); src = kgem_bo_map__cpu(&sna->kgem, src_priv->gpu_bo); if (src == NULL) { diff --git a/src/sna/sna_damage.h b/src/sna/sna_damage.h index 03a54a3d..187d312d 100644 --- a/src/sna/sna_damage.h +++ b/src/sna/sna_damage.h @@ -215,6 +215,19 @@ static inline int sna_damage_contains_box(struct sna_damage *damage, return _sna_damage_contains_box(damage, box); } +static inline int sna_damage_contains_box__offset(struct sna_damage *damage, + const BoxRec *box, int dx, int dy) +{ + BoxRec b; + + if (DAMAGE_IS_ALL(damage)) + return PIXMAN_REGION_IN; + + b = *box; + b.x1 += dx; b.x2 += dx; + b.y1 += dy; b.y2 += dy; + return _sna_damage_contains_box(damage, &b); +} bool _sna_damage_contains_box__no_reduce(const struct sna_damage *damage, const BoxRec *box); static inline bool |