7b51a11
From f0ae8cbbb8b88c04b256a6895c21a056dddbbbb1 Mon Sep 17 00:00:00 2001
7b51a11
From: Dave Airlie <airlied@redhat.com>
7b51a11
Date: Mon, 10 Sep 2012 11:14:20 +1000
7b51a11
Subject: [PATCH] xf86: return NULL for compat output if no outputs.
7b51a11
7b51a11
With outputless GPUs showing up we crash here if there are not outputs
7b51a11
try and recover with a bit of grace.
7b51a11
7b51a11
Signed-off-by: Dave Airlie <airlied@redhat.com>
7b51a11
---
7b51a11
 hw/xfree86/modes/xf86Crtc.c |    3 +++
7b51a11
 1 file changed, 3 insertions(+)
7b51a11
7b51a11
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
7b51a11
index 803de88..7419400 100644
7b51a11
--- a/hw/xfree86/modes/xf86Crtc.c
7b51a11
+++ b/hw/xfree86/modes/xf86Crtc.c
7b51a11
@@ -1764,6 +1764,9 @@ SetCompatOutput(xf86CrtcConfigPtr config)
7b51a11
     DisplayModePtr maxmode = NULL, testmode, mode;
7b51a11
     int o, compat = -1, count, mincount = 0;
7b51a11
 
7b51a11
+    if (config->num_output == 0)
7b51a11
+        return NULL;
7b51a11
+
7b51a11
     /* Look for one that's definitely connected */
7b51a11
     for (o = 0; o < config->num_output; o++) {
7b51a11
         test = config->output[o];
7b51a11
-- 
7b51a11
1.7.10.2
7b51a11