diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-06-07 00:24:17 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-06-07 00:24:17 +0100 |
commit | 4e443cbef589e016d085e8023677f47c1f01a858 (patch) | |
tree | 76ff1fda6b16934a648d0786cffee040f86e24fd | |
parent | 367298c5109b47fa4961a60fa3cb454c800f02c3 (diff) |
sna: Add some more debug commentary to render picture source migration
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_damage.c | 14 | ||||
-rw-r--r-- | src/sna/sna_damage.h | 4 | ||||
-rw-r--r-- | src/sna/sna_render.c | 33 |
3 files changed, 40 insertions, 11 deletions
diff --git a/src/sna/sna_damage.c b/src/sna/sna_damage.c index 21af2d0a..63e83417 100644 --- a/src/sna/sna_damage.c +++ b/src/sna/sna_damage.c @@ -614,7 +614,7 @@ fastcall struct sna_damage *_sna_damage_subtract_box(struct sna_damage *damage, #endif static int _sna_damage_contains_box(struct sna_damage *damage, - const BoxPtr box) + const BoxRec *box) { if (!damage) return PIXMAN_REGION_OUT;; @@ -625,12 +625,12 @@ static int _sna_damage_contains_box(struct sna_damage *damage, if (damage->n) __sna_damage_reduce(damage); - return pixman_region_contains_rectangle(&damage->region, box); + return pixman_region_contains_rectangle(&damage->region, (BoxPtr)box); } #if DEBUG_DAMAGE int sna_damage_contains_box(struct sna_damage *damage, - const BoxPtr box) + const BoxRec *box) { char damage_buf[1000]; int ret; @@ -640,13 +640,17 @@ int sna_damage_contains_box(struct sna_damage *damage, box->x1, box->y1, box->x2, box->y2)); ret = _sna_damage_contains_box(damage, box); - ErrorF(" = %d\n", ret); + ErrorF(" = %d", ret); + if (ret) + ErrorF(" [(%d, %d), (%d, %d)...]", + box->x1, box->y1, box->x2, box->y2); + ErrorF("\n"); return ret; } #else int sna_damage_contains_box(struct sna_damage *damage, - const BoxPtr box) + const BoxRec *box) { return _sna_damage_contains_box(damage, box); } diff --git a/src/sna/sna_damage.h b/src/sna/sna_damage.h index 0b335711..c5dfa7f3 100644 --- a/src/sna/sna_damage.h +++ b/src/sna/sna_damage.h @@ -53,7 +53,7 @@ static inline void sna_damage_subtract(struct sna_damage **damage, fastcall struct sna_damage *_sna_damage_subtract_box(struct sna_damage *damage, const BoxRec *box); static inline void sna_damage_subtract_box(struct sna_damage **damage, - BoxPtr box) + const BoxRec *box) { *damage = _sna_damage_subtract_box(*damage, box); } @@ -62,7 +62,7 @@ Bool sna_damage_intersect(struct sna_damage *damage, RegionPtr region, RegionPtr result); int sna_damage_contains_box(struct sna_damage *damage, - const BoxPtr box); + const BoxRec *box); int sna_damage_get_boxes(struct sna_damage *damage, BoxPtr *boxes); diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c index b6a44d26..d7d7e5f5 100644 --- a/src/sna/sna_render.c +++ b/src/sna/sna_render.c @@ -238,18 +238,26 @@ void no_render_init(struct sna *sna) } static Bool -move_to_gpu(PixmapPtr pixmap, const BoxPtr box) +move_to_gpu(PixmapPtr pixmap, const BoxRec *box) { struct sna_pixmap *priv; int count, w, h; - if (pixmap->usage_hint) + if (pixmap->usage_hint) { + DBG(("%s: not migrating pixmap due to usage_hint=%d\n", + __FUNCTION__, pixmap->usage_hint)); return FALSE; + } w = box->x2 - box->x1; h = box->y2 - box->y1; - if (w == pixmap->drawable.width || h == pixmap->drawable.height) + if (w == pixmap->drawable.width || h == pixmap->drawable.height) { + DBG(("%s: migrating whole pixmap (%dx%d) for source\n", + __FUNCTION__, + pixmap->drawble->width, + pixmap->drawable.height)); return TRUE; + } count = SOURCE_BIAS; priv = sna_pixmap(pixmap); @@ -267,7 +275,7 @@ move_to_gpu(PixmapPtr pixmap, const BoxPtr box) } static Bool -texture_is_cpu(PixmapPtr pixmap, const BoxPtr box) +_texture_is_cpu(PixmapPtr pixmap, const BoxRec *box) { struct sna_pixmap *priv = sna_pixmap(pixmap); @@ -289,6 +297,23 @@ texture_is_cpu(PixmapPtr pixmap, const BoxPtr box) return sna_damage_contains_box(priv->cpu_damage, box) != PIXMAN_REGION_OUT; } +#if DEBUG_RENDER +static Bool +texture_is_cpu(PixmapPtr pixmap, const BoxRec *box) +{ + Bool ret = _texture_is_cpu(pixmap, box); + ErrorF("%s(pixmap=%p, box=((%d, %d), (%d, %d)) = %d\n", + __FUNCTION__, pixmap, box, ret); + return ret; +} +#else +static Bool +texture_is_cpu(PixmapPtr pixmap, const BoxRec *box) +{ + return _texture_is_cpu(pixmap, box); +} +#endif + static struct kgem_bo *upload(struct sna *sna, struct sna_composite_channel *channel, PixmapPtr pixmap, |