Announcement

Collapse
No announcement yet.

fglrx kernel module compile failed

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • fglrx kernel module compile failed

    Hey guys,

    I've been trying to compile the kernel module for my system but it fails with this following message:

    /usr/src/kernel-modules/fglrx/firegl_public.c: In function ‘KCL_flush_tlb_onepage’:
    /usr/src/kernel-modules/fglrx/firegl_public.c:2352: error: too many arguments to function ‘on_each_cpu’
    /usr/src/kernel-modules/fglrx/firegl_public.c: In function ‘__ke_flush_cache’:
    /usr/src/kernel-modules/fglrx/firegl_public.c:2791: error: too many arguments to function ‘smp_call_function’
    /usr/src/kernel-modules/fglrx/firegl_public.c: In function ‘__ke_vm_phys_addr_str’:
    /usr/src/kernel-modules/fglrx/firegl_public.c:3522: warning: return makes pointer from integer without a cast
    /usr/src/kernel-modules/fglrx/firegl_public.c:3523: warning: return makes pointer from integer without a cast
    /usr/src/kernel-modules/fglrx/firegl_public.c:3524: warning: return makes pointer from integer without a cast
    /usr/src/kernel-modules/fglrx/firegl_public.c:3526: warning: return makes pointer from integer without a cast
    /usr/src/kernel-modules/fglrx/firegl_public.c: In function ‘KCL_enable_pat’:
    /usr/src/kernel-modules/fglrx/firegl_public.c:4063: error: too many arguments to function ‘smp_call_function’
    /usr/src/kernel-modules/fglrx/firegl_public.c: In function ‘KCL_disable_pat’:
    /usr/src/kernel-modules/fglrx/firegl_public.c:4082: error: too many arguments to function ‘smp_call_function’
    /usr/src/kernel-modules/fglrx/firegl_public.c: At top level:
    /usr/src/kernel-modules/fglrx/firegl_public.c:5774: warning: initialization from incompatible pointer type
    /usr/src/kernel-modules/fglrx/firegl_public.c:5800: warning: initialization from incompatible pointer type
    make[1]: *** [/usr/src/kernel-modules/fglrx/firegl_public.o] Error 1
    make: *** [_module_/usr/src/kernel-modules/fglrx] Error 2
    make: Leaving directory `/usr/src/linux-2.6.27.4'
    This is a vanilla kernel install of Linux 2.6.27.4 kernel (latest version at time of writing).

    Thanks,
    deltatux

  • #2
    Use 8-10 driver.

    Comment


    • #3
      Originally posted by Kano View Post
      Use 8-10 driver.
      Hi, thanks for the quick reply, this is the 8.10 driver compilation. It still fails to compile into the kernel as a module.

      deltatux

      Comment


      • #4
        You are right, 8-10 needs the same patch as 8-9.

        Comment


        • #5
          Originally posted by Kano View Post
          You are right, 8-10 needs the same patch as 8-9.
          What patch do you speak of =S? I wasn't aware of any patches.

          deltatux

          Comment


          • #6
            http://www.phoronix.com/forums/showp...23&postcount=4

            Comment


            • #7
              I got failed "hunks"

              sudo patch < firegl_public.patch
              patching file firegl_public.c
              Hunk #1 succeeded at 207 with fuzz 1 (offset 8 lines).
              Hunk #2 FAILED at 264.
              Hunk #3 FAILED at 2530.
              Hunk #4 FAILED at 2916.
              Hunk #5 FAILED at 2932.
              Hunk #6 FAILED at 2952.
              Hunk #7 FAILED at 2960.
              Hunk #8 succeeded at 4073 (offset -587 lines).
              patch unexpectedly ends in middle of line
              Hunk #9 FAILED at 4092.
              7 out of 9 hunks FAILED -- saving rejects to file firegl_public.c.rej
              Help please?

              Thanks,
              deltatux

              Comment


              • #8
                ok, i even tried this patch, it doesn't work either >.>"

                http://bugs.gentoo.org/attachment.cg...88&action=view

                sudo patch < firegl_public.patch
                patching file firegl_public.c
                Hunk #1 succeeded at 207 with fuzz 1 (offset 8 lines).
                Hunk #2 FAILED at 264.
                Hunk #3 FAILED at 2530.
                Hunk #4 FAILED at 2916.
                Hunk #5 FAILED at 2932.
                Hunk #6 FAILED at 2952.
                Hunk #7 FAILED at 2960.
                Hunk #8 succeeded at 4073 (offset -587 lines).
                Hunk #9 FAILED at 4092.
                7 out of 9 hunks FAILED -- saving rejects to file firegl_public.c.rej
                Can anyone please help?

                Thanks,
                deltatux

                Comment


                • #9
                  Funnyly it works in my script If you use Debian or Ubuntu you can use it:

                  http://kanotix.com/files/install-fglrx-debian.sh

                  Do NOT try this with xserver 1.5 as the current fglrx driver does not support it. Put the ati installer into /usr/src dir to avoid download.

                  Comment


                  • #10
                    Originally posted by Kano View Post
                    Funnyly it works in my script If you use Debian or Ubuntu you can use it:

                    http://kanotix.com/files/install-fglrx-debian.sh

                    Do NOT try this with xserver 1.5 as the current fglrx driver does not support it. Put the ati installer into /usr/src dir to avoid download.
                    Maybe the reason why it doesn't work is because the patches are not for my distro? I use OpenSUSE 11.

                    Would that be why? but I don't see how it correlates if that's the case...

                    Thanks,
                    deltatux
                    Last edited by deltatux; 11-03-2008, 12:14 PM.

                    Comment


                    • #11
                      Perhaps you use partially patched sources, on pure ones they apply without problems.

                      Comment


                      • #12
                        reatch and script

                        Kano's patch is very Debian specific - it might run on Ubuntu or another dpkg based system, but not any rpm based system.

                        firegl_public.c changed between 8.9 and 8.10. that is why the patch doesn't apply cleanly.

                        I haven't tested this, but KDiff3 merged without complaint:
                        Code:
                        --- 8.10/firegl_public.c	2008-10-14 09:25:30.000000000 -0600
                        +++ new/firegl_public.c	2008-11-04 21:41:39.000000000 -0700
                        @@ -200,6 +200,12 @@
                         #define preempt_enable()
                         #endif
                         
                        +/* Since 2.6.27 smp_call_function doesn't have a nonatomic/retry argument */
                        +#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,27)
                        +#define SMP_CALL_FUNCTION(func, info, retry, wait) smp_call_function(func, info, wait)
                        +#else
                        +#define SMP_CALL_FUNCTION(func, info, retry, wait) smp_call_function(func, info, retry, wait)
                        +#endif
                         // ============================================================
                         /* globals */
                         
                        @@ -251,7 +257,7 @@
                         const char BUILD_KERNEL_HAS_MODVERSIONS_CLEARED;
                         #endif
                         
                        -#ifdef __SMP__
                        +#ifdef CONFIG_SMP
                         const unsigned long __ke_SMP_State = 1;
                         const char BUILD_KERNEL_HAS_SMP_SET;
                         #else
                        @@ -2348,8 +2354,8 @@
                         {
                         /*Some kernel developer removed the export of symbol "flush_tlb_page" on 2.6.25 x86_64 SMP kernel.
                           Define a simple version here.*/
                        -#if defined(__x86_64__) && defined(__SMP__) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)) 
                        -    on_each_cpu(KCL_flush_tlb_one, &va, 1, 1);
                        +#if defined(__x86_64__) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,25)) 
                        +    on_each_cpu(KCL_flush_tlb_one, &va, 1);
                         #else
                             flush_tlb_page(vma, va);
                         #endif
                        @@ -2766,7 +2772,7 @@
                         
                         /*****************************************************************************/
                         
                        -#ifdef __SMP__
                        +#ifdef CONFIG_SMP
                         static atomic_t cpus_waiting;
                         
                         static void deferred_flush(void* contextp)
                        @@ -2782,13 +2788,13 @@
                         	while (atomic_read(&cpus_waiting) > 0)
                         		barrier();
                         }
                        -#endif /* __SMP__ */
                        +#endif /* CONFIG_SMP */
                         
                         int ATI_API_CALL __ke_flush_cache(void)
                         {
                        -#ifdef __SMP__
                        +#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, 1, 0) != 0)
                         		panic("timed out waiting for the other CPUs!\n");
                         
                             /* invalidate this CPU */
                        @@ -2802,7 +2808,7 @@
                         
                         	while (atomic_read(&cpus_waiting) > 0)
                         		barrier();
                        -#else /* !__SMP__ */
                        +#else /* !CONFIG_SMP */
                         #if defined(__i386__) || defined(__x86_64__)
                         	asm volatile ("wbinvd":::"memory");
                         #elif defined(__alpha__) || defined(__sparc__)
                        @@ -2810,7 +2816,7 @@
                         #else
                         #error "Please define flush_cache for your architecture."
                         #endif
                        -#endif /* !__SMP__ */
                        +#endif /* !CONFIG_SMP */
                         
                             //for kernel 2.6.25, tlb_flush has been included when calling set_pages_*.
                             #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,25)
                        @@ -4060,7 +4066,7 @@
                            }
                         
                         #ifdef CONFIG_SMP
                        -   if (smp_call_function(KCL_setup_pat, NULL, 0, 1) != 0)
                        +   if (SMP_CALL_FUNCTION(KCL_setup_pat, NULL, 0, 1) != 0)
                                return 0;
                         #endif
                            KCL_setup_pat(NULL);
                        @@ -4079,7 +4085,7 @@
                             }
                         
                         #ifdef CONFIG_SMP
                        -    if (smp_call_function(KCL_restore_pat, NULL, 0, 1) != 0)
                        +    if (SMP_CALL_FUNCTION(KCL_restore_pat, NULL, 0, 1) != 0)
                                return;
                         #endif
                             KCL_restore_pat(NULL);

                        Comment


                        • #13
                          I'll try it again when i have time to play with 2.6.27.4.

                          Thanks,
                          deltatux

                          Comment


                          • #14
                            It failed again:

                            deltatux@penguin1:/usr/src/kernel-modules/fglrx> sudo patch < firegl_public.patch
                            patching file firegl_public.c
                            Hunk #1 succeeded at 207 with fuzz 1 (offset 7 lines).
                            Hunk #2 FAILED at 264.
                            Hunk #3 FAILED at 2361.
                            Hunk #4 FAILED at 2779.
                            Hunk #5 FAILED at 2795.
                            Hunk #6 succeeded at 2815 (offset 7 lines).
                            Hunk #7 succeeded at 2823 (offset 7 lines).
                            Hunk #8 succeeded at 4073 (offset 7 lines).
                            Can you post your patched firegl_public.c file?

                            Thanks,
                            deltatux

                            Comment


                            • #15
                              I'll post it when I get home from work.

                              Just in case, please make sure you are patching an unmodified source tree. If Kano's patch partially applied, mine won't work anymore, so you would need to unpack again.

                              Comment

                              Working...
                              X