Subject: Re: Sun CG6, X11 and so on
To: der Mouse <mouse@Rodents.Montreal.QC.CA>
From: Michael <macallan18@earthlink.net>
List: port-sparc64
Date: 04/29/2005 13:37:59
--Signature_Fri__29_Apr_2005_13_37_59_-0400_URyRs=Ytq+XPPa4b
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable

Hello,

> I think the facility I describe is designed for drawing characters
> (which usually are <=3D 32 pixels wide) rather than for copying large
> areas of arbitrary data from CPU to screen.  The latter is arguably
> better done by writing directly to video RAM - the stuff I described
> looks much more tuned to drawing bi-level data, to me.

Yeah, I guess so. Life would be easier if they included a flag to make
the line skip either at the end of a line or after each transfer.

> Or after each column; you usually have more rows than you do columns,
> since each write covers 32 pixels horizontally but only 1 vertically.
> This means you have less overhead if you do it by columns.

True. But XAA doesn't allow writing one scanline at a time without using
an intermediate buffer. Whoever wrote XAA didn't know the GX...

> Of course, you'd normally draw a line with the cg6's line mode. :)

Later :)
I just hacked hardware character drawing into NetBSD's cgsix driver, now
I'm fighting XFree again to do the same.

> >> I have reason to think the cg6 includes a full 3D transform engine,
> >> but I have no idea how to use it.
> > You mean [...] these suspicious z coordinate registers all over the
> > place?
>=20
> Yes, that's part of it.  I think I also saw a Sun document somewhere
> that claimed the cg6 included such a thing.

Yes, now I know what you mean - there /is/ a coordinate transformation
unit somewhere hidden in it, it even understands 32bit floats. Too bad
it's totally undocumented.

> Not successfully.  I once spent some time in a test program poking at
> various places in the hope of finding something useful, but never did
> figure anything interesting out.  It may be that it's got a more
> complicated interface than just poking values into registers.

The TEC thingie looks highly suspicious:
/*
 * Partial description of TEC (needed to get around FHC rev 1 bugs).
 */
struct cg6_tec_xxx {
	u_int32_t	tec_mv;		/* matrix stuff */
	u_int32_t	tec_clip;	/* clipping stuff */
	u_int32_t	tec_vdc;	/* ??? */
};

Apparently you can feed it at least one transformation matrix which is
automatically applied to all coordinates.

> > It accelerates solid rectangles and screen-to-screen copies - bores
> > the cg6 to tears but it already helps a lot, like xterm scrolling :)
>=20
> Yeah, RASTERCONSOLE on the sparc with a cg6 went from barely tolerable
> to fully usable when I wrote code to use the blitter for screen area
> clears and scrolls.

Ok, now it draws characters using the blitter as well. I /think/ you can
feed it colour data much the same way, just set colour drawing mode,
starting coordinates and start shoving longwords into the font
register.

have fun
Michael

--Signature_Fri__29_Apr_2005_13_37_59_-0400_URyRs=Ytq+XPPa4b
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (NetBSD)

iQEVAwUBQnJw98pnzkX8Yg2nAQIFMAf+O4auRkN1+5FvcY/fWl2S7bPH2YJ5JHnR
dAWdEBDkuWmJ36NrdKlgosPUkEKUnrLGzHq7ibsmT/PF6H/7jcJqHkx34h+HLI5t
E8Orh64WaNZySF6M+7SSaLLU5OonBW3N7MBJ+Ue2n4fxG7khoNrHI/3lM1J2Lxo4
l6zAIY9zbvxb1fGoZlKEBQvY0UHhEJyYvVKo8adgBHTMNP/URrRJPg2SmTSJyl/G
ni9CFPMlIpc5G/UbGKsPuYQs1zSsp9hqHXCPcgdL1lf5Tv45KDoBosyO139A0IDq
lmfypuusP+mtP1aV4QdeM5ZmVFwGMqpnFPjaqqkKUGIf505dC2J0YQ==
=bhOw
-----END PGP SIGNATURE-----

--Signature_Fri__29_Apr_2005_13_37_59_-0400_URyRs=Ytq+XPPa4b--