sna/gen2+: Do not force migration to GPU for very large objects

If the target is larger than the maximum render size, allow us not to
migrate to the GPU if it is entirely damaged on the CPU.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2016-06-21 21:19:46 +01:00
parent f1c757e451
commit c28e62f94f
8 changed files with 24 additions and 8 deletions

View File

@ -1619,7 +1619,9 @@ gen2_composite_set_target(struct sna *sna,
} else
sna_render_picture_extents(dst, &box);
hint = PREFER_GPU | FORCE_GPU | RENDER_GPU;
hint = PREFER_GPU | RENDER_GPU;
if (!need_tiling(sna, op->dst.width, op->dst.height))
hint |= FORCE_GPU;
if (!partial) {
hint |= IGNORE_DAMAGE;
if (w == op->dst.width && h == op->dst.height)

View File

@ -3228,7 +3228,9 @@ gen3_composite_set_target(struct sna *sna,
} else
sna_render_picture_extents(dst, &box);
hint = PREFER_GPU | FORCE_GPU | RENDER_GPU;
hint = PREFER_GPU | RENDER_GPU;
if (!need_tiling(sna, op->dst.width, op->dst.height))
hint |= FORCE_GPU;
if (!partial) {
hint |= IGNORE_DAMAGE;
if (w == op->dst.width && h == op->dst.height)

View File

@ -1647,7 +1647,9 @@ gen4_composite_set_target(struct sna *sna,
} else
sna_render_picture_extents(dst, &box);
hint = PREFER_GPU | FORCE_GPU | RENDER_GPU;
hint = PREFER_GPU | RENDER_GPU;
if (!need_tiling(sna, op->dst.width, op->dst.height))
hint |= FORCE_GPU;
if (!partial) {
hint |= IGNORE_DAMAGE;
if (w == op->dst.width && h == op->dst.height)

View File

@ -1599,7 +1599,9 @@ gen5_composite_set_target(struct sna *sna,
} else
sna_render_picture_extents(dst, &box);
hint = PREFER_GPU | FORCE_GPU | RENDER_GPU;
hint = PREFER_GPU | RENDER_GPU;
if (!need_tiling(sna, op->dst.width, op->dst.height))
hint |= FORCE_GPU;
if (!partial) {
hint |= IGNORE_DAMAGE;
if (w == op->dst.width && h == op->dst.height)

View File

@ -1908,7 +1908,9 @@ gen6_composite_set_target(struct sna *sna,
} else
sna_render_picture_extents(dst, &box);
hint = PREFER_GPU | FORCE_GPU | RENDER_GPU;
hint = PREFER_GPU | RENDER_GPU;
if (!need_tiling(sna, op->dst.width, op->dst.height))
hint |= FORCE_GPU;
if (!partial) {
hint |= IGNORE_DAMAGE;
if (w == op->dst.width && h == op->dst.height)

View File

@ -2150,7 +2150,9 @@ gen7_composite_set_target(struct sna *sna,
} else
sna_render_picture_extents(dst, &box);
hint = PREFER_GPU | FORCE_GPU | RENDER_GPU;
hint = PREFER_GPU | RENDER_GPU;
if (!need_tiling(sna, op->dst.width, op->dst.height))
hint |= FORCE_GPU;
if (!partial) {
hint |= IGNORE_DAMAGE;
if (w == op->dst.width && h == op->dst.height)

View File

@ -1996,7 +1996,9 @@ gen8_composite_set_target(struct sna *sna,
} else
sna_render_picture_extents(dst, &box);
hint = PREFER_GPU | FORCE_GPU | RENDER_GPU;
hint = PREFER_GPU | RENDER_GPU;
if (!need_tiling(sna, op->dst.width, op->dst.height))
hint |= FORCE_GPU;
if (!partial) {
hint |= IGNORE_DAMAGE;
if (w == op->dst.width && h == op->dst.height)

View File

@ -2002,7 +2002,9 @@ gen9_composite_set_target(struct sna *sna,
} else
sna_render_picture_extents(dst, &box);
hint = PREFER_GPU | FORCE_GPU | RENDER_GPU;
hint = PREFER_GPU | RENDER_GPU;
if (!need_tiling(sna, op->dst.width, op->dst.height))
hint |= FORCE_GPU;
if (!partial) {
hint |= IGNORE_DAMAGE;
if (w == op->dst.width && h == op->dst.height)