Subject: weird problems with non-default wscons screen types vs. X11
To: NetBSD/i386 Discussion List <port-i386@NetBSD.ORG>
From: Greg A. Woods <woods@weird.com>
List: port-i386
Date: 07/11/2004 16:45:41
I've been having some weird problems with the font loading in wscons for
non-default screen types, such as "80x50".

I'm loading the standard vt220l.808 font of course to get the necessary
8-pixel high font for "80x50".

On my somewhat hacked-upon netbsd-1-6 system running XFree86 4.4.0 I can
never get the right font to display on any non-default screens,
regardless of whether the Xserver has run since boot or not.  I've even
tried loading it directly into the kernel at compile time with "options
FONT_VT220L8x8", but with no luck.  (I also tried changing the
VGA_CONSOLE_SCREETYPE to "80x50", but that doesn't seem to have any
effect when a serial console is used)

However even on completely stock 1.6.2 with XFree86 4.2.1 I'm seeing
problems when switching back from the X11 screen to a vtXX with, say, a
screen type of "80x50".  The correct font is not loaded and I only see
the top halves of the 16-high default font's glyphs.

Note also that on my hacked-upon system I'm using a serial console and
configuring vt00 from /etc/wscons.conf.  I tried configuring vt04 with
the standard "80x25" screen type, but switching to it and then to an
"80x50" vtXX doesn't have the same effect as on the stock system.

The difference between the two systems is that on the stock system if I
switch to vt00 (where the screen type is of course the default "80x25"),
and then I switch again to a vtXX with a type of "80x50", then the right
font is loaded.

I'm guessing the use of the serial console is part of the problem --
i.e. that the font lookup somehow doesn't ever happen if the first vt00
isn't automatically configured by the kernel when and attached as a
console.  Someone responsible for maintaining wscons should be regularly
using a system with a serial console and with wscons just to be sure
this combination works properly all the time.  :-)  (personally I can't
even imagine doing serious kernel development on any system without
using a serial console on the test system! :-)

I'm also guessing that wsdisplay doesn't re-initialize the right font
usage after the Xserver switches back to any another screen unless the
original kernel-configured vt00 is cycled through.

In poking through the code I've not got much further than staring at
rcons_init(), which seems to hard-code use of the static gallant19 font
from wscons_rfont.h (which among other things would seem to preclude use
on the main console screen of any higher density screen types that need
shorter fonts), but I've not yet even really figured out how the right
font is chosen when switching between vtXX screens.

I was thinking of extending wsconsctl to allow runtime specification of
the font to be used so that I could at least be sure I could manually
force the right font to be used, but I've not got that far yet.....

(It sure would be nice if there were a wsconsctl option to flip between
virtual screens from the command-line too!  ;-))

-- 
						Greg A. Woods

+1 416 218-0098                  VE3TCP            RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com>          Secrets of the Weird <woods@weird.com>