[PATCH] linux: Automatically ShareVTs if the VT are already in graphics mode

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 <chris@xxxxxxxxxxxxxxxxxx>
Cc: Daniel Vetter <daniel.vetter@xxxxxxxx>
Cc: Adam Jackson <ajax@xxxxxxxxxx>
---
 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

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux