summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMariusz Bialonczyk <manio@skyboo.net>2017-03-29 22:07:50 +0200
committerIlia Mirkin <imirkin@alum.mit.edu>2017-04-03 10:24:22 -0400
commite9418e434311336e905b70553a5ed740838d90ad (patch)
tree178d18b3edec26f92ff77317e64bb3879df24ed9
parente472b47d15634a864c8c981ed588d882aceaf26b (diff)
Do not register hotplug without RandR
When using Xinerama, RandR is automatically disabled, and calling RR routines will trigger an assert() because the RR keys/resources are not set, leading to an Xserver abort. Hotplug makes little sense without RandR, so no need to install a udev monitor if RandR is not available. Ported from xf86-video-intel commit 1a489142c8e6a4828348cc9afbd0f430d3b1e2d8, original work by: Chris Wilson <chris@chris-wilson.co.uk> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98383 Signed-off-by: Mariusz Bialonczyk <manio@skyboo.net> Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
-rw-r--r--src/drmmode_display.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index dd9fa27..ae29d9a 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -1556,6 +1556,15 @@ drmmode_udev_notify(int fd, int notify, void *data)
}
#endif
+static bool has_randr(void)
+{
+#if HAS_DIXREGISTERPRIVATEKEY
+ return dixPrivateKeyRegistered(rrPrivKey);
+#else
+ return *rrPrivKey;
+#endif
+}
+
static void
drmmode_uevent_init(ScrnInfoPtr scrn)
{
@@ -1564,6 +1573,12 @@ drmmode_uevent_init(ScrnInfoPtr scrn)
struct udev *u;
struct udev_monitor *mon;
+ /* RandR will be disabled if Xinerama is active, and so generating
+ * RR hotplug events is then forbidden.
+ */
+ if (!has_randr())
+ return;
+
u = udev_new();
if (!u)
return;