summaryrefslogtreecommitdiff
path: root/src/sna/gen5_render.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-01-24 11:29:26 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2014-01-24 11:32:43 +0000
commit4385724dc49dd090e0a5956e287f80b92ebd70e8 (patch)
tree7f0ec16e51d18acf2a2682808080f2ae108f327e /src/sna/gen5_render.c
parentc9e9c85fc7b21e231c2532fe1c75b92307e112ed (diff)
sna/gen2+: Inspect composite flags to discard unneeded CPU damage
We can now check whether the Composite operation will require existing CPU damage and if not discard it. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen5_render.c')
-rw-r--r--src/sna/gen5_render.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c
index 23b0c147..3396acd0 100644
--- a/src/sna/gen5_render.c
+++ b/src/sna/gen5_render.c
@@ -1571,6 +1571,7 @@ gen5_composite_set_target(struct sna *sna,
bool partial)
{
BoxRec box;
+ unsigned hint;
op->dst.pixmap = get_drawable_pixmap(dst->pDrawable);
op->dst.width = op->dst.pixmap->drawable.width;
@@ -1584,9 +1585,14 @@ gen5_composite_set_target(struct sna *sna,
} else
sna_render_picture_extents(dst, &box);
- op->dst.bo = sna_drawable_use_bo (dst->pDrawable,
- PREFER_GPU | FORCE_GPU | RENDER_GPU,
- &box, &op->damage);
+ hint = PREFER_GPU | FORCE_GPU | RENDER_GPU;
+ if (!partial) {
+ hint |= IGNORE_CPU;
+ if (w == op->dst.width && h == op->dst.height)
+ hint |= REPLACES;
+ }
+
+ op->dst.bo = sna_drawable_use_bo(dst->pDrawable, hint, &box, &op->damage);
if (op->dst.bo == NULL)
return false;
@@ -1863,7 +1869,7 @@ gen5_render_composite(struct sna *sna,
if (!gen5_composite_set_target(sna, tmp, dst,
dst_x, dst_y, width, height,
- op > PictOpSrc || dst->pCompositeClip->data)) {
+ flags & COMPOSITE_PARTIAL || op > PictOpSrc || dst->pCompositeClip->data)) {
DBG(("%s: failed to set composite target\n", __FUNCTION__));
goto fallback;
}