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 intel driver, original work by:
Chris Wilson <[email protected]>

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98383
Signed-off-by: Mariusz Bialonczyk <[email protected]>
---
 src/drmmode_display.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

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;
-- 
2.11.0

_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau

Reply via email to