Home | History | Annotate | Download | only in wscons
History log of /src/sys/dev/wscons/wsdisplay_vconsvar.h
RevisionDateAuthorComments
 1.35  25-Jul-2025  martin PR 58582: make rasops and wsdisplay headers idempotent.
 1.34  14-Feb-2023  macallan branches: 1.34.6;
add flags for drivers to requesr R2L bit/byte-ordered fonts, default to
L2R, chack them in vcons_load_font() instead of just trusting that we'd get
what we need
 1.33  17-Jul-2022  riastradh branches: 1.33.4;
wsdisplay(4): Make most of struct vcons_data private.

More importantly, make sizeof(struct vcons_data) independent of
whether VCONS_DRAW_INTR &c. is defined.

Allocate the private space with kmem rather than in the caller.

This still doesn't have very good separation between interface
parameters and internal state, but it's better than before, and is
necessary to make genfb usable in modules.

In arm_simplefb.c, this removes use of the use_intr member. That
assignment became redundant with the introduction of vcons_earlyinit,
so there's no need to replace it by anything.
 1.32  17-Jul-2022  riastradh wsdisplay(4): Factor out WSDISPLAY_SCROLLSUPPORT logic.

Should find a way to avoid the #ifdefs in the .h file, but this makes
the code a good deal more legible and easier to maitain, at least.
No functional change intended.
 1.31  21-Jan-2021  macallan introduce a putchar() based implementation of cursor() in order to avoid
framebuffer reads
quite a speedup on arm64 / genfb
 1.30  17-Jan-2021  jmcneill Revert previous and introduce vcons_earlyinit, which is like vcons_init
except it does not setup a vcons_intr thread.
 1.29  17-Jan-2021  jmcneill Add appropriate memory barriers around sc_busy accesses. Fixes an issue
where character cells are sometimes not erased properly on aarch64 at
boot.
 1.28  16-Jan-2021  jmcneill Instead of defining VCONS_DONT_READ as the raw value of 0x30, instead
define it as (VCONS_NO_COPYCOLS|VCONS_NO_COPYROWS) for clarify. NFC.
 1.27  30-Nov-2018  msaitoh branches: 1.27.12;
Remove extra whitespaces.
 1.26  02-Jun-2017  macallan branches: 1.26.8; 1.26.10;
- add a cookie to show_screen_cb()
- call show_screen_cb() when loading a font into a visible screen, so this can
be used to track parameters by drivers that use the glyph cache
 1.25  19-May-2017  macallan add support for loading fonts in vcons and subsequently resizing screens
- drivers can use this by setting VCONS_LOADFONT and WSSCREEN_RESIZE
- each vcons screen can now have its own font and geometry
- while there, add support for xterm's ESC[18t to report the text buffer's
size

With this tou can:
wsfontload -N foo /usr/share/wscons/fonts/flori.816
wsconsctl -dw font=foo
currently this is limited to drivers that don't use the glyph cache, like genfb
 1.24  02-Jun-2016  macallan provide a default attribute
 1.23  18-Mar-2014  riastradh branches: 1.23.6;
Merge riastradh-drm2 to HEAD.
 1.22  27-Jan-2013  macallan branches: 1.22.2; 1.22.8;
fix a typo in a comment
 1.21  04-Jan-2012  macallan branches: 1.21.2; 1.21.6;
bump character buffers and cache to 32bit per character so flags we store
in the upper bits don't get lost
now autogenerated line drawing characters work with VCONS_DRAW_INTR and don't
get lost when switching screens
 1.20  25-May-2011  macallan branches: 1.20.4; 1.20.8;
remove VCONS_DRAW_ASYNC
it was always experimental, VCONS_DRAW_INTR is much simpler and Just Works.
 1.19  25-May-2011  macallan add a cache so when we update the screen we only redraw the character cells
that actually changed since last time. This gives a noticeable speedup on
slower hardware with dumb framebuffers.
For now this works with VCONS_DRAW_INTR and VCONS_DONT_READ only.
 1.18  18-Feb-2011  jmcneill add vcons_hard_switch, for switching w/o callouts (eg. entering ddb)
 1.17  09-Feb-2011  jmcneill add vcons_{enable,disable}_polling and genfb_{enable,disable}_polling
functions, to switch between intr and polling modes when VCONS_DRAW_INTR
is defined
 1.16  08-Feb-2011  jmcneill VCONS_DRAW_INTR changes:
- use softint instead of workqueue for drawing
- track scr_dirty with atomic_ops
 1.15  08-Feb-2011  jmcneill abuse config_interrupts to make sure we don't switch to 'intr' mode until
interrupts are enabled
 1.14  08-Feb-2011  jmcneill add support for command buffering in vcons. still a WIP, same limitations
as async drawing (no ddb, needs interrupts). you can try it with options
VCONS_DRAW_INTR. as with async, there are still occasional glitches.
 1.13  25-Jan-2011  macallan Add support for asynchronous drawing in vcons.
This is not finished but good enough for others to play with, enable with
options VCONS_DRAW_ASYNC
With this all drawing operations will be posted to a ring buffer instead
of being run directly, and run by a kernel thread. This avoids having to wait
for drawing operations to finish with the kernel lock held ( to a degree at
least ) and scrolling a (slow) framebuffer console should not disrupt other
operations anymore.
Problems:
- we need to switch back to synchronous operations when panicing or entering
ddb, also re-enable async drawing when leaving ddb
- there are still occasional glitches
tested on an SS20 with cg14 and cg6 for dumb and accelerated cases
 1.12  21-Sep-2010  macallan branches: 1.12.2; 1.12.4;
add separate flags for putchar() based copycols() and copyrows() methods
for hw that can accelerate one but not the other, like Sun's Creator series
VCONS_DONT_READ does the same as before
 1.11  18-Aug-2010  macallan Add copycols() and copyrows() methods which, instead of calling the underlying
driver methods, call the driver's putchar() method to redraw the affected
areas.
For unaccelerated framebuffers where reads are expensive and we can't spare
any memory for a shadow framebuffer. Enabled by setting VCONS_DONT_READ in
scr_flags
 1.10  20-Aug-2009  macallan branches: 1.10.2; 1.10.4;
add vcons_replay_msgbuf() for use by wsdisplay drivers to replay the message
buffer when attaching so older log messages will show up in the scrollback
buffer
Idea from gimpy
 1.9  28-Apr-2008  martin Remove clause 3 and 4 from TNF licenses
 1.8  06-Aug-2007  macallan branches: 1.8.22; 1.8.24; 1.8.26; 1.8.28;
add scrollback support
 1.7  09-Jul-2007  ad branches: 1.7.2; 1.7.6;
Merge some of the less invasive changes from the vmlocking branch:

- kthread, callout, devsw API changes
- select()/poll() improvements
- miscellaneous MT safety improvements
 1.6  04-Mar-2007  christos branches: 1.6.2; 1.6.4;
Kill caddr_t; there will be some MI fallout, but it will be fixed shortly.
 1.5  22-Sep-2006  elad branches: 1.5.4;
In struct vcons_data, don't depend on DIAGNOSTIC and always include
switch_poll_count.

okay chs@
 1.4  15-Apr-2006  jmmv branches: 1.4.2; 1.4.8; 1.4.12; 1.4.14; 1.4.16;
Remove the getwschar and putwschar accessops from wsdisplay drivers as
requested by uwe@. These were wrong because they were receiving an
emulcookie yet they were accessops (thus having to receive an accesscookie).
Instead, just handle the WSDISPLAYIO_{GET,PUT}WSCHAR ioctls from the
driver's ioctl accessop.

As this reduces the amount of code needed to handle these operations to
two small functions in each driver, remove the WSDISPLAY_CHARFUNCS kernel
option.

Reviewed by, at least, uwe@ and macallan@. No objections in tech-kern@.
 1.3  19-Feb-2006  macallan branches: 1.3.2; 1.3.4; 1.3.6;
add a flag to completely disable drawing on a screen
 1.2  18-Feb-2006  jmcneill Bunch of changes to wscons in preparation for splash screen support:
* Add WSDISPLAY_TYPE_VESA for vesafb. While here, fix a typo in a comment.
* Add WSDISPLAYIO_SSPLASH and WSDISPLAYIO_SPROGRESS ioctls. The former
toggles the splash screen on and off, and the latter updates the progress
animation.
* Prevent more than one hw driver from claiming to be the console.
* In vcons, keep two pointers to the screen's vcons_data. This lets us
override the original (ie with null emulops during boot), and restore
them later on.
 1.1  12-Feb-2006  macallan branches: 1.1.2;
