diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-04-24 15:48:14 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-04-24 16:06:36 +0100 |
commit | 8eaafdb43998b5cdefb20b8098c558fa5decb115 (patch) | |
tree | 5fff9e22177ef799fcd3a8bd1ecb1cccd42d8271 /src | |
parent | b4871f1dac3d3c8d81101ef0f29eb69099ff2dcf (diff) |
sna: Prevent accessing an uninitialised region in move_area_to_gpu()
If we skip the migration, we need to avoid using the unitialiased
region. There is no bad consequence as both branches of the if are
no-ops, but it does silence the static checkers and should make the
predicate cheaper.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/sna/sna_accel.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 02b0a44c..43a6d709 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -2651,7 +2651,8 @@ done: if (flags & MOVE_WRITE) { priv->clear = false; priv->cpu = false; - if (priv->cpu_damage == NULL && + if (!DAMAGE_IS_ALL(priv->gpu_damage) && + priv->cpu_damage == NULL && box_inplace(pixmap, &r.extents)) { DBG(("%s: large operation on undamaged, promoting to full GPU\n", __FUNCTION__)); |