Skip to contentSkip to conversation

Do not register hotplug without RandR

PATCH In review Mariusz Bialonczyk 3 participants 3 messages Mar 29, 2017 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

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

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=98383

---
 src/drmmode_display.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
src/drmmode_display.c +15 -0
index dd9fa27..ae29d9a 100644
@@ -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;
Signature · 6 lines
2.11.0

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

A message that is not in the archive (sent off-list or not yet received): 20170329200750.14502-1-manio-RFXG7K41k5GsTnJN9+BGXg@public.gmane.org

#2 lore raw

Chris, could you have a look at this since it's allegedly your work in the intel driver and let us know if it's reasonable? I'm definitely not enough of an X driver guy to rule one way or the other.

Quoted 52 lines · Mariusz Bialonczyk

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

---
 src/drmmode_display.c | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
src/drmmode_display.c +15 -1
index dd9fa27..ae29d9a 100644
@@ -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

Quoted 4 lines

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

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

A message that is not in the archive (sent off-list or not yet received): CAKb7UvhOu_Ky9e3Rcx9+0q88QpguvyOQWxm-Jt9HOwsBw6Bwzw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org

#4 lore raw
Quoted 3 lines · Ilia Mirkin

Chris, could you have a look at this since it's allegedly your work in the intel driver and let us know if it's reasonable? I'm definitely not enough of an X driver guy to rule one way or the other.

Yup, it is from

commit 1a489142c8e6a4828348cc9afbd0f430d3b1e2d8

Author: Chris Wilson <[email protected]>
Date:   Tue Oct 23 23:43:50 2012 +0100

sna: Disable RandR hotplug events if Xinerama is enabled

Since RandR itself is disabled if Xinerama is enabled, for example with ZaphodHeads, calling RRGetInfo() upon a hotplug event generates an assertion.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55260

and covers a quite obscure mix of features that results in no RandR. Hmm, now with the link-status property there is a reason why the ddx might want to handle hotplug even if it doesn't propagate the event on, but so far link-status DP retraining in userspace is an i915.ko only "feature".
-Chris

Signature · 5 lines
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Nouveau mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/nouveau