NotebookForums.com › Forums › General Notebook Discussions › Linux & Other OS's › trying to use the ati drivers with 2.6.0-test1
New Posts  All Forums:Forum Nav:

trying to use the ati drivers with 2.6.0-test1

post #1 of 14
Thread Starter 
i've been trying for a while to make ati's drivers work with 2.6.0-test1. supposedly the next version of the drivers will support 2.6, but of course, i couldn't wait. i've made some progress, but i'm a little stuck now. i'm still trying, but i figure i would post what i've gotten so far in case someone else wanted to try.

first of all, i am trying the new experimental drivers - version 3.2.03. they were posted for a little while on the ati driver page at http://www.schneider-digital.de/html/download_ati.html, but were pulled and it's back to 2.9.13_2. but some people got them, so if you look around the net, you can find them. i want to use them because they support FSAA and tv-out, which is nice. i haven't tried making 2.9.13_2 work yet. maybe i'll give them a shot when i get frustrated and give up on 3.2.

ok, the following requires a little source code editing:

in 2.6, the module format has changed, and some old stuff is deprecated. so we need to replace a couple old functions in the source with their newer counterparts.

the files that we need to edit are agpgart_be.c and firegl_public.c in the /lib/modules/fglrx/build_mod directory. (or the equivalent, if you put it somewhere else) go through these files, and replace all occurences of

"MOD_DEC_USE_COUNT"

with

"module_put(THIS_MODULE)"

(without quotes, of course)

likewise, replace all occurences of

"MOD_INC_USE_COUNT"

with

"try_module_get(THIS_MODULE)"

MOD_DEC_USE_COUNT and MOD_INC_USE_COUNT are deprecated - you'll see messages about that if you try and compile without replacing those functions. note - these are case sensitive; i remember at least on occurrence of 'mod_dec_use_count()', but that's a function. i'm pretty sure that shouldn't be changed, but i may try changing it sometime if i can't make it work.

one other change - in firegl_public.c, change any occurrences of

"pmd_offset"

to

"pmd_offset_map"

another note - if you're using a text editor to search and replace, make sure you're replacing _just_ pmd_offset. there's at least one occurrence of pmd_offset_map in there already, so a search and replace all will change that to pmd_offset_map_map, which doesn't exist.

that's all the source code editing we need to do. however, the old make.sh script won't work anymore. the module format has changed to the extension *.ko, so we need to create our own Makefile. so create a file called 'Makefile' in that build_mod directory, and put this bit of script in there:

ifneq ($(KERNELRELEASE),)

EXTRA_CFLAGS := -DFIREGL_410 -DFGL_LINUX253P1_VMA_API -Idrivers/char/drm/ -DFGL
obj-m := fglrx.o
fglrx-objs := agp3.o nvidia-agp.o agpgart_be.o i7505-agp.o firegl_public.o libfglrx_ip.a.GCC3

else
KDIR := /lib/modules/$(shell uname -r)/build
PWD := $(shell pwd)

default:
$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
endif


one thing that is not showing up is whitespace, since the forum seems to remove it from posts. there is an important bit of whitespace in front of the $(MAKE) line, under 'default:'. all commands have to have a tab in front of them, or else make won't see that it's a command and will skip it. so, those last three lines should actually be like:

default:
<tab>$(MAKE) -C $(KDIR) SUBDIRS=$(PWD) modules
endif

with '<tab>' being an actual tab.

now run 'make' in that build_mod directory. it should compile, and you'll end up with a file called 'fglrx.ko'. you can install that into your modules directory or just insmod in directly. i insmod it because it would become a pain to move the file around every time i used a new kernel.

so after removing the radeon.ko module and insmod-ing the fglrx.ko module, i ran startx and ended up with a black screen... i ssh'd into the comp and looked at the X log. the log ends with these lines:

