diff mbox

uxa: Do not use RandR in hotplug if not available

Message ID 1427964339-8231-1-git-send-email-ofourdan@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Olivier Fourdan April 2, 2015, 8:45 a.m. UTC
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 it's safer to just return
if RandR is not available.

Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
---
 src/uxa/intel_display.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Chris Wilson April 2, 2015, 8:49 a.m. UTC | #1
On Thu, Apr 02, 2015 at 10:45:39AM +0200, Olivier Fourdan wrote:
> 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 it's safer to just return
> if RandR is not available.

In fact it makes little sense to install a udev monitor without RandR,
see 1a489142c8e6a4828348cc9afbd0f430d3b1e2d8
-Chris
diff mbox

Patch

diff --git a/src/uxa/intel_display.c b/src/uxa/intel_display.c
index a95b3de..e42a59d 100644
--- a/src/uxa/intel_display.c
+++ b/src/uxa/intel_display.c
@@ -2516,6 +2516,13 @@  intel_mode_hotplug(struct intel_screen_private *intel)
 	Bool found;
 	Bool changed = FALSE;
 	struct intel_mode *mode = intel->modes;
+
+#ifdef HAS_DIXREGISTERPRIVATEKEY
+	/* Without RR, nothing we can do here */
+	if (!dixPrivateKeyRegistered(rrPrivKey))
+		return;
+#endif
+
 	mode_res = drmModeGetResources(intel->drmSubFD);
 	if (!mode_res)
 		goto out;