diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-11-10 11:57:21 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-11-10 21:01:00 +0000 |
commit | 2309f19638f8b2c35eb60fb44fa988aa5aaab57f (patch) | |
tree | 7f051a63746da9cb15e677c0fa17182aeeeee56d | |
parent | e65c2c54f5efcec16e97085dbc41042007c39151 (diff) |
sna/dri: Apply the damage for fullscreen async blits
Otherwise gnome-shell forgets to update. Eventually, I'll get the async
pageflipping bits merged into the Xserver and this path and its extra
bw wastage will be history! But still I'll be undermined by the
compositor, grrr.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_dri.c | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c index f0fcb94c..61a7b123 100644 --- a/src/sna/sna_dri.c +++ b/src/sna/sna_dri.c @@ -351,22 +351,25 @@ static void sna_dri_reference_buffer(DRI2Buffer2Ptr buffer) static void damage(PixmapPtr pixmap, RegionPtr region) { struct sna_pixmap *priv; - BoxPtr box; priv = sna_pixmap(pixmap); if (priv->gpu_only) return; - box = RegionExtents(region); - if (RegionNumRects(region) == 1 && - box->x1 <= 0 && box->y1 <= 0 && - box->x2 >= pixmap->drawable.width && - box->y2 >= pixmap->drawable.height) { + if (region == NULL) { +damage_all: sna_damage_all(&priv->gpu_damage, pixmap->drawable.width, pixmap->drawable.height); sna_damage_destroy(&priv->cpu_damage); } else { + BoxPtr box = RegionExtents(region); + if (region->data == NULL && + box->x1 <= 0 && box->y1 <= 0 && + box->x2 >= pixmap->drawable.width && + box->y2 >= pixmap->drawable.height) + goto damage_all; + sna_damage_add(&priv->gpu_damage, region); sna_damage_subtract(&priv->cpu_damage, region); } @@ -402,12 +405,13 @@ sna_dri_copy(struct sna *sna, DrawablePtr draw, RegionPtr region, int16_t dx, dy, sx, sy; int n; - DBG(("%s: dst -- attachment=%d, name=%d, handle=%d [screen=%d]\n", + DBG(("%s: dst -- attachment=%d, name=%d, handle=%d [screen=%d, sync=%d]\n", __FUNCTION__, dst_buffer->attachment, dst_buffer->name, dst_priv->bo->handle, - sna_pixmap_get_bo(sna->front)->handle)); + sna_pixmap_get_bo(sna->front)->handle, + sync)); DBG(("%s: src -- attachment=%d, name=%d, handle=%d\n", __FUNCTION__, src_buffer->attachment, @@ -486,11 +490,14 @@ sna_dri_copy(struct sna *sna, DrawablePtr draw, RegionPtr region, kgem_set_mode(&sna->kgem, KGEM_RENDER); } + damage(dst, region); if (region) { boxes = REGION_RECTS(region); n = REGION_NUM_RECTS(region); assert(n); } else { + pixman_region_init_rects(&clip, &box, 1); + region = &clip; boxes = &box; n = 1; } @@ -513,12 +520,9 @@ sna_dri_copy(struct sna *sna, DrawablePtr draw, RegionPtr region, if (flush) /* STAT! */ kgem_submit(&sna->kgem); - if (region) { - pixman_region_translate(region, dx, dy); - DamageRegionAppend(&dst->drawable, region); - DamageRegionProcessPending(&dst->drawable); - damage(dst, region); - } + pixman_region_translate(region, dx, dy); + DamageRegionAppend(&dst->drawable, region); + DamageRegionProcessPending(&dst->drawable); if (region == &clip) pixman_region_fini(&clip); |