This fixes bad looking refresh when switching window: squares instead
of text, flashing screen, and so on. In the worst case, vt_flush() came
at a very inappropriate timing and the screen was not refreshed at all
(leaving squares all over the place).
This doesn't fix the flickering of the screen with vt_vga, because the
sync signal is temporarily stopped and the video memory is cleared.
MFC after: 1 week
Like r270273, this has no effect for now, because the cursor is always
drawn. This is in preparation of future changes to vd_bitbltchr_t API.
MFC after: 1 week
Currently, this has no effect, because the cursor is always redrawn
anyway. But this will be useful after improvements to the vd_bitbltchr_t
callback API.
The vt_device structure members used to store the position of the cursor
as of the last redraw are renamed from vd_mdirty{x,y} to vd_mold{x,y}.
The associated comment is fixed too. Also, their value is now expressed
in pixels, not in character columns/row.
MFC after: 1 week
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
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.
Rename vt_generate_vga_palette() to vt_generate_cons_palette() and
change it to build a palette where the color index is the same than in
terminal escape codes, not the VGA index. That's what TCHAR_CREATE()
uses and passes to vt(4).
The main differences between both orders are:
o Blue and red are swapped (1 <-> 4)
o Yellow and cyan are swapped (3 <-> 6)
The problem remained unnoticed, because the RGB bit indexes passed to
vt_generate_vga_palette() were reversed. This inversion was cancelled
by the colors inversions in the generated palette. For instance, red
(0xff0000) and blue (0x0000ff) have bytes in opposite order, but were
swapped in the palette. But after changing the value of blue (see last
paragraph), the modified color was in fact the red one.
This commit includes a fix to creator_vt.c, submitted by Nathan
Whitehorn: fb_cmsize is set to 16. Before this, the generated palette
would be overwritte. This fixes colors on sparc64 with a Creator3D
adapter.
While here, tune the palette to better match console colors and improve
the readability (especially the dark blue).
Submitted by: nwhitehorn (fix to creator_vt.c)
MFC after: 1 week
In several functions, vtbuf_putchar() in particular, the lock on vtbuf
is acquired twice:
1. once by the said functions;
2. once in vtbuf_dirty().
Now, vtbuf_dirty_locked() and vtbuf_dirty_cell_locked() allow to
acquire that lock only once.
This improves the input speed of vt(4). To measure the gain, a
50,000-lines file was displayed on the console using cat(1). The time
taken by cat(1) is reported below:
o On amd64, with vt_vga:
- before: 1.0"
- after: 0.5"
o On sparc64, with creator_vt:
- before: 13.6"
- after: 10.5"
MFC after: 1 week
the right register bank for the framebuffer. Disable the assigned-addresses
path on SPARC since it is just a hack for IBM PPC systems and was neither
relevant for nor worked on SPARC anyway.
framebuffer drivers. This lets ofwfb work with xf86-video-scfb and makes
the driver much more generic and less PCI-centric. This changes some
user-visible behavior and will require updates to the xorg-server port
on PowerPC when using ATI graphics cards.
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.
systems without either a CSM or real graphics drivers, such as my Lenovo
Haswell laptop.
This provides working X with the small complication of a console cursor
permanently overlaid on the upper-left corner of the screen that will be
dealt with later.
Also remove some redundant screen clearing.
rather than only drivers attached later on. This involves a small amount of
code duplication with dev/fb/fbd.c, which will fixed later on.
Also improve performance of vt_blank() by making it not read from the
framebuffer unnecessarily.
to uncacheable. This leads to execrable console performance. Once PMAP is
up, remap the framebuffer as write-combining. This reduces boot time on my
laptop by 60% when booting with EFI.
MFC after: 2 weeks
This includes:
o All directories named *ia64*
o All files named *ia64*
o All ia64-specific code guarded by __ia64__
o All ia64-specific makefile logic
o Mention of ia64 in comments and documentation
This excludes:
o Everything under contrib/
o Everything under crypto/
o sys/xen/interface
o sys/sys/elf_common.h
Discussed at: BSDcan
These changes prevent sysctl(8) from returning proper output,
such as:
1) no output from sysctl(8)
2) erroneously returning ENOMEM with tools like truss(1)
or uname(1)
truss: can not get etype: Cannot allocate memory
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
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
there is an environment variable which shall initialize the SYSCTL
during early boot. This works for all SYSCTL types both statically and
dynamically created ones, except for the SYSCTL NODE type and SYSCTLs
which belong to VNETs. A new flag, CTLFLAG_NOFETCH, has been added to
be used in the case a tunable sysctl has a custom initialisation
function allowing the sysctl to still be marked as a tunable. The
kernel SYSCTL API is mostly the same, with a few exceptions for some
special operations like iterating childrens of a static/extern SYSCTL
node. This operation should probably be made into a factored out
common macro, hence some device drivers use this. The reason for
changing the SYSCTL API was the need for a SYSCTL parent OID pointer
and not only the SYSCTL parent OID list pointer in order to quickly
generate the sysctl path. The motivation behind this patch is to avoid
parameter loading cludges inside the OFED driver subsystem. Instead of
adding special code to the OFED driver subsystem to post-load tunables
into dynamically created sysctls, we generalize this in the kernel.
Other changes:
- Corrected a possibly incorrect sysctl name from "hw.cbb.intr_mask"
to "hw.pcic.intr_mask".
- Removed redundant TUNABLE statements throughout the kernel.
- Some minor code rewrites in connection to removing not needed
TUNABLE statements.
- Added a missing SYSCTL_DECL().
- Wrapped two very long lines.
- Avoid malloc()/free() inside sysctl string handling, in case it is
called to initialize a sysctl from a tunable, hence malloc()/free() is
not ready when sysctls from the sysctl dataset are registered.
- Bumped FreeBSD version to indicate SYSCTL API change.
MFC after: 2 weeks
Sponsored by: Mellanox Technologies
"Terminus BSD Console" is a derivative of Terminus that is provided
by Mr. Dimitar Zhekov under the 2-clause BSD license for use by the FreeBSD vt(4) console.
Reviewed by: jhb
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
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
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
vt_grow may be called with a new size that's larger than previous but
does not require reallocation - for example, when the number of columns
is the same and new number of rows is less than the history size.
Prior to this change we would fail to update vb_scr_size, and then hit
a KASSERT when trying to write to the newly visible rows.
Sponsored by: The FreeBSD Foundation