Commit Graph

47 Commits

Author SHA1 Message Date
Jean-Sébastien Pédron
e861fb376a vt(4): If the cursor is globally disabled, don't mark its position as dirty
This avoids unnecessary redraw. In particular, during boot, where the
cursor is disabled and its fake position is [0;0], this triggered a
refresh of the whole screen each time vt_flush() is called.

MFC after:	1 week
2014-08-21 14:12:11 +00:00
Jean-Sébastien Pédron
c5dabe0780 vt(4): Mark cursor old position as dirty before reading the dirty area
Otherwise, the redraw is done during the next vt_flush run.

MFC after:	1 week
2014-08-21 13:28:48 +00:00
Jean-Sébastien Pédron
c4ad232a03 vt(4): Handle global and per-window mouse cursor toggle in one place
Before the global flag was set/unset using the CONS_MOUSECTL ioctl, and
the per-window flag through the MOUSE_SETLEVEL or MOUSE_SETMODE ioctls.

Also, if the cursor is already enabled/disabled, return immediatly. This
avoids to reset the cursor's position to the center of the screen.

This matches syscons' behavior.

While here, remove a trailing space and a redundant variable
declaration.
2014-08-21 13:04:34 +00:00
Nathan Whitehorn
0f3ec4da2f Retire vd_maskbitbltchr. The same functionality can be obtained by testing
for mask != NULL in vd_bitbltchr, which all implementations of vd_bitbltchr()
were doing anyway.
2014-08-07 21:00:16 +00:00
Aleksandr Rybalko
45dc370059 Allow to disable some special key combinations handled by vt(4), like debug
request, reboot request.

Requested by:	Claude Buisson

