If the VT we are using is already in KD_GRAPHICS mode, calling SETACTIVE
will silently fail. This leads to an indefinite hang as WAITACTIVE never
returns causing lockups on boot. This issue becomes apparent when the
kernel driver does not install a fbdev for kernel to use for consoles
and plymouth leaves the VT in graphics mode.

Signed-off-by: Chris Wilson <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: Adam Jackson <[email protected]>
---
 hw/xfree86/os-support/linux/lnx_init.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/hw/xfree86/os-support/linux/lnx_init.c 
b/hw/xfree86/os-support/linux/lnx_init.c
index 85709c6..b201310 100644
--- a/hw/xfree86/os-support/linux/lnx_init.c
+++ b/hw/xfree86/os-support/linux/lnx_init.c
@@ -86,6 +86,7 @@ xf86OpenConsole(void)
     MessageType from = X_PROBED;
     const char *tty0[] = { "/dev/tty0", "/dev/vc/0", NULL };
     const char *vcs[] = { "/dev/vc/%d", "/dev/tty%d", NULL };
+    int kdmode;
 
     if (serverGeneration == 1) {
         /*
@@ -188,6 +189,14 @@ xf86OpenConsole(void)
         else
             activeVT = vts.v_active;
 
+       /* If the console is already in graphics mode, e.g. if there is
+        * no text console in the kernel, we cannot do any VT switching
+        * and so must share the vt.
+        */
+       SYSCALL(ret = ioctl(xf86Info.consoleFd, KDGETMODE, &kdmode));
+       if (ret == 0 && kdmode == KD_GRAPHICS)
+               xf86Info.ShareVTs = TRUE;
+
 #if 0
         if (!KeepTty) {
             /*
-- 
2.1.0.rc1

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to