[PATCH] Big-endian fixes for tdfxfb in 2.4.21

From: Richard Drummond (lists@rcdrummond.net)
Date: Sat Jul 19 2003 - 01:39:14 EST

The following patch fixes some long-standing problems that I have been
experiencing with the tdfxfb driver in kernel 2.4 when running on a PPC Mac.

Specifically, it fixes:

1) Endian problems when blitting font glyphs. I have enabled byte-swizzling
when blitting, so text on the console is now readable.

2) Endian issues with 24-bit framebuffer. I've disabled byte-swizzled access
to 24-bit framebuffers. This now suits the byte-ordering of framebuffers with
this depth (at least on my hardware).

3) Endian problems with hwcursor. The cursor should now appear at the cursor
position, that is, actually at the insertion point. It was simply a question
of getting the right byte-ordering for each framebuffer depth.

4) Disabled I/O ports when booting from OF (rather than via MacOS) preventing
use. The driver now calls pci_enable_device() during init - which should
enable I/O ports - and checks to see that I/O space is accessible before

I've tested this patch extensively both on a Voodoo3 and a Voodoo4 on several
(OldWorld) Macs. I don't have an x86 3dfx card to verify that it still works
there, but the changes shouldn't affect little-endian machines at all.

A couple of problems still remain:

1) Resource management still needs to be implemented (A corollary is that offb
will claim the card before tdfxfb - if you have the offb driver built in as
well - and then tdfxfb will also claim it. Solution: you need to supply the
kernel option video=offb:off to use tdfxfb). This will be trivial to do.

2) Hardware cursor works fine if I boot via MacOS with BootX, but is invisible
if I boot from OF with Quik. Not sure why - still needs investigation.
Solution: turn off hwcursor. (Make that kernel option above
video=offb:off,tdfx:nohwcursor=1 if you boot from OF.)

3) Memory on Voodoo4 is incorrectly detected. It reports 64MB, but the Voodoo4
only has 32MB. I don't have any documentation on the Voodoo4/5, so I don't
know the proper way to detect it. XFree86 uses the same algorithm as tdfxfb,
so also gets it wrong.

I have taken a cursory glance at the tdfxfb in 2.5/2.6-test and similar
changes will need to be applied there too. I intend to look at this when I
have time.

I'd welcome comments on this patch, particulary from anybody running tdfxfb on
a big-endian platform other than the Mac.


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

This archive was generated by hypermail 2b29 : Wed Jul 23 2003 - 22:00:37 EST