======================================================================= _______________ ____ __ __ __ __ __ __ __ / ___/_ __/ __ \/ __ \ / / / / / / / / / / / / / / \__ \ / / / / / / /_/ / / / / / / / / / / / / / / / ___/ // / / /_/ / ____/ /_/ /_/ /_/ /_/ /_/ /_/ /_/ /____//_/ \____/_/ (_) (_) (_) (_) (_) (_) (_) ======================================================================= Before continue reading here, I have to tell you something. This documentation is _OUT_OF_DATE_ and therefore shouldn't be used anymore, as there are other/better ways to get your graphics card supported on Xorg 7+. My intentions in letting this document stay on its usual place where nostalgic ones, but since recent weblog entries and websites link to this HOWTO and wonder, why it doesn't work anymore without changing some path informations, etc., I _HAVE_TO_ stop this. So, if you have problems with your Matrox graphics card, please visit the Unofficial Matrox Technical Support Forum and ask your questions there. You can also download unofficial, working driver versions there. http://matrox.tuxx-home.at/ But if you really want to and I can't tell you to stop here, have fun reading some bits of the good ol' time. ======================================================================= _______________ ____ __ __ __ __ __ __ __ / ___/_ __/ __ \/ __ \ / / / / / / / / / / / / / / \__ \ / / / / / / /_/ / / / / / / / / / / / / / / / ___/ // / / /_/ / ____/ /_/ /_/ /_/ /_/ /_/ /_/ /_/ /____//_/ \____/_/ (_) (_) (_) (_) (_) (_) (_) ======================================================================= ======================================================================= Installation instructions for the mga driver on systems with Xorg 7.0.0 ======================================================================= Written by Alexander Griesser (matrox@tuxx-home.at) 2006-06-04, Revision 1.0.3 Table of contents: 1. Foreword 2. Prerequisites 3. Downloading the bits 4. Configuring the driver 5. Compiling the driver 6. Linking the HALlib into the driver 7. Installing the driver and library files 8. Using the automatic installer 9. Testing the installation 10. Contact Information 11. ChangeLog 1. Foreword ----------------------------------------------------------------------- This HOWTO was written by me in the hope that it may help all people out there, that are as frustrated as I am about Matrox' current Linux support attitudes. First of all, I have to thank some people that made this HOWTO and the automatic installer script possible. Without you, I would never have been awake this long without getting tired: * The guys from Memphis Tobacco for their wonderful cigarettes Air-Blue * The engineers from Bosch Appliances for their great coffee machine Benvenuto B30 * The guys from "Vereinigte Villacher Brauereien AG" - without a good Villacher beer at the right time when I just wanted to stop the work for the day, I'd not have finished it and who knows when I would have time for this in the next few days... Many thanks to Andrew Lunn, whos posting at the Matrox General Linux discussion forums gave us an idea about how to get this whole stuff up and running. I cannot be made responsible for any data-loss, system misconfiguration or any other bad things that may be cause by the use of this HOWTO. This HOWTO is licensed under the GNU Free Documentation license. 2. Prerequisites ----------------------------------------------------------------------- First of all, you need to have Xorg Version 7.0.0 installed, a running X window system configuration, the GNU C compiler, automake, autoconf and all other standard programs for compiling source code. Due to the fact that there has some stuff to be compiled, we need several development libraries and include files installed. I installed a fresh Debian GNU/Linux unstable system as reference and the packages I needed to install for getting the compile process work without any failures are listed below. If you are not using Debian, you should think about using it finally and if you still don't use Debian, I provide some explanations about each package so that you can find the correct package on your system (e.g. searching for the pkg-config description file is always a good idea!): * pkg-config (for the pkg-config binary, usually located in /usr/bin/pkg-config) * xserver-xorg-dev (for the whole /usr/include/xorg directory) * x11proto-core-dev (for the X11 Core Protocol Development files, pkg-config: xproto.pc) * x11proto-fonts-dev (for the X11 Fonts Protocol Development files, pkg-config: fontsproto.pc) * x11proto-input-dev (for the X11 Input Protocol Development files, pkg-config: inputproto.pc) * x11proto-randr-dev (for the X11 RANDR Protocol Development files, pkg-config: randrproto.pc) * x11proto-render-dev (for the X11 RENDER Protocol Development files, pkg-config: renderproto.pc) * x11proto-video-dev (for the X11 Video Protocol Development files, pkg-config: videoproto.pc) * x11proto-xext-dev (for the X11 XEXT Protocol Development files, pkg-config: xextproto.pc) * x11proto-xf86dri-dev (for the X11 XF86DRI Protocol Development files, pkg-config: xf86driproto.pc) * x11proto-gl-dev (for the X11 OpenGL Protocol Development files, pkg-config: glproto.pc) * libdrm-dev (for the whole /usr/include/drm directory) * mesa-common-dev (for /usr/include/GL/gl.h) * libtool (for the libtool script) * xutils-dev (for imake; on Ubuntu Distributions this package is not available. Instead the package "imake" itself has to be installed) * libgl1-mesa-dri (for /usr/lib/dri/mga_dri.so, without this package you won't get Direct Rendering enabled) * libxau-dev (for /usr/include/X11/Xauth.h, pkg-config: xau.pc) 3. Downloading the bits ----------------------------------------------------------------------- We need some tarballs from the Matrox website (they include the HAL library) and one from freedesktop.org (an Xorg compatible mga driver). The most current mgadriver (4.3) does currently not work with this HOWTO, because it has one undefined symbol (MGAGetBOARDHANDLESize). Therefore we go for the 4.1 version of the driver. We need both tarballs (source and binary), the links to them follow: Source-Tarball (MD5-Sum: 5376fed39733b605191cf4dbb138a3ff): -> ftp://ftp.matrox.com/pub/mga/archive/linux/2004/mgadriver-4.1-1-src.tar.gz Binary-Tarball (MD5-Sum: f1075e3e2c8053aef73c0522f4a4ee90): -> ftp://ftp.matrox.com/pub/mga/archive/linux/2004/mgadriver-4.1.tar.gz Additionally, we need a compatible mgadriver version out of the Xorg repository. The most current version on freedesktop.org usually depends on the availability of the newest development version of the Xorg X server and therefore is not suitable for us. We need the version 1.2.1.3 that is also included in Debian unstable, the link follows: Xorg MGA driver (MD5-Sum: 418641e5e9ae77da793db63dc20f87bb): -> http://xorg.freedesktop.org/releases/individual/driver/xf86-video-mga-1.2.1.3.tar.gz After you downloaded the tarballs, simply extract them. I recommend creating a temporary working directory for this compilation stuff, e.g. /root/mga_tmp. Move/copy all downloaded tarballs into this directory. # tar -xzf mgadriver-4.1-1-src.tar.gz # tar -xzf mgadriver-4.1.tar.gz # tar -xzf xf86-video-mga-1.2.1.3.tar.gz 4. Configuring the driver ----------------------------------------------------------------------- Change to the directory of the Xorg mga driver and configure it. # cd xf86-video-mga-1.2.1.3 # ./configure If you installed all the prerequisites, this configuration process should finish without any errors and create a file called "config.h". This file defines some configuration options for the compilation process later on. We need to add a line at the end of this file to enable the MGA HAL library: # echo "#define USEMGAHAL" >>config.h Now we are ready for compiling the driver. 5. Compiling the driver ----------------------------------------------------------------------- Still inside this directory, simply issue the command # make and the driver starts to compile. If the compilation succeeds, go up one directory. # cd .. Afterwards, we have to strip down the shipped mgaHALlib.a included in the tarball of the mga driver sources from Matrox. # cd mgadriver-4.1-1-src/6.8.1/mga/HALlib # ar -d ddcparam.o mgaHALlib.a # ar -d vparmhal.o mgaHALlib.a The last two commands should extract the object information for ddcparam and vparmhal out of the mgaHALlib library. They seem to be not used by anything and cause troubles when we try to link the HAL library against the mga_drv.so. Now we need to copy the stripped down mgaHALlib.a to the source directory of our previously compiled Xorg mga driver. # cp mgaHALlib.a ../../../../xf86-video-mga-1.2.1.3/src/.libs 6. Linking the HALlib into the driver ----------------------------------------------------------------------- Change to the directory of the Xorg mga driver, where you just copied the mgaHALlib.a to and use the libtool command to finally link the mga_drv.so with mgaHALlib.a: # cd ../../../../xf86-video-mga-1.2.1.3/src/.libs # libtool --mode=link gcc --shared -DXFree86Server -DIN_MODULE \ -DXFree86Module -DXFree86LOADER -I/usr/include/xorg -I/usr/include/drm \ -I/usr/include/X11/dri -g -O2 -module -avoid-version --whole-archive \ clientlx.o libmga_storm16_la-mga_storm.o libmga_storm24_la-mga_storm.o \ libmga_storm32_la-mga_storm.o libmga_storm8_la-mga_storm.o mga_arc.o \ mga_bios.o mga_dac3026.o mga_dacG.o mga_dga.o mga_dh.o mga_dri.o \ mga_driver.o mga_esc.o mga_g450pll.o mga_halmod.o mga_hwcurs.o \ mga_merge.o mga_shadow.o mga_video.o mgaHALlib.a -o mga_drv.so 7. Installing the driver and library files ----------------------------------------------------------------------- Backup your current mga_drv.so and mga_hal.o (if any) before you install the new driver files: # XDIR=/usr/lib/xorg/modules/drivers # cp $XDIR/mga_drv.so $XDIR/mga_drv.so.orig # cp $XDIR/mga_hal.o $XDIR/mga_hal.o.orig Then install the new driver into this directory: # cp mga_drv.so $XDIR Finally we need to install the new mga_hal.o from Matrox' binary mga driver package. Therefore we have to change the directory to the path where this tarball has been extracted to an then copy the file to its new place: # cd ../../../mgadriver-4.1/xfree86/6.8.1 # cp mga_hal_drv.o $XDIR/mga_hal.o 8. Using the automatic installer ----------------------------------------------------------------------- I wrote a "small" installation script that should do exactly what I tried to told you in this HOWTO. Currently, this script was only tested on Debian GNU/Linux systems but it should work on most other distributions too. The automatic installer can be found at the usual place: -> http://www.tuxx-home.at/projects/mga/ Please download the most current version from the website and if you run in any troubles, see 10. Contact Information. After downloading the automatic installer, a simple # sh mga_xorg7_installer.run does the trick for you and after a few minutes, everything should be alright. 9. Testing the installation ----------------------------------------------------------------------- When you start your X server, you should see the following lines in the Xorg logfile (/var/log/Xorg.0.log, if you're debugging the first instance of a possible bunch of X servers): || [...] || (==) MGA(0): Matrox HAL module used || [...] || (II) MGA(0): Direct rendering enabled || [...] To test the hardware acceleration, you could use the tools `glxinfo` and `glxgears` out of the "mesa-utils" package. `glxinfo` should contain the following information in the first few lines: || mtxtest:~# glxinfo || name of display: :0.0 || display: :0 screen: 0 || direct rendering: Yes || [...] For a more fancy test you may either try out Planet Penguin Racer (aka tuxracer) or use `glxgears -printfps`. 10. Contact Information ----------------------------------------------------------------------- If you have any suggestions, bug reports, donations or additions to make regarding this HOWTO or the automatic installer script, please don't hesitat to contact me: Name: Alexander Griesser E-Mail: matrox@tuxx-home.at Website: http://www.tuxx-home.at `MGA: http://www.tuxx-home.at/projects/mga IF you have troubles configuring your X Window System, please don't contact me directly, as mails may get lost or I don't have time at the moment. Please use Matrox' General Linux Discussion forums to discuss problems with the installation or configuration of your Matrox graphics card. Forum-Link: http://forum.matrox.com/mga/viewforum.php?f=64 11. ChangeLog ----------------------------------------------------------------------- 1.0.3 (2006-07-24) * Fix a typo in the linking process (XFree86LOADER instead of Xree86LOADER) 1.0.2 (2006-06-10) * Fix the typo in the linking process (mgaHALlib.a instead of ../mgaHALlib.a) 1.0.1 (2006-06-04) * Updates for Ubuntu-Users 1.0 (2006-06-03) * Initial Release