[Intel-gfx] [PATCH] linux: Automatically ShareVTs if the VT are already in graphics mode
Chris Wilson
chris at chris-wilson.co.uk
Wed Aug 13 11:58:54 CEST 2014
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 at chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter at ffwll.ch>
Cc: Adam Jackson <ajax at redhat.com>
---
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
More information about the Intel-gfx
mailing list