Sponsored by:	The FreeBSD Foundation
2014-08-03 13:07:25 +00:00
Aleksandr Rybalko
eeadf17a21 Revise font initialization handling.
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2014-07-28 14:41:22 +00:00
Aleksandr Rybalko
ba5c073ae3 Update comments.
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2014-07-28 14:37:59 +00:00
Aleksandr Rybalko
5cc762d4c0 Remove special handling of console window size. It's done in vt_upgrade() for
all windows.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2014-07-28 14:35:21 +00:00
Aleksandr Rybalko
9a0f8af7d4 Avoid embedding buffers into static virtual terminal window.
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2014-07-28 14:22:34 +00:00
Aleksandr Rybalko
8b1932a845 o Remove useless debug string.
o Fix indent.

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2014-07-28 14:15:41 +00:00
Ed Maste
4a87818e07 Hide syscons-specific workaround under DEV_SC
This change is a bit ugly, but so is the coupling between the i915
driver and syscons.  It isn't worth developing a more elegant solution
only to support the legacy syscons console.
2014-07-21 16:38:05 +00:00
Aleksandr Rybalko
97f3c4e8a4 Fix inconsistent token parameters for kbd_allocate() and kbd_release() in vt(4).
PR:		191306
Submitted by:	jau789@gmail.com
Sponsored by:	The FreeBSD Foundation
2014-07-09 14:36:03 +00:00
Marius Strobl
7344ee184b In order to get vt(4) a bit closer to the feature set provided by sc(4),
implement options TERMINAL_{KERN,NORM}_ATTR. These are aliased to
SC_{KERNEL_CONS,NORM}_ATTR and like these latter, allow to change the
default colors of normal and kernel text respectively.
Note on the naming: Although affecting the output of vt(4), technically
kern/subr_terminal.c is primarily concerned with changing default colors
so it would be inconsistent to term these options VT_{KERN,NORM}_ATTR.
Actually, if the architecture and abstraction of terminal+teken+vt would
be perfect, dev/vt/* wouldn't be touched by this commit at all.

Reviewed by:	emaste
MFC after:	3 days
Sponsored by:	Bally Wulff Games & Entertainment GmbH
2014-06-27 19:57:57 +00:00
Ed Maste
59644098f8 Use a common tunable to choose between vt(4)/sc(4)
With this change and previous work from ray@ it will be possible to put
both in GENERIC, and have one enabled by default, but allow the other to
be selected via the loader.

(The previous implementation had separate kern.vt.disable and
hw.syscons.disable tunables, and would panic if both drivers were
compiled in and neither was explicitly disabled.)

MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2014-06-27 17:50:33 +00:00
Aleksandr Rybalko
b229e4727b Suspend vt(4) initialization if "kern.vt.disable" kenv is set.
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2014-06-18 22:30:22 +00:00
Aleksandr Rybalko
bfc00339de Fix case when vt(4) started w/o driver assigned.
o Always init locks and cv ASAP.
o Initialize driver-independent parts even if driver probing fail.
o Allow to call vt_upgrade anytime, for later loaded drivers.
o New window flag VWF_READY, to track if window already initialized.
Other updates:
o Pass vd as a cookie for kbd_allocate.
o Do not blank window on driver replacement.

Tested by:	hselasky (RPi), emaste(VGA, EFIFB, KMS), me

MFC after:	7 days
Sponsored by:	The FreeBSD Foundation
2014-06-03 13:33:43 +00:00
Ed Maste
c6317b8376 Correct vt(4) border calculations on font switch
If a vt(4) font does not exactly fit the screen dimensions, the console
window is offset so that it is centered.  A rectangle is drawn at the
top, left, right, and bottom of the screen, to erase any leftovers that
are outside of the new usable console area.

If the x offset or y offset is 0 then the left border or top border
respectively is not drawn.  The right and bottom borders may be one
pixel larger than necessary due to rounding, and are always drawn.

Prior to this change a 0 offset would result in a panic when calling
vt_drawrect with an x or y coordinate of -1.

Sponsored by:	The FreeBSD Foundation
2014-05-29 21:52:42 +00:00
Aleksandr Rybalko
c23c960364 Proper fix of VT_LOCKSWITCH ioctl.
Sponsored by:	The FreeBSD Foundation
2014-05-22 09:31:18 +00:00
Aleksandr Rybalko
7ee92f6e08 Fix tty locking.
o Correct expected values for VT_LOCKSWITCH ioctl.
o Check current window for locked state.

Sponsored by:	The FreeBSD Foundation
2014-05-21 11:15:38 +00:00
Aleksandr Rybalko
ae866603c7 Update terminal sizes in any case when new vt(4) driver arrive.
(Plus remove one unused newline)

Sponsored by:	The FreeBSD Foundation
2014-05-12 19:29:38 +00:00
Aleksandr Rybalko
8a25d54521 Fix scrollback.
Sponsored by:	The FreeBSD Foundation
2014-05-08 13:46:36 +00:00
Aleksandr Rybalko
4efec7a83d Fix possible divide by zero.
Spotted by:	many

Sponsored by:	The FreeBSD Foundation
2014-05-07 13:53:38 +00:00
Aleksandr Rybalko
bf8ed13db7 Implement KDMKTONE ioctl.
Submitted by:	Matthew D.Fuller <fullermd@over-yonder.net> (original version)
MFC:		7 days
PR:		kern/189170

Sponsored by:	The FreeBSD Foundation
2014-05-06 13:52:13 +00:00
Aleksandr Rybalko
1928c49270 Set of updates to vt(4) core part.
o Declare vt(4) drivers dataset.
o Create single static structures for all early drivers.
o Add vt(4) to be by default in the kernel consoles list.
o Create one more sysinit point, to be able to initialize memory and lock
	requirement of early drivers.
o Implement early drivers select. (Only best available will be selected).
o Fix one missed "return (0)" for VTYLOCK.
o Improve locking for cases when one driver replace another.
o Make driver replacement notification less debug-look-like.

Minor spell fixes.

Sponsored by:	The FreeBSD Foundation
2014-05-05 21:44:53 +00:00
Aleksandr Rybalko
faff39aaef Update to fix at r264244.
o Unmute terminal when done with driver replacement.
o Move init fonts to early point.
o Minor cleanup.

MFC after:	6 days
X-MFC-with:	r264244 r264242
Sponsored by:	The FreeBSD Foundation
2014-04-08 14:18:39 +00:00
Aleksandr Rybalko
187a54a1db Fix cursor color in reverse video mode.
PR:		kern/188196
Submitted by:	Claude Buisson <clbuisson@orange.fr> (original version)
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2014-04-08 14:14:25 +00:00
Aleksandr Rybalko
248fe734f5 Fix panic on load new driver while vt(4) is in VGA textmode.
o Mute terminal while vt(4) driver change in progress.
o Reset VDF_TEXTMODE before init new driver.
o Assign default font, if new driver is not in TEXTMODE.
o Do not update screen while driver changing.

Resolved by:	adrian
Reported by:	tyler
MFC after:	7 days
Sponsored by:	The FreeBSD Foundation
2014-04-07 22:49:41 +00:00
Aleksandr Rybalko
1da9f0d73a o Add new vd_driver method to do bitblt with mask, named vd_maskbitbltchr.
o Move vd_bitbltchr vga's driver method to vd_maskbitbltchr.
o Implement new vd_bitbltchr method for vga driver. (It do single write for 8
	pixels, have to be a bit faster).

MFC after:	7 days
Sponsored by:	The FreeBSD Foundation
2014-03-28 22:04:27 +00:00
Aleksandr Rybalko
fe930c5220 Revert r263321.
vt(9) crash on resume fixed, but Xorg still have damaged screen on resume (at
least with i915kms), so better to switch to VT0 before suspend and back on
resume.

Sponsored by:	The FreeBSD Foundation
2014-03-27 14:07:36 +00:00
Aleksandr Rybalko
231f843f55 Fix crash on resume in vt(9).
Statically allocated terminal window have not initialized callout handler, so we
have to initialize it even for existing window if it is console window.

Reported by:	gjb and many
Tested by:	gjb
MFC after:	7 days
Sponsored by:	The FreeBSD Foundation
2014-03-27 09:24:09 +00:00
Aleksandr Rybalko
b3ea9d99ed Switch kern.vt.suspendswitch to 0 by default (disabled).
kern.vt.suspendswitch - sysctl/tunable which enable switch to VT0 before going
to suspend and switch back after resume.

MFC after:	7 days
2014-03-18 22:22:47 +00:00
Aleksandr Rybalko
4d55a4250e Add vt_set_border function to help to change border color.
Use vt_set_border to reset color after font changed (different font size may
change border sizes)

Sponsored by:	The FreeBSD Foundation
2014-02-06 15:16:38 +00:00
Aleksandr Rybalko
19e314e7c3 Fix AltGr, we should not only skip RAlt key release if enable_altgr is set, but
also process RAlt key press same way.

Sponsored by:	The FreeBSD Foundation
2013-12-26 14:25:37 +00:00
Aleksandr Rybalko
650c134f19 Use statndard (syscons) way to disable bell.
Testesd by:	markj

Sponsored by:	The FreeBSD Foundation
2013-12-25 19:07:14 +00:00
Aleksandr Rybalko
7a1a32c4ef o Add virtual terminal mmap request handler.
o Forward termianl framebuffer ioctl to fbd.
o Forward terminal mmap request to fbd.
o Move inclusion of sys/conf.h to vt.h.

Sponsored by:	The FreeBSD Foundation
2013-12-23 18:09:10 +00:00
Aleksandr Rybalko
a01571e0a7 Update names from newcons to vt(9).
Sponsored by:	The FreeBSD Foundation
2013-12-22 15:33:15 +00:00
Aleksandr Rybalko
008f5a254f Enable AltGr key by default.
Asked by:	many
Sponsored by:	The FreeBSD Foundation
2013-12-20 15:45:22 +00:00
Aleksandr Rybalko
d454a052df Set mouse level per window, instead of global.
Sponsored by:	The FreeBSD Foundation
2013-12-20 15:37:57 +00:00
Aleksandr Rybalko
0a036e525d Enable mouse support for terminal clients (like dialog(1)).
Sponsored by:	The FreeBSD Foundation
2013-12-19 15:31:20 +00:00
Aleksandr Rybalko
fdc3c84b5b Skip processing of R.Alt as a second Alt key, if sysctl kern.vt.enable_altgr is
not zero.

Submitted by:	andreast
Sponsored by:	The FreeBSD Foundation
2013-12-18 00:14:58 +00:00
George V. Neville-Neil
8528c7c86e Fix a panic when booting with kernels that have FREEBBSD_COMPAT
4, 5, 6 or 43 by only thunking the data parameter for old ioctls
compatability ioctls instead of doing it for all of them.

Submitted by:	jhb@
2013-12-11 17:18:10 +00:00
Konstantin Belousov
68a9d67c29 The opt_*.h headers must be included before any system header, except
sys/cdefs.h.  In particular, in case of COMPAT_43, param.h includes
sys/types.h, which includes sys/select.h, which includes
sys/_sigset.h.  The _sigset.h customizes the provided definions based
on COMPAT_43, eliminating osigset_t if symbol is not defined.  The
sys/proc.h is included after opt_compat.h and needs osigset_t.

Move opt_compat.h inclusion into the right place.

Sponsored by:	The FreeBSD Foundation
2013-12-10 22:33:02 +00:00
Aleksandr Rybalko
c323f8035b o Compat options have to be defined before sys/ioccom.h included, so move
inclusion of right after sys/param.h.
o Only vt_core module use compat options, move it from common header to module.

Reported by:	Larry Rosenman ler at lerctr dot org

Sponsored by:	The FreeBSD Foundation
2013-12-09 15:28:34 +00:00
Aleksandr Rybalko
0f49db6e47 Respect SC_NO_CUTPASTE option. It disable mouse cursor and cut/paste support
for vt(9). Note: /dev/sysmouse not affected.

Sponsored by:	The FreeBSD Foundation
2013-12-09 15:01:34 +00:00
Aleksandr Rybalko
37fd54ff81 o Build syscons(9)'s splash support if both sc and splash are enabled.
o Include opt_splash.h for vt(9) to know when splash device is enabled.
o Build logo_freebsd.c only if splash and vt are enabled.
o Include opt_compat.h to know when we have to respect compatibility.

Sponsored by:	The FreeBSD Foundation
2013-12-08 22:49:12 +00:00
Aleksandr Rybalko
5ffea144c7 Fix td_frame flags for i386.
Submitted by:	jilles

Sponsored by:	The FreeBSD Foundation
2013-12-06 23:12:21 +00:00
Aleksandr Rybalko
27cf7d04ef Merge VT(9) project (a.k.a. newcons).
Reviewed by:	nwhitehorn
MFC_to_10_after:	re approval

Sponsored by:	The FreeBSD Foundation
2013-12-05 22:38:53 +00:00