From: Daniel Martin <consume.no...@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.no...@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) {
     case DRM_MODE_CONNECTED:
         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;
         break;
     case DRM_MODE_DISCONNECTED:
         status = XF86OutputStatusDisconnected;
-- 
2.6.1

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to