Subject: Re: Sun CG6, X11 and so on
To: None <port-sparc64@NetBSD.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: port-sparc64
Date: 04/29/2005 12:30:49
>> The cg6 does it thus: [...]
> Hmm, everything else I played with does...
> set x/y start, width in pixels
> optionally an offset for the first pixel of the data you feed. Then
> you keep feeding and the blitter will jump to a new line when one is
> full, either continue with the rest you fed, continue at the next
> byte border or with the next longword you write.

I think the facility I describe is designed for drawing characters
(which usually are <= 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.

>> If you are drawing a wide line, you set incx to 32 and incy to 0; if
>> you're drawing a vertical strip, you set incx to 0 and incy to 1.
> Sounds funky.  So you either have to use max. 32 bit width or adjust
> x after each line.

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.

>> for example, a line of slope 1/N for N<=32 can be drawn slabbed by
>> setting incy=±1 incx=±N (± choices depending on direction), and
>> repeatedly writing (~0U)<<(32-N) in don't-touch-background mode.
> Ah, that makes sense.

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

>> 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?

Yes, that's part of it.  I think I also saw a Sun document somewhere
that claimed the cg6 included such a thing.

> Did you ever play with them?

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.

> It accelerates solid rectangles and screen-to-screen copies - bores
> the cg6 to tears but it already helps a lot, like xterm scrolling :)

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.

/~\ 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