summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2013-01-09 12:53:14 +1000
committerDave Airlie <airlied@redhat.com>2013-03-01 18:14:28 +1000
commit3ec35c45ca17f5ed6fd02c50fc49ae7b8d128dcb (patch)
tree432b2beac3423b73db3fe91e79a7bab0e8b709d8 /hw
parentda8ee26023fc2868fe970471195a5f3c86fb574b (diff)
xf86: actually set the compat output in the failure case
The previous fix for the previous fix, didn't fully work, If we don't set compat_output we end up doing derferences of arrays with -1, leading to valgrind warnings. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/modes/xf86Crtc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index b3ded5a33..b52b6ef9e 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -1848,8 +1848,10 @@ SetCompatOutput(xf86CrtcConfigPtr config)
}
/* All outputs are disconnected, select one to fake */
- if (!output && config->num_output)
- output = config->output[0];
+ if (!output && config->num_output) {
+ config->compat_output = 0;
+ output = config->output[config->compat_output];
+ }
return output;
}