Re: SVGAlib Matrox support

Search this archive.

From: Matan Ziv-Av (matan@arava.co.il)
Date: Mon 27 Jul 1998 - 21:23:56 IDT


> > support for Matrox cards, I can supply programming information.

> > I would add the support my self, but I have not had any experience with
> > low level graphics for many years and I feel that there may be someone
> > else more suited to the job.  There may even be work under way by

It is actually rather easy to write a driver for a specific card.
The two I wrote, APM and Riva128, took about four hours of writing,
most of it is done by cutting and pasting from the XF86 driver code.
Then, it took about a week of debugging to get it to actually work,
but that was fun :-)

The main problem I had, after the 4 hour job, was that X uses linear
mode, while for svgalib you must support banked mode, which I did
by saving modes in DOS, and guessing which changed bits were the
important one.
If you have programming information on the chipset, it should be
a lot easier.

I looked at the Matrox driver of XF86, and it does seem more
complicated that the chipsets I wrote a driver for, but it seems 
to me that the difference is mainly in the DAC handling, but
the Mystique has internal DAC (IIRC), so it should be similiar
to the other chipsets.


 
> Hmm, I'm not under the impression that there are soo many other people
> which are more suited.

This _suited_ stuff is funny considering that I don't know how to
program in C. I actually write in pascal (in my head) and translate
it.

Anyway, here's my recipe for writing a driver:


You should get the latest SVGAlib version (1.3.0) either in the main
ftp servers (tsx-11 or sunsite), or from my page,
http://www.arava.co.il/svgalib

The latest XF86 (3.3.2) source code (you only need the server linkkit)
X332lkit.tgz

then:

take one of the drivers (I suggest apm.c) of the svgalib.
there are about 10..20 functions you have to replace:
apm_lock, apm_save, apm_test, ...

most have equivalents in the XF86 driver, though there is a need to
change variable names, etc.

In my experience, autodetection should come last, so at first
change the apm_test to return always 1.

when you have a working driver,
replace all apm_ with mga_
change the name apm.c to mga.c
some changes to Makefile, vga.c, vga.h and a couple of files more,




Matan Ziv-Av.        zivav@cs.bgu.ac.il


This archive was generated by hypermail 2.1.4 : Wed 21 Jan 2004 - 22:10:22 IST