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.
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.






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).