BeOS graphics driver for Matrox G400

UPDATE - 3.6.06. Gosh, doesn't time fly? Rudolf did some amazing work with this stuff. Well calling it "this stuff" is hardly fair given how much. He did a ton of stuff, including MESA ports to Haiku. He is now moving on. I'll add the new maintainer when he lets me know. See here for details of what Rufolf is up to..

Leaving this link to Rudolf's site while it exists...

UPDATE - 16.10.02. Well I've still not done anything on the driver! However Rudolf Cornelissen has done some great work on it. The main improvements are much better non-G400 support and overlay. Also he cleaned up much of my nasty code. A brave man! Anyway for new updates I suggest you go to the link at the top of the page. I've also assigned the Bebits project over to him.


UPDATE - 22.6.02. While I'm moving my site, a quick update. Six months on and I've not done any work on the driver! However others have! There will be a stable release soon, but for now I suggest brave people take a look at BeTVOut for an alpha release.


UPDATE - 13.1.02. I just received a patch from Jean-Michel Batto to enable support for the G550. Seems this card works the same as the G450:-) I will apply it to the driver when I next boot BeOS, but for now you will have to modify it yourselves! Here it is:

/include/DriverInterface.h
line 138 ,139
G450=4,
G550=5

/driver/driver.c
line 91
0x2527, /*G550AGP*/

/accelerant/mgaGx00/mga_general.c
line 25,29
case 0x2527102b://G550
si->ps.card_type=G450;
LOG(1,"bla bla G550\n");
status = g450_general_powerup();
break;


UPDATE - 22.7.01. Moved my site back to the old freeserve location.


UPDATE - 3.6.01. Where does the time go? Finally got around to booting BeOS again today and added G450 dualhead support:-) Still not fixed the minor G450 timing issues though. Also the G100/G200 problems are still there:-( Anyway have a play with v0.11!


UPDATE - 10.4.01. I got back from NY 3 weeks ago, but it has been so hectic at work that I only just got around to even booting Be! Anyway tried 0.10a today and it works -> sort of... The version linked below does not compile properly! Yes, I made a mistake on a two line change (non-terminated comment). In my defence I was using a rubbish editor via telnet in win!!! Try DEADLINK version instead.


UPDATE - 7.2.01. I have been informed of a possible cause of the lockup on G450. ATM I am in New York (on training), so I can't do a proper release. However I have done a quick code fix -> done blind, so it may not even compile. Anyway grab the src and let me know if you can now cold boot to the G450. The code is DEADLINK.


UPDATE - 28.1.01. So v0.10 is released: TVout support for the G400. Still needs some tweaking but it works. To use it you will need the updated DualHeadSetup; I have uploaded a quick hack here, but Seigers says he will do a better one.

Also G450 support - well almost. I could not get screen to screen blit to work:-( For some reason this acceleration operation crashes. Not sure why, but if you warm boot from Windows (95 at least) then it works!

Changed the G100/G200 to use the BIOS init, rather than my own attempt. So they should work on more systems. I still need to fix the palette issues though. Plus you need to warm boot from Windows or Linux for acclerations (otherwise half the screen is missing!).


UPDATE - 21.1.01. Happy New Year all! Well almost 4 months since the last update... Work takes over ones life so much, never realised it would be this bad:-) Anyway no-one pointed out the obvious bug in the previous release, I guess cause you already all had dualhead set up? Well singlehead mode does not work properly... It either flickered or failed to display at all! I only noticed cause I got a copy of Civ CTP (at the ukbug meet) and it was setting singlehead modes. Grab v0.09a for a quick fix.

WRT the G450 -> I haven't forgotten. I was not originally planning to update it to work with the G450 (as I didn't have one and the lack of time). However have been convinced by the hordes e-mailing me:-) Should be an easy fix I think. All being well I should be getting a G450 this week. So next W/E will hack a G450 version.

