In this page I explain how to obtain the 3D acceleration from the Asus A4K Ati Radeon 9700 mobility. To obtain this result a little fix in the MTRR registers is needed.

Some times ago I’ve found a solution to this problem and I wrote a guide on my Italian blog to set up this notebook.. I think i was the first one on the web who wrote how to solve this MTRR problem, then someone requested a translation of this part, and I’ve finally written it.

I’m still not very good with English, so if you have some correction they will be welcome 🙂

Graphic Card

Open Drivers (radeon)

With the open drivers we can see some bad visual artifacts, the 3d acceleration seems to work, and have good results in some case, but miss some feature that lead to a fallback in software rendering in some case!

Here an example of the “visual artifacts” i was talking aboug: they happen at random, sometimes they aren’t there, sometimes worst then what you see here (click on the image to see it at full size)

Fallback to software rendering happen when a not implemented OpenGL function is needed by an application, and all the 3d rendering is computed by the processor as if you don’ t have any 3d accelerated graphic card. Anyway open drivers keep getting better, it’s now possible to play games like Quake 3 or Tremulous without big problems.

They doesn’t support the SVIDEO TV output.

AIGLX + Compiz works (cube + wobble windows), but don’t expect all the plugins to work. Actually the windows resizing is very slow and the whole system become really slow with some effects.

Proprietary Drivers (fglrx)

For many use you need the ATI proprietary drivers (fglrlx), they support all the OpenGL features but the Composite extension (needed for AIGLX to work), they have some problem too as we will see later.

Go and take the fglrx drivers, then install as you like. The following part explain a way to install this driver, but you can use the way you like.

Installing the driver on Debian using apt-get and module assistant

I’ve Debian so i used apt-get (or you can use synaptic if you prefer a graphical interface):

understanding the problem

now…. many of you will ask ourself: what the hell is MTRR? more or less i asked myself the same question sometimes ago.. (it token me a lot of time to figure out the problem was here). Briefly: it’s a technology to control the way the processor access to memory areas; it can boost the writing/reading performance of data from memory up to 250%. This is very useful to access the AGP and the video ram.

So… where’s the problem? There are 8 available register for MTRR on any system, in my ( your?) system they are all busy! I’ve 2 GB of Ram, the first 7 ones are taken by the first GB, and the last one for the second GB.

When the X server get loaded ( graphic server) it try to automatically load the agp modules for your video card; each module will try to add MTRR registers for is own memory, if all register are busy it will give some error and the will disable all the stuff that need MTRR to work leaving you without a 3D acceleration.

i take one of this register to explain its meaning:

reg01: base=0x01000000 ( 16MB), size= 16MB: write-back, count=1

register 1 (the 2nd, it start from zero)

it refers to the memory area from address “base” to “base+size“.

now, the memory address are usually are written in hexadecimal format: so 0x01000000 in hexadecimal is the Byte 16777216 in decimal, you can check this by using the calculator of your system. If you divide that number by 1024 for two times you will get the MBytes… guess what is that number? 16 MB, is the one written between the brackets.

this mean it start from 16 MB and has a size of 16 MB; now check all the registers, they are a remapping of the first 2 GB, in other words: the first register start at 0 MB and go until 16 MB, the second start from 16 MB and go to 32 MB, the third register start at 32MB and go to 64MB, and so on, without a blank space between one register to the next one. And they all are of the same type (write-back, count=1 )

NOTE: since only 2 register are needed for the agp and graphic card probably you suffer of this problem only if you have more then 512MB. If you have 512MB of Ram you should have 2 register free, either case the patch doesn’t hurt 🙂

Now i show you how to solve the problem…

How to solve the problem

The best solution I’ve found is to reconstruct the MTRR registers structure adding a script at boot time to fix them. Copy and paste this script in /etc/init.d/ ( let’s call it fix-mtrr )then create a simbolic link in /etc/rcS.d/ to start this soon after “mountkernfs.sh”. ( ln -s /etc/init.d/fix-mtrr /etc/rcS.d/S03fix-mtrr ). Reboot and you should have a working 3D using the MTRR boost up. Here the script, YOU HAVE TO ADAPT IT TO YOUR RAM AMOUNT as explained down here