framework for generic virtual consoles
 1.1.2.3  01-Mar-2006  yamt sync with head.
 1.1.2.2  18-Feb-2006  yamt sync with head.
 1.1.2.1  12-Feb-2006  yamt file wsdisplay_vconsvar.h was added on branch yamt-uio_vmspace on 2006-02-18 15:39:12 +0000
 1.3.6.1  24-May-2006  tron Merge 2006-05-24 NetBSD-current into the "peter-altq" branch.
 1.3.4.1  19-Apr-2006  elad sync with head.
 1.3.2.1  24-May-2006  yamt sync with head.
 1.4.16.1  22-Oct-2006  yamt sync with head
 1.4.14.2  09-Sep-2006  rpaulo sync with head
 1.4.14.1  15-Apr-2006  rpaulo file wsdisplay_vconsvar.h was added on branch rpaulo-netinet-merge-pcb on 2006-09-09 02:56:07 +0000
 1.4.12.1  18-Nov-2006  ad Sync with head.
 1.4.8.4  03-Sep-2007  yamt sync with head.
 1.4.8.3  30-Dec-2006  yamt sync with head.
 1.4.8.2  21-Jun-2006  yamt sync with head.
 1.4.8.1  15-Apr-2006  yamt file wsdisplay_vconsvar.h was added on branch yamt-lazymbuf on 2006-06-21 15:08:12 +0000
 1.4.2.2  22-Apr-2006  simonb Sync with head.
 1.4.2.1  15-Apr-2006  simonb file wsdisplay_vconsvar.h was added on branch simonb-timecounters on 2006-04-22 11:39:44 +0000
 1.5.4.1  12-Mar-2007  rmind Sync with HEAD.
 1.6.4.1  11-Jul-2007  mjf Sync with head.
 1.6.2.2  20-Aug-2007  ad Sync with HEAD.
 1.6.2.1  01-Jul-2007  ad Adapt to callout API change.
 1.7.6.1  09-Aug-2007  jmcneill Sync with HEAD.
 1.7.2.1  15-Aug-2007  skrll Sync with HEAD.
 1.8.28.2  06-Aug-2007  macallan add scrollback support
 1.8.28.1  06-Aug-2007  macallan file wsdisplay_vconsvar.h was added on branch matt-mips64 on 2007-08-06 03:11:33 +0000
 1.8.26.3  09-Oct-2010  yamt sync with head
 1.8.26.2  16-Sep-2009  yamt sync with head
 1.8.26.1  16-May-2008  yamt sync with head.
 1.8.24.1  18-May-2008  yamt sync with head.
 1.8.22.1  02-Jun-2008  mjf Sync with HEAD.
 1.10.4.2  31-May-2011  rmind sync with head
 1.10.4.1  05-Mar-2011  rmind sync with head
 1.10.2.1  22-Oct-2010  uebayasi Sync with HEAD (-D20101022).
 1.12.4.3  05-Mar-2011  bouyer Sync with HEAD
 1.12.4.2  17-Feb-2011  bouyer Sync with HEAD
 1.12.4.1  08-Feb-2011  bouyer Sync with HEAD
 1.12.2.1  06-Jun-2011  jruoho Sync with HEAD.
 1.20.8.1  18-Feb-2012  mrg merge to -current.
 1.20.4.2  22-May-2014  yamt sync with head.

for a reference, the tree before this commit was tagged
as yamt-pagecache-tag8.

