Add a scteken_set_cursor() (sc to teken) method and use it to fix
authorbde <bde@FreeBSD.org>
Sat, 11 Mar 2017 11:31:06 +0000 (11:31 +0000)
committerbde <bde@FreeBSD.org>
Sat, 11 Mar 2017 11:31:06 +0000 (11:31 +0000)
commit0d08ee7f2df1ef52f4dc1480627a1e6c5eb239be
treea84f6af84cf99337de95998fe1bc28e8e65e535f
parent65c1d51a948090effd29d123bae98b7fdc39bb69
Add a scteken_set_cursor() (sc to teken) method and use it to fix
some cases of initialization and resetting of the teken cursor position.
(This bad name is consistent with others, but it is too easy to confuse
with scteken_cursor() which goes in the opposite direction.)

The following cases were broken:
- for booting without a syscons console, the teken and sc positions for
  ttyv0 were (0, 0), but are supposed to be somewhere in the middle of
  the screen (after carefully preserved BIOS and loader messages) (at
  least if there is no mode switch that loses the messages).
- after mode switches, the screen is cleared and the cursor is supposed to
  be moved to (0, 0), but it was only moved there for sc.

The following case was hacked to work:
- for booting with a syscons console, it was arranged that scteken_init()
  for the console could see a nonzero cursor position and adjust, although
  this broke the sc seeing it in the non-console case above.
sys/dev/syscons/scterm-teken.c
sys/dev/syscons/syscons.c
sys/dev/syscons/syscons.h