WRT TVout -> No real progress made. I had a play with the code a few weeks back and made no progress. Multihead mode works using the Linux kernel code, but not TVout. Just this green stuff! I contacted matrox about getting specs (under NDA), but no reply:-(( Of course I could not release src, but that is not so bad. Might try again when back from NY.

WRT overlay -> One day... Should not be hard to add, just getting round to it.


UPDATE - 15.10.00. Where did 3 weeks go?! Didn't realise it had been that long since I touched the driver. Anyway just thought I should mention I spent a few hours starting TVout support today. I get a picture on the TV that vaguely resembles the top part of the screen. However it is in green and very odd...

UPDATE no.3 (yes, 3 in one day...) - 24.9.00. Well uploaded v0.09. Again not very tested at all - just wanted to get the G400 fix out... The driver and accelerant filenames have changed so please make sure you remove the old driver and accelerant (usually in ~/config/kernel/driver/bin/ and ~/config/accelerants/ IIRC). It has preliminary G100 support, but has the same issues as the G200. The other main change is that I moved the configurable bits into the config directory, so if you got the source release take a look in there (yeah I know it sucks - I also forgot to put the config file stuff in there!).


UPDATE no.2 (yes, 2 in one day...) - 24.9.00. I can not figure out what is going on with the G100 and G200. There are no acceleration initialisation differences I can find in the specs and am stuck with where to go on this one:( I checked out the source for matroxfb under Linux, but could find nothing relevant.

I am absolutely sick of these damn cards now! Can't see myself even trying to fix these drivers any more (When I get less annoyed I'll change my mind!). I'll upload them though, so if someone wants a play then feel free.

<rant>The G400 acceleration was extremely easy to get going. Set the 5 variables to init, then a couple more to do an operation - why won't the G200 work the same? The docs say it should (in fact they seem almost identical to the G400 ones). I took out all my init code (in case it trashed something) and tried acc ops straight after a bios init. That also leaves it in a state where acceleration as documented does not work:( The final straw is that all the registers are write only so I can't simply compare then before and after running Linux to see what has changed. All I know is that it is a register I am not hitting because my driver does not stop it working! Unfortunately I can't find any of them:((</rant>


UPDATE - 24.9.00. Sorry I did not get the release out yesterday. Unfortunately could not fix the problems:( I think I fixed the G400 stability though, so will be uploading at least that today (if it tests ok).


UPDATE - 23.9.00. Well I have been playing with the driver this W/E. Trying to get solid G100/G200/G400 support before moving onto TVout. Anyway I am quite embarrassed because it appears the G400 driver has been broken in v0.07 and v0.08. That crash I mentioned in a previous update happens when I cold boot the PC into Be! Does not occur if I run Linux (or even v0.06 under Be) and then warm boot!

I am still working out what is wrong, but once fixed I recommend everyone using 0.07/0.08 upgrades ASAP. I will upload it later this evening.

G100 support is now going, G200 is improved. FYI the previous G200 support only worked on a warm reboot (from Linux or Win?) and then only in 32-bit colour!


UPDATE - 17.9.00. Times goes rather quick doesn't it? Was it really 3 weeks since I last updated this. Well still not done TV out or fixed the G100/G200 support, but I started looking at what needs doing today. Maybe I will actually write some code eventually?!

I had been busy with a number of things (in my somewhat limited free time), such as trying to get specs for some Amiga busboards (yes, they finally have PCI!!!). Unfortunately it seems all the people who do RTG systems are only interested in money. Hence they think it is a good idea not to let someone do a driver for free. Weird people;)


UPDATE - 28.8.00. Right, fixed the G400 driver. Or to be more precise I recompiled, pushed the card further into the AGP slot then could not crash it! So the G400 driver with G200 support is now up! Please note that the recent releases of the driver (since 0.06) have had far less testing than previous ones. I believe everyone is now using the official driver (so I get no feedback). Anyway if you have problems (or it works) please let me know. Especially on the G200 side.

BTW Not heard yet about TVout..... (see below)


UPDATE - 27.8.00. Spent another hour on this today. The G200 now works:-) I was going to release it, but discovered the G400 crashes every time now!!! I don't have a clue why though. Would have got it debugged, but someone (no names mentioned) forced me onto IRC!

Tell you what - if I get an e-mail by lunchtime tomorrow about TVout I'll attempt TVout support tomorrow:-) That is if I manage to stabalise the G400!


UPDATE - 23.8.00. Didn't get a chance to hack much on sunday. However this evening I started playing with the G200. Have figured out how to power it up, but my code does not quite work yet (monitor turns on, but no picture).


Yeah! I now have a G100 and a G200 to play with (Thanks Ant - BTW the G100 works) :-) I'm going to have a hack around on Sunday and will hopefully get both working. Then all those users unfortunate to have video BIOS issues will be able to use Be in accelerated colour!

