freebsd-skq/sys/dev/vt
avg 91b888703f vt: fix problems with trying to switch to a closed VT
If there is an attempt to switch from a process-owned VT to a closed VT,
then vt(4) first requests the process to release its VT and only then
realizes that the target VT is closed and, so, the switch is not
possible.  So, the driver does not actually do any switch, but at the
same time the owning process is not notified about that and it does not
re-acquire the VT.

This change adds an early check for the target VT state, so that the
switch can be refused before the process coordination dance.
On top of that, the code now checks for a failure of vt_window_switch()
and calls vt_window_postswitch() for the current VT if it is in the
process mode.

Test Plan:
- configure VT1 - VT8 (ttyv0 - ttyv7) to be text consoles (run getty)
- configure VT9 (ttyv8) to rn X server
- make sure that the X server configuration allows VT switching
- leave VT10 - VT12 unconfigured
- while in the X server press Ctrl+Alt+F10
- without the patch, observe strange screen content and problems with
  keyboard input
- with the patch, observe that nothing happens

The problem has been observed and the fix has been tested with an nVidia
graphics card and the proprietary nvidia driver.
Not sure if that matters.

Reviewed by:	ray
MFC after:	2 weeks
Differential Revision: https://reviews.freebsd.org/D21704
2019-09-19 09:22:45 +00:00
..
colors
font
hw vt efifb: add suspend/resume calls 2019-05-21 18:42:36 +00:00
logo
vt_buf.c
vt_consolectl.c
vt_core.c vt: fix problems with trying to switch to a closed VT 2019-09-19 09:22:45 +00:00
vt_cpulogos.c Ignore kern.vt.splash_cpu without graphics 2019-07-08 13:46:26 +00:00
vt_font.c
vt_sysmouse.c Extract eventfilter declarations to sys/_eventfilter.h 2019-05-20 00:38:23 +00:00
vt.h Speed up vt(4) by keeping a record of the most recently drawn character and 2018-08-25 16:14:56 +00:00