summaryrefslogtreecommitdiff
path: root/src/sna/gen6_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/gen6_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/gen6_render.c')
-rw-r--r--src/sna/gen6_render.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c
index d0e202f6..a117bf80 100644
--- a/src/sna/gen6_render.c
+++ b/src/sna/gen6_render.c
@@ -1828,6 +1828,7 @@ gen6_composite_set_target(struct sna *sna,
bool partial)
{
BoxRec box;
+ unsigned int hint;
op->dst.pixmap = get_drawable_pixmap(dst->pDrawable);
op->dst.format = dst->format;
@@ -1842,9 +1843,14 @@ gen6_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;
@@ -2159,7 +2165,7 @@ gen6_render_composite(struct sna *sna,
tmp->op = op;
if (!gen6_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))
goto fallback;
switch (gen6_composite_picture(sna, src, &tmp->src,