diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-11-14 11:19:42 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-11-14 11:20:32 +0000 |
commit | 00d1c539e4b69636bfc35c0c47a6f1db3a33e731 (patch) | |
tree | 3602e2f31efc9d6762367fe046d1391d7afac7b9 /src | |
parent | 60c0fc101adbc457a7c1927602175f8079175e10 (diff) |
sna/damage: Add a little more verbosity to debugging
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/sna/sna_accel.c | 5 | ||||
-rw-r--r-- | src/sna/sna_damage.c | 22 |
2 files changed, 19 insertions, 8 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 73fca8f7..9fd5accf 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -1370,6 +1370,7 @@ sna_put_zpixmap_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region, kgem_bo_sync(&sna->kgem, priv->cpu_bo, true); if (region_subsumes_drawable(region, &pixmap->drawable)) { + DBG(("%s: replacing entire pixmap\n", __FUNCTION__)); sna_damage_all(&priv->cpu_damage, pixmap->drawable.width, pixmap->drawable.height); @@ -1380,8 +1381,10 @@ sna_put_zpixmap_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region, sna_damage_add(&priv->cpu_damage, region); if (sna_damage_is_all(&priv->cpu_damage, pixmap->drawable.width, - pixmap->drawable.height)) + pixmap->drawable.height)) { + DBG(("%s: replaced entire pixmap\n", __FUNCTION__)); sna_pixmap_destroy_gpu_bo(sna, priv); + } } if (priv->flush) list_move(&priv->list, &sna->dirty_pixmaps); diff --git a/src/sna/sna_damage.c b/src/sna/sna_damage.c index 03bb881c..2d7d65d7 100644 --- a/src/sna/sna_damage.c +++ b/src/sna/sna_damage.c @@ -121,13 +121,21 @@ static const char *_debug_describe_damage(char *buf, int max, if (str_max > sizeof(damage_str)) str_max = sizeof(damage_str); - sprintf(damage_str, "[%d : ...]", damage->n); - snprintf(buf, max, "[[(%d, %d), (%d, %d)]: %s + %s]", - damage->extents.x1, damage->extents.y1, - damage->extents.x2, damage->extents.y2, - _debug_describe_region(region_str, str_max, - &damage->region), - damage_str); + if (damage->mode == DAMAGE_ALL) { + snprintf(buf, max, "[[(%d, %d), (%d, %d)]: all]", + damage->extents.x1, damage->extents.y1, + damage->extents.x2, damage->extents.y2); + assert(damage->n == 0); + } else { + sprintf(damage_str, "[%d : ...]", damage->n); + snprintf(buf, max, "[[(%d, %d), (%d, %d)]: %s %c %s]", + damage->extents.x1, damage->extents.y1, + damage->extents.x2, damage->extents.y2, + _debug_describe_region(region_str, str_max, + &damage->region), + damage->mode == DAMAGE_SUBTRACT ? '-' : '+', + damage_str); + } return buf; } |