diff options
author | avg <avg@FreeBSD.org> | 2011-12-21 12:21:22 +0000 |
---|---|---|
committer | avg <avg@FreeBSD.org> | 2011-12-21 12:21:22 +0000 |
commit | 8451340f0023a2f549ad478e31b8cdeaeeac1096 (patch) | |
tree | 2140af49ddfae101f52718af51aa290b8a8848f7 /sys/dev/syscons/syscons.c | |
parent | ac043fc94de8701975ba63c00025d1924276bccc (diff) | |
download | FreeBSD-src-8451340f0023a2f549ad478e31b8cdeaeeac1096.zip FreeBSD-src-8451340f0023a2f549ad478e31b8cdeaeeac1096.tar.gz |
sc_cngrab: switch to console vty when possible
In the future we may want to perform the switch even if the console is
currently in the graphics mode by trying to reset the video adapter first
(e.g. by executing vesa/vga bios post). That would probably require
some sort of a one-way flag as returning the control of the console back
to the interrupted application most likely would result in a mess.
Reviewed by: emaste
MFC after: 2 months
Diffstat (limited to 'sys/dev/syscons/syscons.c')
-rw-r--r-- | sys/dev/syscons/syscons.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index cc54de1..4910914 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -1615,7 +1615,14 @@ sc_cngrab(struct consdev *cp) { scr_stat *scp; + if (!cold && + sc_console->sc->cur_scp->index != sc_console->index && + sc_console->sc->cur_scp->smode.mode == VT_AUTO && + sc_console->smode.mode == VT_AUTO) + sc_switch_scr(sc_console->sc, sc_console->index); + scp = sc_console->sc->cur_scp; + if (scp->sc->kbd == NULL) return; |