Subject: Xs24
To: None <port-sparc@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: port-sparc
Date: 02/02/2003 00:24:28
I am pleased to report that, aided by what I learned while making X run
on the cg14, I now have it running on the s24 too.  (This is the 24-bit
form of the tcx, which exists for the SS5 and as far as I know nothing
else.)

This hardware supports 8bpp PseudoColor (which the server presents as
the usual suite of six visuals), 24bpp DirectColor, and 24bpp
TrueColor.  (The cg14 is similar but doesn't do DirectColor; the cg14
hardware could support a second 8bpp PseudoColor map, but my server
doesn't do so.)  Unfortunately the hardware uses same lookup tables for
the 8bpp PseudoColor and the 24bpp DirectColor, so the resulting
server's max-installed-maps is 2, not 3.  (In principle it could/should
offer two 24bpp TrueColor visuals, one gamma-corrected and one not.  I
didn't bother getting that fancy, especially as I know of no standard
way to indicate which is which; I just ignore the non-gamma-corrected
TrueColor mode the hardware has.)

I have seen indications that someone is working on picking up my cg14
code and rolling it into xsrc.  Possibly someone (else?) will do
likewise with the s24 code.  I used X11R6.4p3 as my base, not XFree;
the XFree model strikes me as horribly broken (doing its own bus
enumeration, ewww!), and absent a compelling reason to use it - like
i386-port hardware - I don't.  I looked at XFree's cg14 support, and it
is significantly less capable than mine - it just presents 24bpp
TrueColor, no 8bpp support at all.

In passing, for anyone who _is_ working with my cg14 code, I've added a
nontrivial optimization to the code that writes the mode-select
bitplanes.  It's fast enough to be usable without it, but I had to
write the code for the s24 (which _isn't_ fast enough without it) and
that part of the code was similar enough that the same technique
dropped into the cg14 code painlessly.

There is still room for improvement.  The s24 code really ought to use
the blit and stipple support the hardware has; it won't accelerate it
as much as a real blitter would, but when shoveling that many bits
around, every factor of two helps.  The cg14 is supposedly accelerated
in some way, but (unlike the s24) I have no documentation whatever on
what acceleration exists or how to use it, so all I'm using it as is a
dumb memory-mapped framebuffer.  I also should diddle the cursor code
some; it presently uses the hardware cursor support, which imposes a
hard limit of 32x32 on cursor size.  It really should switch over to
software cursor support for larger cursors.

/~\ The ASCII				der Mouse
\ / Ribbon Campaign
 X  Against HTML	       mouse@rodents.montreal.qc.ca
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B