Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
fglrx 8.532 on kernel 2.6.27.3 with SMP
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
admax88
n00b
n00b


Joined: 23 Aug 2008
Posts: 21

PostPosted: Fri Oct 24, 2008 4:28 am    Post subject: fglrx 8.532 on kernel 2.6.27.3 with SMP Reply with quote

I decided to run the newest kernel, however the ati-drivers I was trying to install wouldn't compile for the new kernel. Here's the steps I took to get it running.

First of all, the reason that the kernel modules won't compile is due to the fact that that the kernel API for a function smp_call_function has changed. I suspect that thse steps would not be needed for an non SMP system, but I haven't tested it to confirm. To fix it all the calls in the file fglx_public.c need to be changed to conform to the new API. The following patch is a patch I created for use in the ebuild.

Code:

--- common.org/lib/modules/fglrx/build_mod/firegl_public.c   2008-10-23 22:05:01.000000000 -0400
+++ common/lib/modules/fglrx/build_mod/firegl_public.c   2008-10-23 22:06:20.000000000 -0400
@@ -2924,7 +2924,7 @@
 {
 #ifdef CONFIG_SMP
     /* write back invalidate all other CPUs (exported by kernel) */
-   if (smp_call_function(deferred_flush, NULL, 1, 0) != 0)
+   if (smp_call_function(deferred_flush, NULL, 0) != 0)
       panic("timed out waiting for the other CPUs!\n");
 
     /* invalidate this CPU */
@@ -4654,7 +4654,7 @@
    }
 
 #ifdef CONFIG_SMP
-   if (smp_call_function(KCL_setup_pat, NULL, 0, 1) != 0)
+   if (smp_call_function(KCL_setup_pat, NULL, 1) != 0)
        return 0;
 #endif
    KCL_setup_pat(NULL);
@@ -4673,7 +4673,7 @@
     }
 
 #ifdef CONFIG_SMP
-    if (smp_call_function(KCL_restore_pat, NULL, 0, 1) != 0)
+    if (smp_call_function(KCL_restore_pat, NULL, 1) != 0)
        return;
 #endif
     KCL_restore_pat(NULL);


To use this patch you need to first create a portage overlay if you don't already have one. Then create the directory x11-drivers/ati-drivers. Copy the ati-drivers-8.532.ebuild file from the main portage tree. Also copy the existing files/8.532 directory and any patches withing in. Next, save the above patch file as smp-fix.patch in the ati-drivers/files/8.532 directory.

Next the ebuild needs to be modified to apply the new patch. Open the ati-drivers-8.532.ebuild file in the overlay and look for the src_unpack() function. In that function, just after the section:
Code:

   if use acpi; then
      sed -i \
         -e "s:/var/lib/xdm/authdir/authfiles/:/var/run/xauth/:" \
         -e "s:/var/lib/gdm/:/var/gdm/:" \
         "${S}/common/etc/ati/authatieventsd.sh" \
         || die "sed failed."

      # Since "who" is in coreutils, we're using that one instead of "finger".
      sed -i -e 's:finger:who:' \
         "${S}/common/usr/share/doc/fglrx/examples/etc/acpi/ati-powermode.sh" \
         || die "Replacing 'finger' with 'who' failed."
      # Adjust paths in the script from /usr/X11R6/bin/ to /opt/bin/ and
      # add funktion to detect default state.
      epatch "${FILESDIR}"/8.532/ati-powermode-opt-path-2.patch
   fi


insert the following

Code:

   if linux_chkconfig_present SMP; then
      epatch "${FILESDIR}"/8.532/smp-fix.patch
   fi


Sidenote, the if in that statement is not really required, since the patch doesn't have any affect on non SMP machines.

After those changes, run "ebuild ati-drivers-8.532 manifest" to create a manifest for the new ebuild. After that you should be able to successfully compile and use fglrx on a 2.6.27.3.

Hopefully it works for you, its working just fine for me so far. Please post if you have any problems or if my directions are unclear.
Back to top
View user's profile Send private message
admax88
n00b
n00b


Joined: 23 Aug 2008
Posts: 21

PostPosted: Fri Oct 24, 2008 4:45 am    Post subject: Reply with quote

Also, I forgot to mention. The kernel needs to have pci_find_* deprecated api enabled under Bus options. And as people have talked about earlier in using fglrx with newer kernels you need to edit the kernel source file arch/x86/kernel/init_task.c

Change the line
Code:

EXPORT_UNUSED_SYMBOL(init_mm);

to
Code:

EXPORT_SYMBOL(init_mm);


For some reason or another fglrx wants to use the init_mm symbol even though is now marked as unused.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum