From 3d627e530932d6830e9f9eacd7949b50e7d7fe8e Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Mon, 27 Aug 2012 15:30:07 +1000 Subject: [PATCH] port multi-seat video fixes from upstream --- ...wrapper-around-check-if-server-is-no.patch | 51 ++++++++++++++++ ...ect-seat-for-hotplugged-video-device.patch | 30 ++++++++++ ...-fix-multi-seat-video-device-support.patch | 59 +++++++++++++++++++ xorg-x11-server.spec | 10 +++- 4 files changed, 149 insertions(+), 1 deletion(-) create mode 100644 0001-config-udev-add-wrapper-around-check-if-server-is-no.patch create mode 100644 0002-config-udev-respect-seat-for-hotplugged-video-device.patch create mode 100644 0003-xf86-fix-multi-seat-video-device-support.patch diff --git a/0001-config-udev-add-wrapper-around-check-if-server-is-no.patch b/0001-config-udev-add-wrapper-around-check-if-server-is-no.patch new file mode 100644 index 0000000..c699e14 --- /dev/null +++ b/0001-config-udev-add-wrapper-around-check-if-server-is-no.patch @@ -0,0 +1,51 @@ +From 2103079b3e25f65d9aec7c56519d974e7ee6faca Mon Sep 17 00:00:00 2001 +From: Dave Airlie +Date: Mon, 27 Aug 2012 15:15:19 +1000 +Subject: [PATCH 1/3] config/udev: add wrapper around check if server is not + seat 0 + +this is a simple clean-up that is useful to stop further propogation +of this construct. + +Signed-off-by: Dave Airlie +--- + config/udev.c | 4 ++-- + include/hotplug.h | 2 ++ + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/config/udev.c b/config/udev.c +index 03aca28..adac273 100644 +--- a/config/udev.c ++++ b/config/udev.c +@@ -339,7 +339,7 @@ config_udev_pre_init(void) + #endif + + #ifdef HAVE_UDEV_MONITOR_FILTER_ADD_MATCH_TAG +- if (SeatId && strcmp(SeatId, "seat0")) ++ if (ServerIsNotSeat0) + udev_monitor_filter_add_match_tag(udev_monitor, SeatId); + #endif + if (udev_monitor_enable_receiving(udev_monitor)) { +@@ -368,7 +368,7 @@ config_udev_init(void) + #endif + + #ifdef HAVE_UDEV_ENUMERATE_ADD_MATCH_TAG +- if (SeatId && strcmp(SeatId, "seat0")) ++ if (ServerIsNotSeat0) + udev_enumerate_add_match_tag(enumerate, SeatId); + #endif + +diff --git a/include/hotplug.h b/include/hotplug.h +index 96b078d..ceec49c 100644 +--- a/include/hotplug.h ++++ b/include/hotplug.h +@@ -69,4 +69,6 @@ void config_odev_probe(config_odev_probe_proc_ptr probe_callback); + void NewGPUDeviceRequest(struct OdevAttributes *attribs); + void DeleteGPUDeviceRequest(struct OdevAttributes *attribs); + #endif ++ ++#define ServerIsNotSeat0 (SeatId && strcmp(SeatId, "seat0")) + #endif /* HOTPLUG_H */ +-- +1.7.10.2 + diff --git a/0002-config-udev-respect-seat-for-hotplugged-video-device.patch b/0002-config-udev-respect-seat-for-hotplugged-video-device.patch new file mode 100644 index 0000000..61669bd --- /dev/null +++ b/0002-config-udev-respect-seat-for-hotplugged-video-device.patch @@ -0,0 +1,30 @@ +From 32c9d01fe0168366b7c475ff3c9a574692917856 Mon Sep 17 00:00:00 2001 +From: Dave Airlie +Date: Mon, 27 Aug 2012 15:17:21 +1000 +Subject: [PATCH 2/3] config/udev: respect seat for hotplugged video devices. + +This respects the seat tag for hotplugged video devices at X start. + +Signed-off-by: Dave Airlie +--- + config/udev.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/config/udev.c b/config/udev.c +index adac273..89b6e57 100644 +--- a/config/udev.c ++++ b/config/udev.c +@@ -454,6 +454,10 @@ config_udev_odev_probe(config_odev_probe_proc_ptr probe_callback) + + udev_enumerate_add_match_subsystem(enumerate, "drm"); + udev_enumerate_add_match_sysname(enumerate, "card[0-9]*"); ++#ifdef HAVE_UDEV_ENUMERATE_ADD_MATCH_TAG ++ if (ServerIsNotSeat0) ++ udev_enumerate_add_match_tag(enumerate, SeatId); ++#endif + udev_enumerate_scan_devices(enumerate); + devices = udev_enumerate_get_list_entry(enumerate); + udev_list_entry_foreach(device, devices) { +-- +1.7.10.2 + diff --git a/0003-xf86-fix-multi-seat-video-device-support.patch b/0003-xf86-fix-multi-seat-video-device-support.patch new file mode 100644 index 0000000..2c08241 --- /dev/null +++ b/0003-xf86-fix-multi-seat-video-device-support.patch @@ -0,0 +1,59 @@ +From 41b5b320ed1509be1e885992fc804322161d1533 Mon Sep 17 00:00:00 2001 +From: Dave Airlie +Date: Mon, 27 Aug 2012 15:20:11 +1000 +Subject: [PATCH 3/3] xf86: fix multi-seat video device support. + +If we are not seat 0 the following apply: + +don't probe any bus other than platform +don't probe any drivers other than platform +assume the first platform device we match on the bus is the primary GPU. + +This just adds checks in the correct places to ensure this, and +with this X can now start on a secondary seat for an output device. + +Signed-off-by: Dave Airlie +--- + hw/xfree86/common/xf86Bus.c | 4 ++++ + hw/xfree86/common/xf86platformBus.c | 3 +++ + 2 files changed, 7 insertions(+) + +diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c +index 6de8409..40f4921 100644 +--- a/hw/xfree86/common/xf86Bus.c ++++ b/hw/xfree86/common/xf86Bus.c +@@ -81,6 +81,8 @@ xf86CallDriverProbe(DriverPtr drv, Bool detect_only) + if (drv->platformProbe != NULL) { + foundScreen = xf86platformProbeDev(drv); + } ++ if (ServerIsNotSeat0) ++ return foundScreen; + #endif + + #ifdef XSERVER_LIBPCIACCESS +@@ -214,6 +216,8 @@ xf86BusProbe(void) + { + #ifdef XSERVER_PLATFORM_BUS + xf86platformProbe(); ++ if (ServerIsNotSeat0) ++ return; + #endif + #ifdef XSERVER_LIBPCIACCESS + xf86PciProbe(); +diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c +index 502d3c4..0b06e16 100644 +--- a/hw/xfree86/common/xf86platformBus.c ++++ b/hw/xfree86/common/xf86platformBus.c +@@ -358,6 +358,9 @@ xf86platformProbeDev(DriverPtr drvp) + break; + } + else { ++ /* for non-seat0 servers assume first device is the master */ ++ if (ServerIsNotSeat0) ++ break; + if (xf86_platform_devices[j].pdev) { + if (xf86IsPrimaryPlatform(&xf86_platform_devices[j])) + break; +-- +1.7.10.2 + diff --git a/xorg-x11-server.spec b/xorg-x11-server.spec index 6dec01e..e1b300d 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.12.99.905 -Release: 2%{?gitdate:.%{gitdate}}%{dist} +Release: 3%{?gitdate:.%{gitdate}}%{dist} URL: http://www.x.org License: MIT Group: User Interface/X @@ -107,6 +107,11 @@ Patch7027: xserver-autobind-hotplug.patch Patch7030: 0001-xf86-crtc-don-t-free-config-name.patch Patch7031: 0002-dix-free-default-colormap-before-screen-deletion.patch +# backport multi-seat fixes from list +Patch7040: 0001-config-udev-add-wrapper-around-check-if-server-is-no.patch +Patch7041: 0002-config-udev-respect-seat-for-hotplugged-video-device.patch +Patch7042: 0003-xf86-fix-multi-seat-video-device-support.patch + %global moduledir %{_libdir}/xorg/modules %global drimoduledir %{_libdir}/dri %global sdkdir %{_includedir}/xorg @@ -579,6 +584,9 @@ rm -rf $RPM_BUILD_ROOT %{xserver_source_dir} %changelog +* Mon Aug 27 2012 Dave Airlie 1.12.99.905-3 +- port multi-seat video fixes from upstream + * Fri Aug 24 2012 Dave Airlie 1.12.99.905-2 - reintroduce auto config but working this time - fix two recycle/exit crashes