Subject: CG8 emulation on TCX boards
To: None <port-sparc@netbsd.org>
From: Tyler Mitchell <fission@styrophone.net>
List: port-sparc
Date: 02/14/2003 23:03:59
Hello,

I recently put a 24-bit TCX framebuffer into my SPARCstation 5, hoping to
use the CG8 emulation with it.  To get the kernel to recompile with
support for it, I had to change tcx.c:

--- tcx.save	Fri Feb 14 17:09:46 2003
+++ tcx.c	Fri Feb 14 22:42:39 2003
@@ -51,7 +51,7 @@
  * define for cg8 emulation on S24 (24-bit version of tcx) for the SS5;
  * it is bypassed on the 8-bit version (onboard framebuffer for SS4)
  */
-#undef TCX_CG8
+#define TCX_CG8

 #include <sys/param.h>
 #include <sys/systm.h>
@@ -293,11 +293,11 @@
 #ifdef TCX_CG8
 	if (!sc->sc_8bit) {
 		if (sbus_bus_map(sa->sa_bustag,
-			 (bus_type_t)sc->sc_physadr[TCX_REG_RDFB32].oa_space,
-			 (bus_addr_t)sc->sc_physadr[TCX_REG_RDFB32].oa_base,
+			 sc->sc_physadr[TCX_REG_RDFB32].oa_space,
+			 sc->sc_physadr[TCX_REG_RDFB32].oa_base,
 			 TCX_SIZE_DFB32,
 			 BUS_SPACE_MAP_LINEAR,
-			 0, &bh) != 0) {
+			 &bh) != 0) {
 			printf("tcxattach: cannot map control planes\n");
 			return;
 		}

The dmesg seems to be fine:

tcx0 at sbus0 slot 0 offset 0x800000 level 5 (ipl 9): SUNW,tcx, 1152 x 900 (emulating cg8), id 7, rev 1, sense 0 (console)
tcx0: attached to /dev/fb

When I run the X server, first some messages are printed on the screen (in
black-and-red (!)) about missing xkbcomp, and then the entire screen turns
black.  In the lower left-hand corner of the screen appears a strip, about
1cm high and about 2/3 of the monitor's displayable width wide.  In that
little line appears the standard X background. Surprisingly enough, if I
move my mouse around, the cursor will appear in this tiny strip of a
window; the colour seems fine (grey-and-black).

In PR 15963, I see a section about patching the X server, though I can't
quite do this with gdb since I'm not using the 1.5.2 Xsun binary.  Though
I've not yet tried to rebuild Xsun myself, I suspect that a change from
DirectColor to TrueColor won't solve my problem entirely.

Any ideas, sugggestions, are most welcome.  (I could build a kernel with
DEBUG, if that would help identify the problem.)

-- 
Tyler Mitchell

"Wherever you go, there you are."
      -- Douglas Adams