jump to navigation

How To Get 3D Graphics On A Dell CPx Laptop With Linux June 23, 2009

Posted by ModelR in Everything LINUX.
trackback

Update: Here is how I was able to achieve OpenGL 3D Graphics With Debian Lenny 5.01 kernel version 2.6.26-2-686 on a ATI Mach64 Chipset Laptop

Note: As of the date of this article: June 25, 2009 the git repository version of DRM will cause your system to hang (at least that’s what happened for me) so I had to use version 2.4.1

apt-get build-dep libdrm mesa
apt-get install linux-headers-`uname -r`
apt-get install libxi-dev libxmu-dev x11proto-xf86vidmode-dev
apt-get install git-core autoconf automake libtool
apt-get install xorg-dev libgl1-mesa-dev
apt-get install mesa-utils

installed the latest dri2proto

Download drm revision 2.4.1 and extract it then

$ cd drm/linux-core

$ make mach64.o

$ sudo cp *.ko /lib/modules/`uname -r`/kernel/drivers/char/drm/

$ sudo depmod -a

$ sudo modprobe mach64

edit /etc/X11/xorg.conf to have

Section "Module"
Load "dri"
Load "glx"
EndSection
...
Section "Device"
Identifier "Configured Video Device"
Driver "mach64"
Option "ForcePCIMode" "True"
Option "TVOut"
EndSection
...
Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
DefaultDepth 16
SubSection "Display"
Depth 16
Modes "1024x768"
EndSubSection
EndSection
...
Section "DRI"
Mode 0666
EndSection
...

When you startx and test with glxinfo you should see that direct rendering is enabled now.

BELOW ARE ALL THE VARIOUS TESTING METHODS I HAD TO GO THROUGH TO GET THIS WORKING

=============

If you are trying to get 3D graphics using the mach64 drivers and it isn’t working here are a few references. I was trying to get this working with Debian Lenny 5.01 and it was not happening. Tried a bunch of different steps, but ran into various compiling errors etc. Then I decided to run a live CD of Ubuntu Jaunty to see if it would work, not only was sound immediately working but after checking glxinfo I seen that Direct Rendering was also enabled. To make things short, I scrapped the Debian install and put Ubuntu on.

Reference this bug report: https://bugs.launchpad.net/ubuntu/hardy/+source/linux-source-2.6.15/+bug/34590

Reference: http://wiki.archlinux.org/index.php/Mach64

Reference: http://cassianoleal.wordpress.com/2008/03/08/one-more-try-on-the-mach64/

Reference: http://ubuntuforums.org/showthread.php?t=7200&highlight=mach64

Reference: http://wiki.cchtml.com/index.php/Debian_Installation_Guide

Reference: http://wiki.debian.org/AtiHowTo

Reference (kernel drm no longer compatible with mesa drm): http://kmandla.wordpress.com/2008/12/21/from-ati-to-mach64/

Reference (TVOut): http://osdir.com/ml/linux.redhat.fedora.general/2003-11/msg01902.html

Reference (atitvout): http://0pointer.de/lennart/projects/atitvout/

Get this file: http://xorg.freedesktop.org/archive/individual/driver/xf86-video-mach64-6.8.1.tar.gz
Note: check the directory for the latest version of the driver
———————————————————–
I tried a few different things and crashed my system
After a fresh install here is what I did:
Using this guide here:

http://dri.freedesktop.org/wiki/Building

apt-get build-dep libdrm mesa
apt-get install linux-headers-`uname -r`
apt-get install libxi-dev libxmu-dev x11proto-xf86vidmode-dev
apt-get install git-core autoconf automake libtool
apt-get install xorg-dev libgl1-mesa-dev
apt-get install mesa-utils

installed the latest dri2proto

Create a ~/src/drm-git directory and run git clone
git://anongit.freedesktop.org/git/mesa/drm

inside the drm-git directory
This will get the latest drm drivers from upstream.

