diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-11-14 13:05:00 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-11-14 13:05:00 +0000 |
commit | 6fc2928f578ae1e278c968d5c778d99d56bd667a (patch) | |
tree | 854d987c4c58fc8bf32c24da946c12e67e170f6a | |
parent | 99338ebe61917a07611cbc81cfaf70c0ec905014 (diff) |
sna: tidy assignment of composite damage
Make sure that the damage is always set, even if only to NULL, so that
we are safe if in future the operation state is not initially cleared.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/gen2_render.c | 6 | ||||
-rw-r--r-- | src/sna/gen3_render.c | 6 | ||||
-rw-r--r-- | src/sna/gen4_render.c | 6 | ||||
-rw-r--r-- | src/sna/gen5_render.c | 6 | ||||
-rw-r--r-- | src/sna/gen6_render.c | 7 | ||||
-rw-r--r-- | src/sna/gen7_render.c | 7 |
6 files changed, 20 insertions, 18 deletions
diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c index 1b1c8aa7..98a02cb4 100644 --- a/src/sna/gen2_render.c +++ b/src/sna/gen2_render.c @@ -1201,9 +1201,9 @@ gen2_composite_set_target(struct sna_composite_op *op, return FALSE; op->dst.bo = priv->gpu_bo; - if (!sna_damage_is_all(&priv->gpu_damage, - op->dst.width, op->dst.height)) - op->damage = &priv->gpu_damage; + op->damage = &priv->gpu_damage; + if (sna_damage_is_all(&priv->gpu_damage, op->dst.width, op->dst.height)) + op->damage = NULL; get_drawable_deltas(dst->pDrawable, op->dst.pixmap, &op->dst.x, &op->dst.y); diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c index 682fdd7c..d23f4221 100644 --- a/src/sna/gen3_render.c +++ b/src/sna/gen3_render.c @@ -2187,9 +2187,9 @@ gen3_composite_set_target(struct sna_composite_op *op, PicturePtr dst) return FALSE; op->dst.bo = priv->gpu_bo; - if (!sna_damage_is_all(&priv->gpu_damage, - op->dst.width, op->dst.height)) - op->damage = &priv->gpu_damage; + op->damage = &priv->gpu_damage; + if (sna_damage_is_all(op->damage, op->dst.width, op->dst.height)) + op->damage = NULL; get_drawable_deltas(dst->pDrawable, op->dst.pixmap, &op->dst.x, &op->dst.y); diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c index 7224e838..c0a32a40 100644 --- a/src/sna/gen4_render.c +++ b/src/sna/gen4_render.c @@ -1826,9 +1826,9 @@ gen4_composite_set_target(PicturePtr dst, struct sna_composite_op *op) return FALSE; op->dst.bo = priv->gpu_bo; - if (!sna_damage_is_all(&priv->gpu_damage, - op->dst.width, op->dst.height)) - op->damage = &priv->gpu_damage; + op->damage = &priv->gpu_damage; + if (sna_damage_is_all(&priv->gpu_damage, op->dst.width, op->dst.height)) + op->damage = NULL; DBG(("%s: gpu_only=%d, all-damaged=%d, damage=%p\n", __FUNCTION__, priv->gpu_only, sna_damage_is_all(&priv->gpu_damage, op->dst.width, op->dst.height), diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c index de1f9765..e9a61f06 100644 --- a/src/sna/gen5_render.c +++ b/src/sna/gen5_render.c @@ -1877,9 +1877,9 @@ gen5_composite_set_target(PicturePtr dst, struct sna_composite_op *op) op->dst.bo = priv->gpu_bo; - if (!sna_damage_is_all(&priv->gpu_damage, - op->dst.width, op->dst.height)) - op->damage = &priv->gpu_damage; + op->damage = &priv->gpu_damage; + if (sna_damage_is_all(&priv->gpu_damage, op->dst.width, op->dst.height)) + op->damage = NULL; DBG(("%s: bo=%p, damage=%p\n", __FUNCTION__, op->dst.bo, op->damage)); diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c index 66bbb9e9..164f69d5 100644 --- a/src/sna/gen6_render.c +++ b/src/sna/gen6_render.c @@ -2046,9 +2046,10 @@ gen6_composite_set_target(struct sna_composite_op *op, PicturePtr dst) return FALSE; op->dst.bo = priv->gpu_bo; - if (!sna_damage_is_all(&priv->gpu_damage, - op->dst.width, op->dst.height)) - op->damage = &priv->gpu_damage; + op->damage = &priv->gpu_damage; + if (sna_damage_is_all(&priv->gpu_damage, + op->dst.width, op->dst.height)) + op->damage = NULL; } get_drawable_deltas(dst->pDrawable, op->dst.pixmap, diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c index ca32cc35..0296841b 100644 --- a/src/sna/gen7_render.c +++ b/src/sna/gen7_render.c @@ -2177,9 +2177,10 @@ gen7_composite_set_target(struct sna_composite_op *op, PicturePtr dst) return FALSE; op->dst.bo = priv->gpu_bo; - if (!sna_damage_is_all(&priv->gpu_damage, - op->dst.width, op->dst.height)) - op->damage = &priv->gpu_damage; + op->damage = &priv->gpu_damage; + if (sna_damage_is_all(&priv->gpu_damage, + op->dst.width, op->dst.height)) + op->damage = NULL; } get_drawable_deltas(dst->pDrawable, op->dst.pixmap, |