[RFC xserver 4/4] modesetting: Treat inactive outputs as disconnected during PreInit

Daniel Martin daniel.martin at secunet.com
Thu Oct 29 06:58:12 PDT 2015

From: Daniel Martin <consume.noise at gmail.com>

If we fail to activate an output while we're in PreInit, the server
won't startup. This might happen if we run out of lanes.
Don't try to activate any output during PreInit, which the kernel didn't
set up yet by treating them as disconnected.

Signed-off-by: Daniel Martin <consume.noise at gmail.com>
This happens due to the "modesetting: Handle failures in setting a CRTC
to a DRM mode properly" patch on an ThinkPad X230 with 2 different
monitors attached. The intended use case for this setup is to have the
lid closed and drive the monitors only.
The xserver tries to activate all connected outputs on startup, but
fails on the third one. Because:
    [drm:ironlake_check_fdi_lanes] fdi link B uses too many lanes to enable link C

 hw/xfree86/drivers/modesetting/drmmode_display.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 4421578..3f3ba49 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -868,6 +868,14 @@ drmmode_output_detect(xf86OutputPtr output)
     switch (drmmode_output->mode_output->connection) {
         status = XF86OutputStatusConnected;
+        /* During PreInit (!configured), we shouldn't try to setup an output
+         * where the kernel didn't assigned an encoder yet. Because, if we
+         * fail to set it up at this point to server will exit. Treat it as
+         * disconnected for the moment. */
+        if (!output->scrn->configured &&
+            !drmmode_output->mode_output->encoder_id)
+            status = XF86OutputStatusDisconnected;
         status = XF86OutputStatusDisconnected;

More information about the xorg-devel mailing list