LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories
User Name
Password
LinuxQuestions.org Member Success Stories Just spent four hours configuring your favorite program? Just figured out a Linux problem that has been stumping you for months?
Post your Linux Success Stories here.

Notices


Reply
  Search this Thread
Old 05-04-2005, 05:39 AM   #1
sausagejohnson
Member
 
Registered: Mar 2004
Location: Canberra Area, Australia
Distribution: Kubuntu
Posts: 242

Rep: Reputation: 30
ATI 9600XT Xorg 6.8 driver with Kernel 2.6.11.8 confirmed


Just to let you know that I have just successfully managed to get the fglrx module working for my ATI 9600XT under Kernel version 2.6.11.8 using a single patch the driver. I don't have time to go into it tonight but I am happy to outline the steps tomorrow for anyone who is deseperate to get it running under this kernel version. By the way, this is with Fedora Core 3 but I'd imagine the steps would be largely similar for any linux flavour running xorg.
 
Old 05-04-2005, 08:13 PM   #2
Shade
Senior Member
 
Registered: Mar 2003
Location: Burke, VA
Distribution: RHEL, Slackware, Ubuntu, Fedora
Posts: 1,418
Blog Entries: 1

Rep: Reputation: 46
What patch is needed for this?

--Shade
 
Old 05-04-2005, 08:47 PM   #3
sausagejohnson
Member
 
Registered: Mar 2004
Location: Canberra Area, Australia
Distribution: Kubuntu
Posts: 242

Original Poster
Rep: Reputation: 30
Ok, here's the brief on how it is done.

Start your system choosing your default 2.6 kernel. For 2.4 kernel people, I won't guarentee anything.

1. Boot up linux and download the driver for X.Org 6.8 (www.ati.com)
2. Download the 2.6.11.8 kernel from www.kernel.org
3. Unpack the kernel source and move it to /usr/src as per standard and make the usual linux symlink to the directory.
4. Compile the kernel as per usual method however, when setting up what modules to include, make sure that under Character Devices that the agpgart and the DRM are set as modules, and NOT compiled into the kernel itself.
5. Continue with the compile, move the new kernel into /boot, make an initrd file and set grub to boot the new kernel.
6. Reboot your system and choose to boot into the new 2.6.11.8 kernel

Now for the X.org driver for the ATI Radeon card
1. Unpack the driver with rpm -Uvh fglrx_6_8_0-8.12.10-1.i386.rpm --force (the force means to ignore the fact that the xorg mesa driver does not want to be blown away by this driver)
2. The files will be unpacked automatically to /lib/modules/fglrx
3. Go into this directory (cd /lib/modules/fglrx/build_mod) and download the following patch file to this folder: http://www.uusikaupunki.fi/~sasuomin...2.6.11.7.patch
4. Now from this directory, patch the driver source with: patch -p1 < 8.12.10-2.6.11.7.patch (yes this patch is for 2.6.11.7 but it works perfectly with 2.6.11.8)
5. All hunks should succeed. Now you need to run the compile script but it's best to go back to console mode because when the driver completes it's compile, it will do a test that might fail if a DRM is in memory. Type: init 3
Log in again and make your way back to /lib/modules/fglrx/build_mod and do a chmod 755 make.sh to make it executable.
6. Compile the driver with ./make.sh
7. Come out one directory with: cd ../ and then make the next script executable with: chmod 755 make_install.sh
8. Run it: ./make_install.sh
9. All should compile and it will do a test to make sure it loads. If you do an lsmod | grep fglrx, you should see the driver loaded. If it is, you're ready to rock.
10. init 5 to reload linux in Xorg mode. Bring up a console and check out glxgears, then full screen it. Fast eh? Try fgl_glxgears. Try some GL screensavers.

Credits and greetings to shadowarts who's guide I used in the first place here: http://www.shadowarts.org/tutorials/...mments=1&id=14

Also to the unnamed guy who wrote the patch. Thank you!

If anyone has any questions, best to get me now while it's all still fresh in my mind.

Enjoy!
 
Old 05-06-2005, 07:03 AM   #4
karmazilla
LQ Newbie
 
