]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Speed up vt(4) by keeping a record of the most recently drawn character and
authorColin Percival <cperciva@FreeBSD.org>
Sat, 25 Aug 2018 16:14:56 +0000 (16:14 +0000)
committerColin Percival <cperciva@FreeBSD.org>
Sat, 25 Aug 2018 16:14:56 +0000 (16:14 +0000)
commitee97b2336aa47851a1dc5681ea2017cc2193aac4
treeb71313b22544758bd031086c18aff3b055fa793e
parentfedded8d048045db541bcff2287ab894cb290bd4
Speed up vt(4) by keeping a record of the most recently drawn character and
the foreground and background colours.  In bitblt_text functions, compare
values to this cache and don't re-draw the characters if they haven't changed.
When invalidating the display, clear this cache in order to force characters
to be redrawn; also force full redraws between suspend/resume pairs since odd
artifacts can otherwise result.

When scrolling the display (which is where most time is spent within the vt
driver) this yields a significant performance improvement if most lines are
less than the width of the terminal, since this avoids re-drawing blanks on
top of blanks.

(Note that "re-drawing" here includes writing to the VGA text mode buffer; on
virtualized systems this can be extremely slow since it triggers a glyph
being rendered onto a 640x480 screen).

On a c5.4xlarge EC2 instance (with emulated text mode VGA) this cuts the time
spent in vt(4) during the kernel boot from 1200 ms to 700ms; on my laptop
(with a 3200x1800 display) the corresponding time is reduced from 970 ms down
to 155 ms.

Reviewed by: imp, cem
Approved by: re (gjb)
Relnotes: Significant speedup in vt(4) and the system boot generally.
Differential Revision: https://reviews.freebsd.org/D16723
sys/dev/vt/hw/efifb/efifb.c
sys/dev/vt/hw/fb/vt_early_fb.c
sys/dev/vt/hw/fb/vt_fb.c
sys/dev/vt/hw/fb/vt_fb.h
sys/dev/vt/hw/vga/vt_vga.c
sys/dev/vt/vt.h
sys/dev/vt/vt_core.c