From 7b51a1172d0ca9cb3fcd1b4e7e321934cfdd5583 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 10 Sep 2012 11:29:32 +1000 Subject: [PATCH] fix compat output segfault on output less gpus. --- ...NULL-for-compat-output-if-no-outputs.patch | 30 +++++++++++++++++++ xorg-x11-server.spec | 7 ++++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 0001-xf86-return-NULL-for-compat-output-if-no-outputs.patch diff --git a/0001-xf86-return-NULL-for-compat-output-if-no-outputs.patch b/0001-xf86-return-NULL-for-compat-output-if-no-outputs.patch new file mode 100644 index 0000000..a7fe6da --- /dev/null +++ b/0001-xf86-return-NULL-for-compat-output-if-no-outputs.patch @@ -0,0 +1,30 @@ +From f0ae8cbbb8b88c04b256a6895c21a056dddbbbb1 Mon Sep 17 00:00:00 2001 +From: Dave Airlie +Date: Mon, 10 Sep 2012 11:14:20 +1000 +Subject: [PATCH] xf86: return NULL for compat output if no outputs. + +With outputless GPUs showing up we crash here if there are not outputs +try and recover with a bit of grace. + +Signed-off-by: Dave Airlie +--- + 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 803de88..7419400 100644 +--- a/hw/xfree86/modes/xf86Crtc.c ++++ b/hw/xfree86/modes/xf86Crtc.c +@@ -1764,6 +1764,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.7.10.2 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 4f4b776..5477e01 100644 --- a/xorg-x11-server.spec +++ b/xorg-x11-server.spec @@ -43,7 +43,7 @@ Summary: X.Org X11 X server Name: xorg-x11-server Version: 1.13.0 -Release: 1%{?gitdate:.%{gitdate}}%{dist} +Release: 2%{?gitdate:.%{gitdate}}%{dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -109,6 +109,8 @@ Patch7042: 0003-xf86-fix-multi-seat-video-device-support.patch # backport dri2 drawable fix Patch7051: 0001-dri2-invalidate-drawable-after-sharing-pixmap.patch +Patch7052: 0001-xf86-return-NULL-for-compat-output-if-no-outputs.patch + %global moduledir %{_libdir}/xorg/modules %global drimoduledir %{_libdir}/dri %global sdkdir %{_includedir}/xorg @@ -581,6 +583,9 @@ rm -rf $RPM_BUILD_ROOT %{xserver_source_dir} %changelog +* Mon Sep 10 2012 Dave Airlie 1.13.0-2 +- fix compat output segfault on output less gpus. + * Fri Sep 07 2012 Dave Airlie 1.13.0-1 - rebase to upstream 1.13.0 release tarball