this commit was splitted into small chunks to avoid
a limitation of cvs. ("Protocol error: too many arguments")
 1.20.4.1  17-Apr-2012  yamt sync with head
 1.21.6.3  03-Dec-2017  jdolecek update from HEAD
 1.21.6.2  20-Aug-2014  tls Rebase to HEAD as of a few days ago.
 1.21.6.1  25-Feb-2013  tls resync with head
 1.21.2.1  13-Feb-2013  riz Pull up following revision(s) (requested by skrll in ticket #818):
xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c: revision 1.14
xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb_driver.c: revision 1.15
external/mit/xorg/server/xorg-server/hw/xfree86/xorgos/Makefile: revision 1.32
external/mit/xorg/server/drivers/xf86-input-keyboard/Makefile: revision 1.15
sys/dev/wsfb/genfb.c: revision 1.49
distrib/sets/lists/xserver/md.evbarm: revision 1.1
sys/dev/wscons/wsdisplay_vconsvar.h: revision 1.22
external/mit/xorg/server/xorg-server/Makefile.common: revision 1.24
xsrc/external/mit/xf86-video-wsfb/dist/src/wsfb.h: revision 1.4
external/mit/xorg/server/drivers/Makefile: revision 1.61
sys/dev/wsfb/genfb.c: revision 1.50
enable X11 build for evbarm.
aprint_verbose -> aprint_debug
WSDISPLAY_TYPE_VC4 framebuffer is BGR
for WSDISPLAYIO_SMODE, if the bus ioctl handler returns EPASSTHROUGH, dont treat it as an error
default to swkbd mode on evbarm as well, now X without config should work
properly on BeagleBoard, RPi and the like
fix a typo in a comment
use WSDISPLAYIO_GET_FBINFO if available
 1.22.8.1  29-Jan-2014  riastradh Make genfb a little friendlier to modules.

This is not enough to make it actually work as a module itself, but
it's enough to make the i915drm module use genfb.
 1.22.2.1  18-May-2014  rmind sync with head
 1.23.6.2  28-Aug-2017  skrll Sync with HEAD
 1.23.6.1  09-Jul-2016  skrll Sync with HEAD
 1.26.10.1  10-Jun-2019  christos Sync with HEAD
 1.26.8.1  26-Dec-2018  pgoyette Sync with HEAD, resolve a few conflicts
 1.27.12.1  03-Apr-2021  thorpej Sync with HEAD.
 1.33.4.1  05-Jul-2023  martin Pull up following revision(s) (requested by abs in ticket #224):

sys/dev/wscons/wsdisplay_vconsvar.h: revision 1.34
sys/dev/wscons/wsdisplay_glyphcachevar.h: revision 1.6
sys/arch/sparc/dev/cgfourteen.c: revision 1.94
sys/arch/sparc/dev/cgfourteen.c: revision 1.95
sys/dev/sbus/mgx.c: revision 1.21
sys/dev/sbus/mgx.c: revision 1.22
sys/dev/sbus/mgx.c: revision 1.23
sys/dev/wscons/wsdisplay_vcons.c: revision 1.65
sys/dev/wscons/wsdisplay_vcons.c: revision 1.66
sys/dev/wscons/wsdisplay_glyphcache.c: revision 1.12
sys/arch/sparc/dev/sxvar.h: revision 1.5
sys/arch/sparc/dev/sx.c: revision 1.6
sys/arch/sparc/dev/sx.c: revision 1.7

make vcons_putchar_buffer() return a flag indicating if anything actually
changed, skip the actual drawing op if nothing did

add flags for drivers to requesr R2L bit/byte-ordered fonts, default to
L2R, chack them in vcons_load_font() instead of just trusting that we'd get
what we need

initialize the diagnostic register with the value suggested by the SunOS
header. This sets a bunch of undocumented bits and yields a 10% speed increase
when rendering antialiased text.

use macros compatible with xf86-video-suncg14 to issue SX instructions
much more readable, alignment weirdness is handled automatically and code is
interchangable

allow drivers to specify horizontal alignment of glyph cache cells
for things like SX which have alignment restrictions

add counter to periodically drain the instruction queue in order to avoid
stalling the MBus during long SX operations

adapted from xf86-video-suncg14
- use sx_wait() to avoid stalling the MBus
- request 32bit alignment for glyphcache cells

wait for the engine to go idle before issuing rectfill commands
we get occasional overlap with blit commands if we just wait for fifo slots
needs further investigation, it is possible that not all writes to drawing
engine registers are pipelined and of course we don't have docs

following a hunch...
- cache DEC and FG registers, only write them if the value actually changes
- wait for the engine to go idle before writing DEC
- wait for FIFO slots on everything else
with this we avoid waiting if possible and still avoid overlapping blit and
fill commands
 1.34.6.1  02-Aug-2025  perseant Sync with HEAD

RSS XML Feed