$ cd drm/linux-core

$ make mach64.o

$ sudo cp *.ko /lib/modules/`uname -r`/kernel/drivers/char/drm/

$ sudo depmod -a

$ sudo modprobe mach64

edit /etc/X11/xorg.conf to have

Section "Module"
Load "dri"
Load "glx"
EndSection
...
Section "Device"
Identifier "Configured Video Device"
Driver "mach64"
Option "ForcePCIMode" "True"
Option "TVOut"
EndSection
...
Section "Screen"
Identifier "Default Screen"
Monitor "Configured Monitor"
Device "Configured Video Device"
DefaultDepth 16
SubSection "Display"
Depth 16
Modes "1024x768"
EndSubSection
EndSection
...
Section "DRI"
Mode 0666
EndSection
...

After starting x and then typing glxinfo it was showing direct rendering yes, but then the system would crash with the caps lock and scroll lock lights flashing

At this Point I decided to give up. It was costing me too much time for what it was worth.
————————————-
After fully reading the bug report that I link to at the top. I decided to compile an updated kernel for Debian Lenny 5.01. The current kernel that comes with it is 2.6.26-2-686. The one I was recompiling was a generic 2.6.30.

Compile the new kernel with a disabled DRM module (in menuconfig):
Device Drivers --->
Graphics support --->
Direct Rendering Manager (XFree86 4.1.0 and higher DRI support)

Downloaded the package atitvout to see if I could also get tv out working with the card.

———-
side note:
For some reason after installing the new kernel, my /dev/hda1 changed to /dev/sda1

And after installing the headers, there wasn’t a link to the build directories so I had to make the symbolic link myself:
Reference this post: http://forum.eeeuser.com/viewtopic.php?id=65997

ln -s /usr/src/linux-headers-$(uname -r)/ /lib/modules/$(uname -r)/build

————————–
Another shot at it

Check this bug: drm.ko and mach64.ko cause kernel panic after drm release 2.4.1

Trying to compile drm release 2.4.1 with kernel 2.6.30:

had to make changes to sources here are the references (too many changes to mention all):

first error
-conflicting types for ‘irqreturn_t’
-fix:http://bbs.archlinux.org/viewtopic.php?pid=574620

second error
-Note in kernels greater than 2.6.27 You will get an error: drm_fops.c:253: error: ‘struct task_struct’ has no member named ‘euid

See: http://cgit.freedesktop.org/mesa/drm/commit/?id=26ca0bca9bd5e23b1d31bc6dfb6d58b62143447b

Third Error
-drm_sysfs.c:172: error” ‘struct device’
-See:

http://ubuntuforums.org/showthread.php?t=1143819

Note: After making these changes it was able to finish compiling, however I was unable to install the drm.ko or mach64.ko modules

About these ads

Comments»

1. Anthony Surma - June 27, 2009

Awsome blog!

I followed your instructions to the letter… Everything seemed to work… but I still get no DRI rendering with my Rage Pro LT on my 11 year old laptop… This card also is also a mach64. ::sigh::

Is it at all possible for you just to email me those two .ko files? (drm and mach64)… or better yet, make them available for download on some filesharing site?

As I understand it, those are the only two files needed (along with the xorg.conf changes) to get this working. I don’t know how I fscked it up, but I must have.

Note: I’m also running Debian Lenny 5.01 i686yadayada-2

2. Anthony Surma - June 27, 2009

Jeez, I was messing around in the xorg.conf file and it worked!

I’ll figure out exactly what I did wrong and reply.

3. Anthony Surma - June 27, 2009

Figured it out… I had ommitted the following line:

DefaultDepth 16

I, subconsciously, I guess I didn’t think it was necessary :D

After I added that in under Section “Screen” it worked… Thanks a lot for your work putting this together! I don’t think I would’ve figured this out haha!

A big difference in the glxgears test… went from 80 fps to 200!


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: