diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-05-02 08:27:07 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-05-02 11:20:41 +0100 |
commit | 7b072074aa2b08c09a3d920d67f38ae73009ced6 (patch) | |
tree | c4a478e82063c3f818fdb822df00ae9aa539e82c /src/sna/sna_composite.c | |
parent | 81608b4da5b35993cd2071098235c14920b7236d (diff) |
sna: Refactor hints for GPU promotion of composite fills
The major change here is not do a full promotion if we are filling
through a clip region. The original intention was to catch doing the
initial clear of the background, but it was also triggering for drawing
rectangular outlines etc.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_composite.c')
-rw-r--r-- | src/sna/sna_composite.c | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/src/sna/sna_composite.c b/src/sna/sna_composite.c index 13c9802d..070faf4b 100644 --- a/src/sna/sna_composite.c +++ b/src/sna/sna_composite.c @@ -943,37 +943,37 @@ sna_composite_rectangles(CARD8 op, */ hint = can_render(sna) ? PREFER_GPU : 0; if (op <= PictOpSrc) { - if (priv->cpu_damage && - region_subsumes_damage(®ion, priv->cpu_damage)) { - DBG(("%s: discarding existing CPU damage\n", __FUNCTION__)); - if (priv->gpu_bo && priv->gpu_bo->proxy) { - assert(priv->gpu_damage == NULL); - kgem_bo_destroy(&sna->kgem, priv->gpu_bo); - priv->gpu_bo = NULL; + if (region.data == NULL) { + hint |= IGNORE_CPU; + if (region_subsumes_drawable(®ion, &pixmap->drawable)) + hint |= REPLACES; + if (priv->cpu_damage && + (hint & REPLACES || + region_subsumes_damage(®ion, priv->cpu_damage))) { + DBG(("%s: discarding existing CPU damage\n", __FUNCTION__)); + if (priv->gpu_bo && priv->gpu_bo->proxy) { + assert(priv->gpu_damage == NULL); + kgem_bo_destroy(&sna->kgem, priv->gpu_bo); + priv->gpu_bo = NULL; + } + sna_damage_destroy(&priv->cpu_damage); + list_del(&priv->flush_list); } - sna_damage_destroy(&priv->cpu_damage); - list_del(&priv->flush_list); - } - if (region_subsumes_drawable(®ion, &pixmap->drawable)) - hint |= REPLACES; - if (hint & REPLACES || - box_covers_pixmap(pixmap, ®ion.extents) || - box_inplace(pixmap, ®ion.extents)) { - DBG(("%s: promoting to full GPU\n", __FUNCTION__)); - if (priv->gpu_bo && priv->cpu_damage == NULL) { - assert(priv->gpu_bo->proxy == NULL); - sna_damage_all(&priv->gpu_damage, - pixmap->drawable.width, - pixmap->drawable.height); + if (hint & REPLACES || + box_inplace(pixmap, ®ion.extents)) { + if (priv->gpu_bo && priv->cpu_damage == NULL) { + DBG(("%s: promoting to full GPU\n", __FUNCTION__)); + assert(priv->gpu_bo->proxy == NULL); + sna_damage_all(&priv->gpu_damage, + pixmap->drawable.width, + pixmap->drawable.height); + } } } if (priv->cpu_damage == NULL) { DBG(("%s: dropping last-cpu hint\n", __FUNCTION__)); priv->cpu = false; } - - if (region.data == NULL) - hint |= IGNORE_CPU; } bo = sna_drawable_use_bo(&pixmap->drawable, hint, |