Subject: 24-bit color on CG14
To: None <port-sparc@netbsd.org>
From: Charles Carvalho <carvalho@employees.org>
List: port-sparc
Date: 02/23/2002 15:56:04
I have updated PR# port-sparc/10170 with changes for cgfourteen.c to
allow 24-bit color.  The changes to this file correct the calculation
of the display buffer size and allow it to be completely mapped.  The
frame buffer is still reported to be a CG8 (instead of the default CG3)
when the 24-bit support is enabled (a compile-time option); however,
the emulation is incomplete: the CG8 apparently supports 24-bit
DirectColor (in which the RGB values from the display memory are used
as indexes into separate red, green, and blue color tables) as well as
24-bit TrueColor (in which the RGB values are intensities, not
indexes).  The CG14's color tables are apparently ignored in 24-bit
mode.  The X server assumes that 24-bit displays support both TrueColor
and DirectColor by default; with this changed, the server successfully
runs on the CG14, but this change would affect other platforms as
well.  (The change is in /xsrc/xc/programs/Xserver/cfb/cfbcmap.c:
remove DirectColorMask from the #define for LARGE_VISUALS).

The driver gets the screen size from OpenBoot; "words" from the
/obio/cgfourteen node shows that there are methods defined to to change
the size and refresh rate, but I don't know how to invoke them.  For
Solaris, this is done by the "cg14config" utility.

Console output needs to be redirected (xterm -C, xconsole or
equivalent) while the framebuffer is open; the console output routines
assume that the framebuffer is still in 8-bit mode.

Charles

p.s. Many thanks to der Mouse for the explanations!