Announcement

Collapse
No announcement yet.

patch: vanilla fglrx for 2.6.29

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

  • patch: vanilla fglrx for 2.6.29

    Someone released a giant patch for fglrx that makes it compatible with 2.6.29.

    Well, I really don't know how they do it, but for some reason their patches have so many offset errors and doesn't work out of the box. They even copied the kernel headers from their kernel and put them into the patch... WTF, hahahaha. So the Mandriva guys fixed it (thanks!) and i modified the patch to work stand alone - as in, you extract the fglrx .run file and do patch -p1 < ../patch.file.

    Please, the next person who makes a patch... it would be really nice if you could explain to us how you always seem to have a different source than the rest of us as the patches never seem work the first time.

    It's as if the patches are designed to infuriate users or try to spread FUD over fglrx. Whatever the deal, it works, so keep it up if that's your objective!

    Anyway, fixed the patch, gg noobs:

    Code:
    diff -Nparu a/common/lib/modules/fglrx/build_mod/firegl_public.c b/common/lib/modules/fglrx/build_mod/firegl_public.c
    --- a/common/lib/modules/fglrx/build_mod/firegl_public.c	2009-01-23 20:00:26.000000000 -0200
    +++ b/common/lib/modules/fglrx/build_mod/firegl_public.c	2009-02-13 15:25:00.000000000 -0200
    @@ -1460,7 +1460,11 @@ KCL_TYPE_Pid ATI_API_CALL KCL_GetTgid(vo
      */
     KCL_TYPE_Uid ATI_API_CALL KCL_GetEffectiveUid(void)
     {
    +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,28)
    +    return current->cred->euid;
    +#else
         return current->euid;
    +#endif
     }
     
     /** /brief Delay execution for the specified number of microseconds
    @@ -1832,15 +1836,30 @@ int ATI_API_CALL KCL_PosixSecurityCapChe
      */
     void ATI_API_CALL KCL_PosixSecurityCapSetIPCLock(unsigned int lock)
     {
    +
    +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,28)
    +    struct cred *new = prepare_creds();
    +    if (!new) {
    +	    printk(KERN_ERR "fglrx: could not allocate memory\n");
    +	    return;
    +    }
    +#else
    +#define new current
    +#endif
         if (lock == 0 )
         {
    -        cap_lower(current->cap_effective, CAP_IPC_LOCK);
    +        cap_lower(new->cap_effective, CAP_IPC_LOCK);
         }
         else
         {
    -        cap_raise(current->cap_effective, CAP_IPC_LOCK);
    +        cap_raise(new->cap_effective, CAP_IPC_LOCK);
         }    
    -    return; 
    +
    +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,28)
    +    commit_creds(new);
    +#else
    +#undef new
    +#endif
     }
     
     /** \brief Get number of available RAM pages
    diff -Nparu a/common/lib/modules/fglrx/build_mod/firegl_public.h b/common/lib/modules/fglrx/build_mod/firegl_public.h
    --- a/common/lib/modules/fglrx/build_mod/firegl_public.h	2009-01-23 20:00:26.000000000 -0200
    +++ b/common/lib/modules/fglrx/build_mod/firegl_public.h	2009-02-16 14:02:50.000000000 -0300
    @@ -18,6 +18,7 @@
     #define _FIREGL_PUBLIC_H_
     
     #include <stdarg.h>
    +#include <asm/pgtable.h>
     #include "kcl_pci.h"
     #include "kcl_io.h"
     
    @@ -590,6 +591,11 @@ extern unsigned long        KCL_SYSINFO_
     #define cpu_has_pge test_bit(X86_FEATURE_PGE, &boot_cpu_data.x86_capability)
     #endif
     
    +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,28)
    +#undef pgprot_writecombine
    +#undef pgprot_noncached
    +#endif
    +
     #ifndef pgprot_writecombine
     #define pgprot_writecombine(prot) __pgprot((pgprot_val(prot) & ~(_PAGE_PCD)) | _PAGE_PWT)
     #endif
    @@ -598,6 +604,7 @@ extern unsigned long        KCL_SYSINFO_
     #define pgprot_noncached(prot) __pgprot(pgprot_val(prot) | _PAGE_PCD | _PAGE_PWT)
     #endif
     
    +
     #endif //FIREGL_USWC_SUPPORT
     
     
    diff -Nparu a/common/lib/modules/fglrx/build_mod/kcl_acpi.c b/common/lib/modules/fglrx/build_mod/kcl_acpi.c
    --- a/common/lib/modules/fglrx/build_mod/kcl_acpi.c	2009-01-23 20:00:26.000000000 -0200
    +++ b/common/lib/modules/fglrx/build_mod/kcl_acpi.c	2009-02-13 15:25:00.000000000 -0200
    @@ -18,6 +18,12 @@
     #include <linux/autoconf.h>
     #include <linux/acpi.h>
     
    +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,28)
    +#include <acpi/acpica/acconfig.h>
    +#include <acpi/acpica/aclocal.h>
    +#include <acpi/acpica/acobject.h>
    +#endif
    +
     #include "kcl_config.h"
     #include "kcl_type.h"
     #include "kcl_acpi.h"
     #include "kcl_acpi.h"
    PS, add an empty return line to this patch otherwise you'll get a "patch ended unexpectedly" error or related.
    Last edited by damentz; 03-24-2009, 03:57 PM.

  • #2
    Looks better, then you provide the url to that patch. Must be from a dkms package I guess.

    Comment


    • #3
      patch runs, but module build on 32 bit Debian Sid fails at: /lib/modules/fglrx/build_mod/2.6.x/kcl_acpi.o, ati module builder exits with error, X fails to start though it doesn't totally fail, there is something there, but not usable.

      ctrl alt f1 works to return to console.

      Update: kcl_acpi.o module builder requires the missing files acpi/acpica/acconf.h, aclocal.h, and acobject.h

      This error is shown in the ati installer error logs, so that's the problem, it's why that acpi part fails. So those things need to go somewhere or other, and not be removed.
      Last edited by gfxdrone; 03-24-2009, 05:21 PM.

      Comment


      • #4
        Kano pointed out earlier:

        +#if LINUX_VERSION_CODE > KERNEL_VERSION(2,6,28)
        +#include <acpi/acpica/acconfig.h>
        +#include <acpi/acpica/aclocal.h>
        +#include <acpi/acpica/acobject.h>
        +#endif
        These headers don't actually exist, so they were copied from the kernel source - that's why the previous patch was so large.

        Comment


        • #5
          Perhaps you should have a look at: /usr/src/linux/drivers/acpi/acpica

          Comment


          • #6
            Originally posted by damentz View Post
            Kano pointed out earlier:



            These headers don't actually exist, so they were copied from the kernel source - that's why the previous patch was so large.
            The problem is, most of the code fglrx uses was made private to the kernel in 2.6.29.

            Comment


            • #7
              Ok, new patch -> http://liquorix.net/patches/

              It's a modification of Kano's, same procedure as the original patch.

              Comment


              • #8
                The problem is that Debian/Ubuntu header packages are just wrong and do not include the new acpi dir.

                Comment


                • #9
                  1) Is this safe?
                  2) Will ati be releasing their own fix for this anytime soon?

                  Comment


                  • #10
                    But does it work on X-Server 1.6?

                    Comment


                    • #11
                      Also works with Catalyst 8.12

                      Originally posted by damentz View Post
                      Ok, new patch -> http://liquorix.net/patches/

                      It's a modification of Kano's, same procedure as the original patch.
                      I've just successfully compiled and used the Catalyst 8.12-4 driver package from Debian stable with the 2.6.29 kernel. The above patch also worked for the older kernel module sources.

                      This is a workaround for http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=513222 which also affects me with my Radeon HD 3650. Shame on AMD for this regression ever since 9.1 (even 8.12 for some users apparently)! I hope it will be fixed with their next release.

                      Regards, Andre

                      Comment


                      • #12
                        This patch has nothing to do with xserver 1.6 support, only with 2.6.29 support. The huge patch is basically wrong, it only shows a packageing problem within the header packages which do not ship with the new acpi subdir.

                        Comment


                        • #13
                          liquorix does not work on debian

                          Hi,

                          Patch from liquorix.net applied and compile fine, but the patch simply reboot the debian(unstable) linux(2.6.29) X Window(1.4.2) box(Amd64X2).

                          Best regards.
                          See ya.

                          Comment


                          • #14
                            Watch out for libdrm!

                            My success story from last night was tainted this morning when X froze up the computer again. The changes since then had been an update of libdrm2 from Debian version 2.4.4+git+20090205+8b88036-1 to 2.4.5-1 and module-init-tools 3.4-1 to 3.7-pre9-1.

                            I don't think the latter has anything to do with the problem (although there were some warning messages about module symbols on the console). Anyway, reverting those two packages to their prior versions made the patched fglrx 8.12-4 driver work with kernel 2.6.29 again.

                            Hope this helps somebody to regain their GUI :-)

                            Comment


                            • #15
                              Originally posted by Kano View Post
                              The problem is that Debian/Ubuntu header packages are just wrong and do not include the new acpi dir.
                              Well, they are not wrong, the headers expose internal details of the interpreter and have been made private.

                              Comment

                              Working...
                              X