From 0239e8727ad434e639587e7944288e3ef5d4390c Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 12 Dec 2012 14:26:33 +1000 Subject: [PATCH] fix hotplug issue with usb devices and large screens --- ...se-display-for-vx-vy-for-gpu-screens.patch | 30 +++++++++++++++ ...cleanup-properly-if-the-screen-fails.patch | 38 +++++++++++++++++++ xorg-x11-server.spec | 9 ++++- 3 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 0001-xf86crtc-don-t-use-display-for-vx-vy-for-gpu-screens.patch create mode 100644 0001-xfree86-hotplug-cleanup-properly-if-the-screen-fails.patch diff --git a/0001-xf86crtc-don-t-use-display-for-vx-vy-for-gpu-screens.patch b/0001-xf86crtc-don-t-use-display-for-vx-vy-for-gpu-screens.patch new file mode 100644 index 0000000..1d88c5b --- /dev/null +++ b/0001-xf86crtc-don-t-use-display-for-vx-vy-for-gpu-screens.patch @@ -0,0 +1,30 @@ +From 0c05db308881b3b462dae4101312c0034e6288ba Mon Sep 17 00:00:00 2001 +From: Fedora X Ninjas +Date: Wed, 12 Dec 2012 14:02:54 +1000 +Subject: [PATCH] xf86crtc: don't use display for vx/vy for gpu screens + +--- + hw/xfree86/modes/xf86Crtc.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c +index ba84e6b..61119b3 100644 +--- a/hw/xfree86/modes/xf86Crtc.c ++++ b/hw/xfree86/modes/xf86Crtc.c +@@ -2420,11 +2420,11 @@ xf86InitialConfiguration(ScrnInfoPtr scrn, Bool canGrow) + config->debug_modes = xf86ReturnOptValBool(config->options, + OPTION_MODEDEBUG, FALSE); + +- if (scrn->display->virtualX) ++ if (scrn->display->virtualX && !scrn->is_gpu) + width = scrn->display->virtualX; + else + width = config->maxWidth; +- if (scrn->display->virtualY) ++ if (scrn->display->virtualY && !scrn->is_gpu) + height = scrn->display->virtualY; + else + height = config->maxHeight; +-- +1.8.0.1 + diff --git a/0001-xfree86-hotplug-cleanup-properly-if-the-screen-fails.patch b/0001-xfree86-hotplug-cleanup-properly-if-the-screen-fails.patch new file mode 100644 index 0000000..9833e84 --- /dev/null +++ b/0001-xfree86-hotplug-cleanup-properly-if-the-screen-fails.patch @@ -0,0 +1,38 @@ +From 18c470b399f9f29797c1604dc8e1f11782b3f89d Mon Sep 17 00:00:00 2001 +From: Dave Airlie +Date: Wed, 12 Dec 2012 14:14:39 +1000 +Subject: [PATCH] xfree86/hotplug: cleanup properly if the screen fails to + initialise + +Due to another bug, the modesetting/udl driver would fail to init properly +on hotplug, when it did the code didn't clean up properly, and on removing +the device the server could crash. + +Found in F18 testing. + +Signed-off-by: Dave Airlie +--- + hw/xfree86/common/xf86platformBus.c | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c +index 0525e39..5866333 100644 +--- a/hw/xfree86/common/xf86platformBus.c ++++ b/hw/xfree86/common/xf86platformBus.c +@@ -438,7 +438,12 @@ xf86platformAddDevice(int index) + } + + scr_index = AddGPUScreen(xf86GPUScreens[i]->ScreenInit, 0, NULL); +- ++ if (scr_index == -1) { ++ xf86DeleteScreen(xf86GPUScreens[i]); ++ xf86UnclaimPlatformSlot(&xf86_platform_devices[index], NULL); ++ xf86NumGPUScreens = old_screens; ++ return -1; ++ } + dixSetPrivate(&xf86GPUScreens[i]->pScreen->devPrivates, + xf86ScreenKey, xf86GPUScreens[i]); + +-- +1.8.0.1 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 9c2abad..7eb32ba 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: 12%{?gitdate:.%{gitdate}}%{dist} +Release: 13%{?gitdate:.%{gitdate}}%{dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -140,6 +140,10 @@ Patch7063: 0001-linux-Prefer-ioctl-KDSKBMUTE-1-over-ioctl-KDSKBMODE-.patch # mustard: make the default queue length bigger to calm abrt down Patch7064: 0001-mieq-Bump-default-queue-size-to-512.patch +# some hotplug fixes/workaround +Patch7065: 0001-xfree86-hotplug-cleanup-properly-if-the-screen-fails.patch +Patch7066: 0001-xf86crtc-don-t-use-display-for-vx-vy-for-gpu-screens.patch + %global moduledir %{_libdir}/xorg/modules %global drimoduledir %{_libdir}/dri %global sdkdir %{_includedir}/xorg @@ -612,6 +616,9 @@ rm -rf $RPM_BUILD_ROOT %{xserver_source_dir} %changelog +* Wed Dec 12 2012 Dave Airlie 1.13.0-13 +- fix hotplug issue with usb devices and large screens + * Wed Dec 12 2012 Dave Airlie