diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-11 13:18:33 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-06-11 13:18:33 +0100 |
commit | 040eccb9b10d0941c7d81fc9c66c259563370f2a (patch) | |
tree | 5bad5524ec0005f94696d0f120842c103296fdfd | |
parent | 4fccfe3a516ab8383dfd99ccd7fe1840c88bbc01 (diff) |
sna: Add some asserts to track redundant damage operations
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_blt.c | 1 | ||||
-rw-r--r-- | src/sna/sna_damage.c | 11 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c index 75a65f4b..958d4f97 100644 --- a/src/sna/sna_blt.c +++ b/src/sna/sna_blt.c @@ -3631,6 +3631,7 @@ bool sna_blt_copy_boxes(struct sna *sna, uint8_t alu, __FUNCTION__, src_dx, src_dy, dst_dx, dst_dy, nbox, src_bo->tiling, dst_bo->tiling, src_bo->pitch, dst_bo->pitch)); + assert(nbox); if (wedged(sna) || !kgem_bo_can_blt(kgem, src_bo) || !kgem_bo_can_blt(kgem, dst_bo)) { DBG(("%s: cannot blt to src? %d or dst? %d\n", diff --git a/src/sna/sna_damage.c b/src/sna/sna_damage.c index 8c041de0..ffbd74d6 100644 --- a/src/sna/sna_damage.c +++ b/src/sna/sna_damage.c @@ -370,6 +370,7 @@ _sna_damage_create_elt(struct sna_damage *damage, DBG((" %s: prev=(remain %d), count=%d\n", __FUNCTION__, damage->remain, count)); + assert(count); restart: n = count; @@ -421,6 +422,7 @@ _sna_damage_create_elt_from_boxes(struct sna_damage *damage, int i, n; DBG((" %s: prev=(remain %d)\n", __FUNCTION__, damage->remain)); + assert(count); restart: n = count; @@ -483,6 +485,7 @@ _sna_damage_create_elt_from_rectangles(struct sna_damage *damage, DBG((" %s: prev=(remain %d), count=%d\n", __FUNCTION__, damage->remain, count)); + assert(count); restart: n = count; @@ -545,6 +548,7 @@ _sna_damage_create_elt_from_points(struct sna_damage *damage, DBG((" %s: prev=(remain %d), count=%d\n", __FUNCTION__, damage->remain, count)); + assert(count); restart: n = count; @@ -1532,6 +1536,9 @@ static int __sna_damage_get_boxes(struct sna_damage *damage, BoxPtr *boxes) if (damage->dirty) __sna_damage_reduce(damage); + assert(!damage->dirty); + assert(damage->mode == DAMAGE_ADD); + *boxes = region_rects(&damage->region); return region_num_rects(&damage->region); } @@ -1541,6 +1548,10 @@ struct sna_damage *_sna_damage_reduce(struct sna_damage *damage) DBG(("%s\n", __FUNCTION__)); __sna_damage_reduce(damage); + + assert(!damage->dirty); + assert(damage->mode == DAMAGE_ADD); + if (!pixman_region_not_empty(&damage->region)) { __sna_damage_destroy(damage); damage = NULL; |