MOL voodoo1/2 support

mol-devel@lists.maconlinux.org mol-devel@lists.maconlinux.org
Tue, 27 Aug 2002 12:04:48 +0200


On Tue, Aug 27, 2002 at 01:22:25PM +1000, Dan Brunet wrote:
> Would it be difficult to allow MOL to interface directly with a Voodoo1 or
> Voodoo2 devices? The VirtualPC and Softwindows developers seemed to be able
> to do this fairly easily so I figure it can't be too hard..
> 
> The 3D voodoo drivers have already been written for the Mac OS so is there
> much more to it than simply giving MOL access to the PCI hardware? (there's
> no 2D to mess with)

Well, I've played a bit with this in the past. It is rather simple
to get an unaccelerated video drivers working (I've been
successful with both the ATI Rage 128 driver and the old Platinum
driver).

The main problem is bus mastering. What MacOS believes is
a physical RAM address is in reality a virtual address which
translates to a physical page handled by MOL and the linux mm. 
If mac-physical addresses are passed directly to the hardware, then
nasty things will obviously occur. 

As far as I can see, the possibilities are

i) a MOL driver which interfaces the video card by simply passing
along read and write requests to the register space. This driver
would also handle the mac-phys to linux-phys address translation.

The main problems are,

	a) memory based DMA descriptors are quite tricky to handle.
	I don't much about how bus mastering is typically setup
	for a graphics card, so this might not be that much of
	an issue.

	b) mac-memory is not physically continuous in general. It is
	fairly simple to map in a few continous, locked down, pages
	by hand, but ram pages in general will be non-continous.

	c) specs are hard to come by and are usually covered by a NDA.
	
	d) Physical interrupts are not easily available. If one really
	needs them, I guess one could accomplish something from a
	kernel module.

	d) Console switches are be non-trivial (especially if MOL 
	is to continue running without ownership of the hardware).


ii) Making the mac-side driver MOL-compatible. This would clearly
be the best solution. However, I would guess that obtaining the
source is an order of magnitude more difficult than obtaining
the hardware specs.

iii) Write a generic mac side MOL driver for video acceleration.
It is a bit difficult to obtain information from Apple how to
write an accelerated video driver though (and I believe there
is a NDA involved too).  

iv) With the reservation that I don't know much about OpenGL, 
I guess it might be possible to intercept OpenGL streams at a 
higher level and forward them to the appropriate linux
interface.

I would really like to see video acceleration in MOL. The Mac
side drivers are a bit messy though. I believe it will be
easier to write an accelerated video driver for MacOS X.

/Samuel