Sorry again about the lack of updates. I have started work now and it is an absolute pain! I am too pathetic a coder to contribute ATM, so am poring over pathetic stuff about MFC. WINDOWS HAS THE WORST API AND C++ LIBRARY EVER!!! Anyone got tips on convincing your manager to change GUI library? Think they'll fire me for doing no work soon, because I have just been reading since I started! Had about 10 1000+ page books dumped on me:-(((((((((

Seigers has updated the dualhead setup program. It is quite cool now - please vote on Bebits:) OK - back to the old stuff....


System Requirements

General Info

This is the unofficial G400 driver. I began writing it earlier this year because I enjoy learning about hardware programming. The majority was written in that first week - since then minor updates only, other than the dualhead stuff!

I did not have enough experience to work on major projects (such as Utah-GLX), so another motivation was to learn more about hardware programming. It also worked out quite nicely in that it was released before BeOS R5, so some people got some use out of it:-). I am no longer working on this driver, but others are. They have promised to give me all updates, so I will post them here once I get them. The driver should not cause any problems with your system. If it does then please let me know, even if it is a known bug. I will attempt to fix any problems reported.

There is a dualhead setup utility available. This allows dualhead modes on G400 and G450. Also TVout on G400. If you have a singlehead G400 card and want a hardware cursor try v0.06. In the readme of the latest source there is also a description of how to enable hardware cursor (it is disabled by default as it does not work with dualhead).

As mentioned above, this driver is a hobby. Therefore I am not in a position to guarantee that this code will not damage your system. If you choose to run the driver, then that is your risk.

Download

Use v0.06 (for singlehead G400) or v0.12 (for dualhead G400/G450 or singlehead G550 or broken G100/G200 support!) for now
50KB  Driver v0.11 source code (recommended if you can handle it - needs R5 to compile unless you edit one file (see README.html))
50KB  Driver v0.12 binary (for easy install)

40KB   Source code Dualhead config utility v0.03a
30KB  Binary for R5 Dualhead config utility v0.03a

40KB  Driver v0.06 source code (recommended if you can handle it)
150KB Driver v0.06 binary For R4.5 (for easy install)

Installation

Please remember to remove previous releases of this driver and Be's G400/G200 driver (keep a backup of the official driver though!).

(Had some queries as to where old version are. Take a look in these locations:
/boot/beos/system/add-ons/kernel/drivers/bin/
/boot/beos/system/add-ons/accelerants/
~/config/add-ons/kernel/drivers/bin/
~/config/add-ons/kernel/drivers/bin/
IIRC I also modified the install script to remove old versions of my driver...)

You will also need the Dualhead config utility for Dualhead. This allows you to set "Clone, Singlehead, Dualhead and Switchhead" modes. Note that Singlehead doesn't turn off the 2nd monitor on the G450 - in fact this is a better option than the "Clone" mode:-)

Current Sections completed

Sections in Progress

Changelog

Changes in 0.13 (Does not exist yet...)

Changes in 0.12

Changes in 0.11

Changes in 0.10

Changes in 0.09a

Changes in 0.09

Changes in 0.08

Changes in 0.07

Changes in 0.06

Changes in 0.05

Changes in 0.04

Changes in 0.03a

Changes in 0.03

Debugging (coders or advanced users only)

The driver can produce a log file to say what it is doing. To enable this, edit the file "acceleration/mgaGx00/mga_support.c". There is a function in this file named LOG that is called for all writes to a log file. This function rejects messages below a certain level (which I marked with ***s are something). Change this level to 0, or remove the line with the return in altogether. The log file is stored in /boot/home/mgaGx00.log. If you have problems then please send me this file (compressed and with only the latest run in preferably).