summaryrefslogtreecommitdiff
path: root/src/sna/gen8_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/gen8_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/gen8_render.c')
-rw-r--r--src/sna/gen8_render.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/sna/gen8_render.c b/src/sna/gen8_render.c
index 13e1662c..fcc37abd 100644
--- a/src/sna/gen8_render.c
+++ b/src/sna/gen8_render.c
@@ -1859,6 +1859,7 @@ gen8_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;
@@ -1874,9 +1875,14 @@ gen8_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;
@@ -2191,7 +2197,7 @@ gen8_render_composite(struct sna *sna,
tmp->op = op;
if (!gen8_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 (gen8_composite_picture(sna, src, &tmp->src,