diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-12-29 11:59:37 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-12-29 11:59:37 +0000 |
commit | f53936407bd68f3d36ab525b4e0531fad58098e3 (patch) | |
tree | 3b4ace00e65440228b4a5f2c8afdbb26c756c334 | |
parent | c9f7f10bc528ac783f4e89bdb36fc56ccdcd0088 (diff) |
sna: Reset the source counter upon dirtying the shadow pixmap
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_accel.c | 4 | ||||
-rw-r--r-- | src/sna/sna_render.c | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 9c04e1dc..04382e44 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -783,6 +783,7 @@ done: list_move(&priv->list, &sna->dirty_pixmaps); } + priv->source_count = SOURCE_BIAS; priv->gpu = false; return true; } @@ -1063,6 +1064,7 @@ done: if (dx | dy) RegionTranslate(region, -dx, -dy); + priv->source_count = SOURCE_BIAS; priv->gpu = false; return true; } @@ -1867,6 +1869,7 @@ sna_put_zpixmap_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region, } if (priv->flush) list_move(&priv->list, &sna->dirty_pixmaps); + priv->source_count = SOURCE_BIAS; blt: get_drawable_deltas(drawable, pixmap, &dx, &dy); @@ -9204,6 +9207,7 @@ sna_pixmap_free_gpu(struct sna *sna, struct sna_pixmap *priv) pixmap->drawable.height); sna_pixmap_destroy_gpu_bo(sna, priv); + priv->source_count = SOURCE_BIAS; priv->gpu = false; return true; } diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c index c859244f..e7c3df44 100644 --- a/src/sna/sna_render.c +++ b/src/sna/sna_render.c @@ -337,7 +337,7 @@ move_to_gpu(PixmapPtr pixmap, const BoxRec *box) count = SOURCE_BIAS; priv = sna_pixmap(pixmap); if (priv) - count = ++priv->source_count; + count = priv->source_count++; DBG(("%s: migrate box (%d, %d), (%d, %d)? source count=%d, fraction=%d/%d [%d]\n", __FUNCTION__, @@ -346,7 +346,7 @@ move_to_gpu(PixmapPtr pixmap, const BoxRec *box) pixmap->drawable.width * pixmap->drawable.height, pixmap->drawable.width * pixmap->drawable.height / (w*h))); - return count*w*h >= pixmap->drawable.width * pixmap->drawable.height; + return count*w*h > pixmap->drawable.width * pixmap->drawable.height; } static Bool |