I have a Matrox M9148 graphics card I use to drive 4 monitors. Matrox is very slow to respond to changes in both the kernel and Xorg software, and so some modification is needed. I’m sure some of the changes will make for a slightly unstable system (kernel drivers are involved), but so far so good. First off, you need to limit yourself to Xorg server v1.10.*. The latest as of this writing is 1.12.xx, so you need to mask that by adding these lines to /etc/portage/package.mask:
>x11-base/xorg-server-1.10.99
>x11-base/xorg-drivers-1.10.99
>x11-libs/libpciaccess-0.12.1
>x11-proto/inputproto-2.0.2
If you’ve already upgraded past that point, then make sure to unmerge the new stuff, then reinstall:
# as root, or with sudo
emerge --unmerge xorg-server xorg-drivers
emerge xorg-server xorg-drivers xf86-input-mouse xf86-input-keyboard
The last two are required because unmerging xf86-drivers seems to largely wipe out the available drivers.
Finally, when you download the latest matrox drivers, you need to do some modification if you’re using kernel 3.0 or higher:
./m9xdriver-x86_64-1.3.1.004-20111025.run --extract-only
cd "wherever you extracted to"
vi kernel/src/m9x_client.c
I made a few changes to the m9x_client.c, specifically changing the spinlock mechanism to use the spin_lock_irq mechanism instead of the older spin_lock version. Here’s a patch file for that file, but the changes were pretty straightforward (I used this spin lock documentation to do the conversion.).
Once all that was done, I ran the install script as normal. I just wish Matrox were a bit more responsive to changes. 1+ years between Linux driver releases? Really? The community would love to help, just let us in already!