Registered: Apr 2005
Posts: 13

Rep: Reputation: 0
Alright... so this will make 3D work on an ATi + Linux combination, I take it?


So there isn't any other way on FC3?

Being a damn and this computer meant for work (and I even do cooking better than C programming ),
I'de prefer if I could avoid the kernel-compilation part
 
Old 05-07-2005, 12:33 AM   #5
sausagejohnson
Member
 
Registered: Mar 2004
Location: Canberra Area, Australia
Distribution: Kubuntu
Posts: 242

Original Poster
Rep: Reputation: 30
I know kernel compilation can be considered a pain but the reason you go it is because if you don't have agpgart loadable as a module, and drm as a module, linux will have a lot fo trouble connecting to the ATI fglrx driver.

DRM must be a module instead of compiled directly into the kernel. I believe this is the case because the fglrx is a hybrid DRM module itself and the two will clash (someone correct me if I am wrong).

If you have read that people just manahed to compile the driver and it worked straight up, that would be luck of the draw that their distribution just happened to choose to have those two drivers as modules.

From memory, 2.6.9 standard that came with the Fedora Core DVD was set up this way and the driver just worked straight up, so it's worth giving it a shot. If it doesn't work, you can roll back the driver with:

rpm -e fglxrx_6_8_0

And everything will be as it was. If you get totally stuck I can do up a steo by step guide for compiling a kernel under FC3 for people too scared to try it.
 
Old 05-07-2005, 09:28 AM   #6
LinxNew
Member
 
Registered: Apr 2005
Distribution: Suse 10.0 Oss
Posts: 89

Rep: Reputation: 15
Can I use this patch for kernel 2.6.11.6 ?
 
Old 05-08-2005, 02:45 AM   #7
sausagejohnson
Member
 
Registered: Mar 2004
Location: Canberra Area, Australia
Distribution: Kubuntu
Posts: 242

Original Poster
Rep: Reputation: 30
Not sure. Never had that verson. Give it a shot if you have it.
 
Old 05-19-2005, 03:19 PM   #8
Robattack
LQ Newbie
 
Registered: Dec 2003
Location: Frankfurt, Germany
Distribution: mandriva2006 /dsl-2.0/gentoo-2006.0
Posts: 25

Rep: Reputation: 15
thx a lot

hi sausagejohnson,

thanks a lot. i have just upgraded my mandriva linux 10.1 to mandriva 10.2. unfortunately 3d-hw-acceleration didnt work anymore after that. i tried to reinstall the ati-drivers, but i dont managed it to work correctly. so after patching the fglrx-module (and recompiling it) everything works fine!

thx a lot :-D

p.s.: mandriva 10.2/2005le uses kernel 2.6.11-6, so this patch also works fine with this kernel-version
 
Old 05-19-2005, 06:50 PM   #9
sausagejohnson
Member
 
Registered: Mar 2004
Location: Canberra Area, Australia
Distribution: Kubuntu
Posts: 242

Original Poster
Rep: Reputation: 30
Excellent work. Ok so we can confirm that the patch works on the driver under .6, .7 & .8. It important though for people to remember that if they have a different kernel to these three, to always look for a patch released for their kernel by the guys in the forums at www.rage3d.com.
 
Old 07-02-2005, 08:25 PM   #10
sausagejohnson
Member
 
Registered: Mar 2004
Location: Canberra Area, Australia
Distribution: Kubuntu
Posts: 242

Original Poster
Rep: Reputation: 30
Since posting this, I've lost that patch file and it's been removed from the posted link. Does anyone have a copy of the patch file they can email me?
 
Old 07-03-2005, 12:11 AM   #11
Robattack
LQ Newbie
 
Registered: Dec 2003
Location: Frankfurt, Germany
Distribution: mandriva2006 /dsl-2.0/gentoo-2006.0
Posts: 25

Rep: Reputation: 15
hi sausagejohnson,

i think i still got the patch on my hd; i will look for it in about half an hour (just not on my machine right now ;-) ). if i do so, i will sent it right to you,

cu

robattack
 
Old 07-07-2005, 06:39 PM   #12
TomalakBORG
Member
 