Alternative / old / harder / worst method

this method disable the mtrr in the fglrx driver, this means you will NOT have the 250% boost up of the MTRR technology. This was my first solution.. I wrote this here to remember it and to give a more complete understanding of “how it work” to the reader

you need to manually modify and recompile the fglrx module for this to work, so alternative/automatic method will not work with this solution 🙂

in the directory of the source code of the module/usr/src/modules/fglrx-kernel/fglrx/build_mod/

edit the file firegl-public.c substituting all occurrences of CONFIG_MTRR with XCONFIG_MTRR. (if you use Vim you can do this with this command “:%s/CONFIG_MTRR/XCONFIG_MTRR/g“)

what this editing does? it makes the fglrx module to think that kernel doesn’t have an MTRR support build into it. The driver got compiled in a different way that doesn’t use the MTRR this way.

Some consideration

I think the MTRR problem is due to a bug in the bios. But I’m not sure about it

the following doesn’t depend on the MTRR problem/fix, they depends on the Ati fgrlx drivers, and could be different in each version of the drivers, they are referred to the 8.28.8 drivers

The fglrx driver sometimes lead my system to a complete crash. This happen at random.. and not very often if you don’t use 3D screensavers, but is really annoying… please.. ATI.. write a decent driver!

Clone Screen (TV out) work out of the box.. you just have to restart X server or reboot when you connect a TV to the SVIDEO output. If you have a PAL TV (cause you live in Europe for example) you will see in Black and White.. just add Option “TVFormat” “PAL-B” to your xorg.conf. I didn’t find a way to change the primary screen, so if you use the XV extension for video playback you have to disable it to see your films/video on the TV, i usually use the GL extension

Aiglx doesn’t work because ATI doesn’t want to support the Composite Extension needed by Aiglx for now. This mean you can have Compiz or Beryl running using the proprietary Driver, unless you decide to install XGL, and this isn’t really user friendly.

I’m not upgrading my fglrx driver because last time i tried the TV out stopped to work.

Mastro,
it works !!!! 🙂 🙂 🙂 🙂
I had to experiment a bit… most strange thing is, that, despite having only 1280 MB RAM I have to put in 0x80000000 (instead of 0x50000000, what I would expect being correct).
I put the script in my boot.local, started and – voila 🙂 it worked.
thanks a lot once more, you gave me the last drive to try it once more 🙂
all the best to you
Susanne

hi Mastro,
despite your excellent HowTo I couldn’t succeed…
I did everything as you described it – created the script by copying, put it into /etc/init.d, made it executable, created the link in ./rcS.d, attached the fix-mtrr command to my “depend-start” (I’m running a Suse10.2) – but nothing happens – I can’t find any hint in boot.msg or messages that the script worked. The mtrrs are unchanged.
I also tried to copy the script directly into boot.local, but then I got an error: it said “write error” when trying to execute that line
echo “base=0x00000000 size=0x20000000 type=write-back” >| /proc/mtrr
so, with all mtrrs disabled and no ones set the system is no longer accessable in a reasonable manner…

I have also a Fedora7 on my machine and tried it there too. But there is no directory “rcS.d” so I put the link into “rc5.d”
my knowledge is too low to estimate this being the right place… anyway, the script will be started, but not executed because of error message regarding the line
echo “Usage: /etc/init.d/fix-mtrr {start}”
obviously the system doesn’t know what to do with “Usage”…

so, I must say, I’m lost now… it was not my first attempt in fixing that ugly mtrr problem – I tried almost evrything I could find on the internet – finally I rebuilt my memory to 512 MB again…
If you have any idea what I could try further I would be thankful otherwise I think it’s better to give up…
thanks a lot anyway for your effort, this was very kind of you!
best regards
Susanne