[PATCH 2/3] xfree86: return NULL for compat output if no outputs.

Adam Jackson ajax at redhat.com
Tue Oct 29 17:09:26 CET 2013


From: Dave Airlie <airlied at redhat.com>

With outputless GPUs showing up we crash here if there are not outputs
try and recover with a bit of grace.

Reviewed-by: Adam Jackson <ajax at redhat.com>
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 hw/xfree86/modes/xf86Crtc.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 35845e8..ca829e8 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -1863,6 +1863,9 @@ SetCompatOutput(xf86CrtcConfigPtr config)
     DisplayModePtr maxmode = NULL, testmode, mode;
     int o, compat = -1, count, mincount = 0;
 
+    if (config->num_output == 0)
+        return NULL;
+
     /* Look for one that's definitely connected */
     for (o = 0; o < config->num_output; o++) {
         test = config->output[o];
-- 
1.8.3.1



More information about the xorg-devel mailing list