drmOpenDevice: minor is 0
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 6, (OK)
drmOpenDevice: minor is 0
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 6, (OK)
drmOpenDevice: minor is 0
drmOpenDevice: node name is /dev/dri/card0
drmOpenDevice: open result is 6, (OK)
drmGetBusid returned ''
(II) fglrx(0): [drm] created "fglrx" driver at busid "PCI:1:0:0"
(II) fglrx(0): [drm] added 8192 byte SAREA at 0xf9f34000
(II) fglrx(0): [drm] mapped SAREA 0xf9f34000 to 0x40228000
(II) fglrx(0): [drm] framebuffer handle = 0x90000000
(II) fglrx(0): [drm] added 1 reserved context for kernel
(II) fglrx(0): DRIScreenInit done
(II) fglrx(0): Kernel Module Version Information:
(II) fglrx(0): Name: fglrx
(II) fglrx(0): Version: 3.2.0
(II) fglrx(0): Date: Jul 10 2003
(II) fglrx(0): Desc: ATI Fire GL DRM kernel module
(II) fglrx(0): Kernel Module version matches driver.
(II) fglrx(0): Kernel Module Build Time Information:
(II) fglrx(0): Build-Kernel UTS_RELEASE: 2.6.0-test1-mm2
(II) fglrx(0): Build-Kernel MODVERSIONS: no
(II) fglrx(0): Build-Kernel __SMP__: no
(II) fglrx(0): Build-Kernel PAGE_SIZE: 0x1000
(II) fglrx(0): [drm] register handle = 0xe0000000

and that's it, even with 'startx -- -logverbose 8'.

i saw that there was no smp support, and was confused, since i _am_ running smp. since the make.sh script probably detected and set it before, and i couldn't use the script now, i had to set it some other way. i forced it by manually defining it near the top of firegl_public.c with the line

#define __SMP__

... but i have a feeling that that's bad and probably not the way i should do it. whatever; this whole thing is already a hack job as it is. fortunately, doing that changes the line in the x log to

(II) fglrx(0): Build-Kernel __SMP__: yes

which is better, i suppose. but the log still stops at the same spot, and x still gives me a black screen.

so that's where i am now. it compiled and inserted into the kernel without problems, which is good progress. i'll continue messing around with it. but anyone who wants to can try this and see if they can get better results or figure out what's wrong.
post #2 of 14
Thread Starter 
good news for gentoo users running 2.6-test1 - the newest version of the ati-drivers in portage (2.9.13-r1 - it's not even listed, you have to manually emerge /usr/portage/media-video/ati-drivers/ati-drivers-2.9.13-r1.ebuild) are hacked up to work with 2.6, so i don't have to bother with this anymore. i took a look and they ended up doing similar stuff that i did. but spyderous and lu_zero (the devs who hacked this up) did it a cleaner way than replacing deprecated stuff with newer replacements. for example, instead of replacing pmd_offset, they put this piece of code at the top:

#include <asm/pgtable.h> //for pmd_offset

#ifndef pmd_offset

static inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address)
{
return (pmd_t *) dir;
}

#endif

so they didn't have to do any replacing of that function. (naturally, they'd be better at this than me)

so now i'm running 2.6.0-test1-mm2 with ati-drivers 2.9.13, and i get really great fps in quake3 - i ran a demo that came with challenge promode arena that was a bunch of running around with not much action, and got 226 fps. and the traditional 'four' demo that comes with quake gave me something in the high hundreds. (don't remember exactly.)

there's only one tiny bug... the fglrx module just shows up as "1" in the lsmod list. but whatever; i have a nice fast dev kernel, and an accelerated 2d desktop as well as accelerated 3d with the ati-drivers, so i'm satisfied. now the next step is to wait for them to re-release 3.2, which will compile natively with 2.6 and will support FSAA and tv-out.
post #3 of 14
Good work!

Well, I am trying to get all my modules and stuff working with RH9 and 2.6.0-test1 which I upgraded to 9.0.93 beta. It is actually not that much different other than the graphical boot.