Registered: Dec 2004
Posts: 245

Rep: Reputation: 30
Confirmed indeed- hopefuly we won't loose the patch this way!

Code:
diff -Nur fglrx-xorg.orig/firegl_public.c fglrx-xorg/firegl_public.c
--- fglrx-xorg.orig/firegl_public.c 2005-01-24 01:42:09.000000000 +0100
+++ fglrx-xorg/firegl_public.c 2005-01-24 01:28:21.000000000 +0100
@@ -1659,13 +1659,16 @@
 {
     unsigned long pte_linear;
     pgd_t* pgd_p;
+    pud_t* pud_p;
     pmd_t* pmd_p;
     pte_t* pte_p;
     pte_t  pte;
 
     pte_linear = VMALLOC_VMADDR(virtual_addr);  // convert to pte linear address (x86 => nop)
     pgd_p = pgd_offset(mm, pte_linear);
-    pmd_p = pmd_offset(pgd_p, pte_linear);
+    pud_p = pud_offset(pgd_p, pte_linear);
+    pmd_p = pmd_offset(pud_p, pte_linear);
+
 #ifndef FGL_ATOMIC_PTE
 #if LINUX_VERSION_CODE > 0x020500
     pte_p = pte_offset_kernel(pmd_p, pte_linear);
@@ -2085,6 +2088,7 @@
                                                    unsigned long address)
 {
     pgd_t* pgd_p;
+    pud_t* pud_p;
     pmd_t* pmd_p;
     pte_t* pte_p;
     pte_t  pte;
@@ -2185,7 +2189,8 @@
         /* alternatively we could generate a NOPAGE_OOM "out of memory" */
     }
     /*  locate medium level page table (x86 => nop) */