One problem I had was with the new module format. I am still having to load my modules by hand even though I used the utility to convert to the modprobe.conf style. The other problem has been the mkinitrd asking for the old insmod on boot. I fixed that my editing /sbin/mkinitrd and adding a line below the old insmod line reading this:

inst /sbin/insmod.static "$MNTIMAGE/bin/insmod"
inst /sbin/insmod.static.old "$MNTIMAGE/bin/insmod.old"

Then I remade the initrd file. Yes, I had to use the rescue cd to fix it. That fixed the kernel panic I was getting (because it couldn't load ext3.o so it couldn't find the initrd file). Anyway, I'm gonna try the DRM drivers for my old ATI Mach64. Rumor has it that I'm going to have to hack up the drm stuff to get it working. Argh.
post #4 of 14
I figured that this would be the best place to ask this question. I am currently rebuilding my gentoo system on my 5670 so that I can start from scratch with v2.6. I am still emerging the initial ebuilds right now required for my system to work correctly (I am about half way through the 'emerge system' phase for those gentoo users out there). My question is, are there any special things that need to be done to get xfree working with 2.6? Also, I have only been using xfree-drm for my 3d acceloration, and only tried the ati drivers once, a long time ago (well a few months ago). Should I go with the ati drivers now, will xfree-drm still work, and which ones will give me better performance. Also, if anyone has a link or two of some "heads up things" that I should be aware of with v2.6 it would be greatly appriciated.

I know there are no stupid questions, just stupid people, so consider me a stupid person and please ignore the stupid nature of these questions
post #5 of 14
Thread Starter 
no prob; a stupid question to one person could be a perfectly logical question to someone else.

xfree is, for the most part, set up the same way. however, there are a couple nuances:

there is actually a synaptics driver built into the kernel. it doesn't replace the need for a mouse driver, but it sets up the synaptic driver from the start, in case you don't use x at all and use gpm or something.
however, the way it exports the mouse device is no longer the same - it's not /dev/psaux anymore. it's run through the event interface, which you need to enable support for under "Input Core", and then the device will be /dev/input/eventx. (it depends, you can cat and test to see which it is. for example, mine is /dev/input/event0)
you also need an event interface-aware synaptics driver.

http://w1.894.telia.com/~u89404340/touchpad/

this driver is an updated version of the one at tuxmobil, with support for the event interface. (plus other fixes, like getting that center scroll button working, etc) just use that driver as the mouse driver for X, the device is the event interface device, and the protocol is "event".


as to the 3d drivers:
drm or ati is still a matter of preference, as it always has been. ati drivers have 2d acceleration and better 3d performance in games, but tend to use the cpu a lot and generate heat. drm is open source, more stable, and easier on the cpu (both during games and while idling in x), but not as fast.

i personally use the ati-drivers; i _would_ use drm since i'm usually on the desktop, but i use all sorts of graphical features in fluxbox like transparent menus, rounded corners, transparent terminal windows, etc, so 2d acceleration helps that out. i just throttle it.

you can switch between these if you want to (though i don't really see why). it requires just an unload of the old module, load of the one you want to use, changing your XF86Config (actually, i have two... XF86Config.drm and XF86Config.ati, and i just symlink into place the one i want to use), and running an opengl-update xfree or opengl-update ati, whichever is appropriate.

notes on using these drivers:

for both of these, you must have agpgart compiled directly into the kernel, along with the correct chipset, or else direct rendering won't work.

the ati-drivers require hacking up, but since you're using gentoo, just emerge the ebuild i mentioned above. however, you _must_ tell the drivers to use an external agpgart (the option in the xf86config is something like "useinternalAGPGART" "no", check what fglrxconfig outputs). the drivers will hang if you try and use their internal agpgart.

with drm, just enable support in the kernel for drm, and set 'ATI Radeon' as a _module_. (the dev kernel drm is updated so you no longer have to use an external package. in fact, _don't_ install the xfree-drm ebuild) this is important; x tries to load the radeon module if it's not loaded - the problem being, it will try and load the old 2.4 driver, which will make things hang. if support is directly in the kernel or not present at all for radeon, x will see no radeon module loaded, and will load the old module and crash. if it's a module and autoloaded at boot (or loaded sometime before starting x), x will see the radeon module is loaded, and use that one without loading the old one.

what else is a heads up with 2.6...

make sure you emerge module-init-tools, these are the new module loading tools for 2.6; the old ones don't work anymore.

make a directory, /sys. 2.6 uses sysfs mounted there, which is like proc, but a lot better and cleaner. proc will still be mounted, but you have to make that directory for sysfs to mount. 2.6 modules use sysfs to export status info now.

in kernel config, you _need_ Unix98 PTY support (in character devices, i think? don't remember) as opposed to 2.4, where you didn't. and, subsequently, enable devpts support under 'pseudo filesystems' in file system support. you also need to enable a couple VT options that you didn't have to in 2.4. (i don't remember which ones; just build a 2.6 config from scratch instead of copying over a 2.4 one, and you should be fine without worrying about VT)

in /etc/modules.autoload.d, create kernel-2.6. (to match the other kernel-2.4 and kernel-2.5 in there.) use that to specify modules to autoload.

with the alsa driver - if you use the one in the kernel (which you should), then unmerge the alsa-driver ebuild. however, other programs that have the alsa use flag enabled will complain about it not being there, so inject it into portage, since you technically have it as part of the kernel, just not as a separate package. the /etc/init.d/alsasound script won't be there anymore... you can find or make a script to replace it for storing and reloading mixer settings, but i just use 'alsactl restore' and 'alsactl store' in local.start and local.stop, respectively. less work.

oh yes, the device system during boot has changed for me. (most people don't have this problem, but it's present in the mm patches. it'll be fixed at some point, but this is just in case you run into it) specifying 'root=/dev/hdax' in grub as a kernel parameter won't work anymore for me. (i get a 'VFS unable to mount root' error for reiserfs partitions) so here is how you specify it:

root=0306 (which is equivalent to /dev/hda6)

this is the major and minor device number of the hard drive, and the partition.

03 is the major device number of the first ide bus, encompassing hda and hdb. (the leading zero is ignored, so you could just do 306, but i put the 0 there for organizational purposes)

the 0 after that is the minor device number. hda has a minor device number of 0, and hdb has a minor device number of 64. however, that 64 is in hexadecimal, so it's actually 4. (4x16=64)

and 6 is the partition number.

so, hda1 is 0301, hda4 is 0304, hdb1 is 0341, hdb3 is 0343, etc. you get the idea. i'm not going to bother going into hdc and on, since i doubt you'd be booting from a drive that's not on the first ide bus.

um... if you're into that sort of thing, you can change the elevator the scheduler uses by appending the elevator= parameter to grub. so, elevator=as for the anticipatory scheduling elevator, and elevator=cfq for the controlled fair queueing elevator. anticipatory scheduling is the default, and is the better one anyway, so you probably don't have to worry about this. but just in case...

... that's all i can think of at the moment. i'll post again if i remember anything i missed.
post #6 of 14
First of all, I would like to thank you for saving me hours of searching with the information that you have provided me. Right now, I seem to have hit another brick wall. I am unable to compile svgalib against my kernel. I have searched the gentoo boards and have found several people reporting this problem, but noone with a solution. Also, I saw a few people mention the mm sources and checked up a little and saw that it was basicly the latest dev. sources with some nice additions. My question is, do you know of a site that lits all of the changes that occur with this source disto? I tried to search a bit on line, but using lynx to do web browsing is not always the easiest thing to do (I am typing this from my sisters laptop). Thanks for all of the help.

Rob

[edit] I forgot to ask. Also, what steps would I have to do to change my kernel to say the mm sources. Would I have to reemerge/rebuild xfree and kde (kde isn't finished yet because of the svgalib problem, but it only has like 5 ebuilds left to go), or do I simply emerge the new kernel, build it, and make sure that /usr/src/linux points to the new kernle. Thanks again.
post #7 of 14
Thread Starter 
sorry, i can't really help you with svgalib; i don't use it directly and have never had compilation problems with it. i prefer the framebuffer. what you might want to do is either merge a newer masked version, in case there's a bug fix, or you could search gentoo bugzilla and see if someone has a patch or updated ebuild or solution (or something).

actually, i haven't found a place that explicitly lists the mm-sources changes; if i'm really curious, i just read the patch file. i know it almost always includes con kolivas's Oxint scheduler patches. however, since it always includes the latest patches, there is more of a possibility that something could break, so don't use them if you don't want to risk that. my 2.6.0-test1-mm2's usb driver is broken on occasion, so i can only use my usb mouse about half the time. and the wpadding patch that was in -mm1 broke compilation with gcc3 for a few people. and sometimes, the Oxint patches make a bad combo and cause the comp to slow down to a crawl. (mm-sources is essentially the testing branch for the test kernel)

changing to the mm-sources from the dev kernel is just like switching from vanilla to gentoo; you just redo and switch the kernel (like you said, emerge, build, symlink). you don't have to recompile anything else, unless you're using the device mapper for LVM; at that point, you would have to recompile libdevmapper.
post #8 of 14
Does anybody have any tips on manually hacking up the ATI drivers for those who don't use Gentoo?

I can't find any information on this via googling.

My overall goal is to be able to use acpi and software suspend, and not lose the ability to play games. For the 2.4.20 kernel I'm using right now, acpi doesn't seem to support anything but whether or not my AC power is plugged in, and I can't get the swsusp patch to work (as it's designed for 2.4.21, which I can't seem to use on the 5670).
post #9 of 14
Thread Starter 
i believe the newer versions of the ati drivers, 3.2.0 and up, compile for 2.6 natively. try them if you haven't already:

http://www.schneider-digital.de/html/download_ati.html

if you still can't get it to work, i can port the ebuild to a shell script if you want.

if you want to take a risk, you could try the 2.6 test drivers. they come with software suspend, and also have experimental acpi sleep state support. (i haven't tried either feature, though)

have you tried using the 2.4.21 patch on 2.4.20? it's only a minor revision change; it may work anyway. and if it doesn't, there will probably be just a few hunks you have to edit by hand.
post #10 of 14
Upgraded (was using 2.9.13 before), but the fglrx module still won't compile. Also, my glxgears score has now gone down significantly. I used to be between 1200 and 1300 fps, but now I'm at 1000. Strange.

Guess there are some definite benefits to running Gentoo.
post #11 of 14
Thread Starter 
the 3.x series is slower in general, for some reason. but it supports cool stuff like FSAA.
post #12 of 14
While I don't have a great deal of expereance with the ati drivers for linux, with the tests I did make, I found that the xfree-drm drivers (built into the latest kernels correctly for the ati mobility 9000) tends to get a much better score. I get around 2000 to 2100 with no modifications to the XF86Config file at all (and, while I forgot my scores with mods, I believe it was 400-600 frames higher). I have read, however, that the drm drivers lack some of the features of the ati drivers, but since I still have yet to get winex to work correctly with any of my favorite games, I can't tell which ones yet.
post #13 of 14
Thread Starter 
the ati-drivers have a lot of game-specific optimizations. try fgl_glxgears, or a quake3 timedemo to compare. they also have 2d acceleration.
post #14 of 14
I never tested the drm drivers under kernel 2.4; just under 2.6 (where they displayed horribly erratic graphics and then crashed the machine)

Haven't had much time over the weekend to sit at the computer, but I'll have to test gameplay (ut2003 comes with a native Linux version--if you have it, the installer is on CD 3) and see if performance has suffered at all. If it has, I might as well go back to the 2.9 driver, as the only reason I upgraded was to see if the 3.2 driver would compile for kernel 2.6.
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Linux & Other OS's
NotebookForums.com › Forums › General Notebook Discussions › Linux & Other OS's › trying to use the ati drivers with 2.6.0-test1