-    pmd_p = pmd_offset(pgd_p, pte_linear);
+    pud_p = pud_offset(pgd_p, pte_linear);
+    pmd_p = pmd_offset(pud_p, pte_linear);
     if (!pmd_present(*pmd_p))
     {
         __KE_ERROR("FATAL ERROR: User queue buffer not present! (pmd)\n");
@@ -2549,13 +2554,15 @@
 {
     unsigned long pte_linear;
     pgd_t* pgd_p;
+    pud_t* pud_p;
     pmd_t* pmd_p;
     pte_t* pte_p;
     pte_t  pte;
 
     pte_linear = VMALLOC_VMADDR(virtual_addr);  // convert to pte linear address (x86 => nop)
     pgd_p = pgd_offset(vma->vm_mm, pte_linear);
-    pmd_p = pmd_offset(pgd_p, pte_linear);
+    pud_p = pud_offset(pgd_p, pte_linear);
+    pmd_p = pmd_offset(pud_p, pte_linear);
 #ifndef FGL_ATOMIC_PTE
 #if LINUX_VERSION_CODE > 0x020500
     pte_p = pte_offset_kernel(pmd_p, pte_linear);
@@ -2704,13 +2711,13 @@
 #endif /* __ia64__ */
                 vma->vm_flags |= VM_IO; /* not in core dump */
             }
-            if (remap_page_range(FGL_VMA_API_PASS
+            if (remap_pfn_range(FGL_VMA_API_PASS
                                  vma->vm_start,
-                                 __ke_vm_offset(vma),
+                                 __ke_vm_offset(vma) >> PAGE_SHIFT,
                                  vma->vm_end - vma->vm_start,
                                  vma->vm_page_prot))
             {
-                __KE_DEBUG("remap_page_range failed\n");
+                __KE_DEBUG("remap_pfn_range failed\n");
                 return -EAGAIN;
             }
             vma->vm_flags |= VM_SHM | VM_RESERVED; /* Don't swap */
@@ -2771,13 +2778,13 @@
 			{
				if (__ke_vm_offset(vma) >= __pa(high_memory))
					vma->vm_flags |= VM_IO; /* not in core dump */
-				if (remap_page_range(FGL_VMA_API_PASS
+				if (remap_pfn_range(FGL_VMA_API_PASS
									 vma->vm_start,
-									 __ke_vm_offset(vma),
+									 __ke_vm_offset(vma) >> PAGE_SHIFT,
									 vma->vm_end - vma->vm_start,
									 vma->vm_page_prot))
 				{
-					__KE_DEBUG("remap_page_range failed\n");
+					__KE_DEBUG("remap_pfn_range failed\n");
					return -EAGAIN;
 				}
 #ifdef __x86_64__
@@ -2808,13 +2815,13 @@
 			{
				if (__ke_vm_offset(vma) >= __pa(high_memory))
					vma->vm_flags |= VM_IO; /* not in core dump */
-				if (remap_page_range(FGL_VMA_API_PASS
+				if (remap_pfn_range(FGL_VMA_API_PASS
									 vma->vm_start,
-									 __ke_vm_offset(vma),
+									 __ke_vm_offset(vma) >> PAGE_SHIFT,
									 vma->vm_end - vma->vm_start,
									 vma->vm_page_prot))
 				{
-					__KE_DEBUG("remap_page_range failed\n");
+					__KE_DEBUG("remap_pfn_range failed\n");
					return -EAGAIN;
 				}
 #ifdef __x86_64__
@@ -2858,6 +2865,37 @@
 
 #if LINUX_VERSION_CODE >= 0x020400
 
+#if LINUX_VERSION_CODE >= 0x02060b
+
+typedef struct {
+       void                    (*free_memory)(struct agp_memory *);
+       struct agp_memory *     (*allocate_memory)(size_t, u32);
+       int                     (*bind_memory)(struct agp_memory *, off_t);
+       int                     (*unbind_memory)(struct agp_memory *);
+       void                    (*enable)(u32);
+       int                     (*acquire)(void);
+       void                    (*release)(void);
+       int                     (*copy_info)(struct agp_kern_info *);
+} drm_agp_t;
+
+static const drm_agp_t drm_agp = {
+       &agp_free_memory,
+       &agp_allocate_memory,
+       &agp_bind_memory,
+       &agp_unbind_memory,
+       &agp_enable,
+       &agp_backend_acquire,
+       &agp_backend_release,
+       &agp_copy_info
+};
+#undef DRM_AGP_MODULE_GET
+#undef DRM_AGP_MODULE_PUT
+
+#define DRM_AGP_MODULE_GET      &drm_agp
+#define DRM_AGP_MODULE_PUT 
+
+#endif
+
 static const drm_agp_t  *drm_agp_module_stub = NULL;
 
 #define AGP_FUNCTIONS  8
Now that is taken care of, here is my experice.

I have not seen a need to update from 2.6.11.7 as it is still a very new kernel, and I don't feel like downloading another on my P.O.S. 56k connection. When I first compiled it, it gave me a segmentation fault when I'd do ./make_install. The module still worked, 3d-accel was going strong and I didin't complain; lsmod also reported a segmentation fault and would crash the terminal it was preformed in. Soon I found segementation faults popping up everywhere, namely almost every k-app so I was royally pissed. After a slackware reinstall and a recompile of the same old 2.6.11.7 kernel I recompiled the fglrx module without any problems! No segmentation faults, no nothing, just sweet glmatrix after 5 minutes of anxious waiting.

Thanx a bunch for bringing this patch to light, I seriously tried about every patch on the face of the planet before getting this to work. The procedure is always the same, configure kernel, install fglrx, patch fglrx, compile fglrx; but the patch is the killer. Thank you so much again!

-Bill
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
ati driver help (9600xt) Hidden.Elf Ubuntu 2 03-21-2005 11:22 PM
Updating ATI 9600XT driver iNFERiON Linux - Hardware 3 11-27-2004 07:38 PM
ATI driver: ATI 9600XT failed dependencies igmcdermott Linux - Software 2 08-06-2004 09:26 AM
ATI driver: ATI 9600XT failed dependencies igmcdermott Linux - Software 1 08-06-2004 02:26 AM
ATI driver: ATI 9600XT failed dependencies igmcdermott Linux - Software 1 08-06-2004 02:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General > LinuxQuestions.org Member Success Stories

All times are GMT -5. The time now is 06:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration