Announcement

Collapse
No announcement yet.

patch: vanilla fglrx for 2.6.29

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

  • damentz
    started a topic patch: vanilla fglrx for 2.6.29

    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.

  • DeX77
    replied
    Originally posted by Sril View Post
    Hi,

    Error come from libdrm, see : http://dri.freedesktop.org/libdrm

    See ya.
    Sril
    FYI: fglrx 9.3 on kernel 2.6.28.x with libdrm 2.4.5 is not affected.

    Leave a comment:


  • Sril
    replied
    Hi,

    Patch works fine.

    Take a look at : http://groups.google.com/group/linux...45058?lnk=raot

    Error come from libdrm, see : http://dri.freedesktop.org/libdrm

    Don't forgot ldconfig if you don't want to reboot.

    See ya.
    Sril

    Leave a comment:


  • Sril
    replied
    patch worked and works fine ...

    Hi,

    I'm sorry to made mystakes, the patch were and is correct, independantly where the sources come from.

    The trouble which froze X Window come from libdrm 2.4.5. This will be probably fixed with libdrm 2.4.6.

    So, get the libdrm 2.4.4, then configure, make, make install. All library files goes by default to /usr/local/lib which comes _before_ /usr/lib !

    Don't forgot ldconfig if you don't want to reboot your linux box.

    see http://groups.google.com/group/linux...45058?lnk=raot

    or google.com/linux === query ===> fglrx libdrm

    See ya.
    Sril

    Nota : libdrm on freedesktop.org !

    http://dri.freedesktop.org/libdrm/libdrm-2.4.4.tar.bz2
    MD5: c183ee614b25f61ea325d57882a2fab2 libdrm-2.4.4.tar.bz2
    SHA1: 5da1a685d2028168e87c6e2855fb7cca00a02aed libdrm-2.4.4.tar.bz2

    http://dri.freedesktop.org/libdrm/libdrm-2.4.4.tar.gz
    MD5: b83c65c87329127ab1e714c661a7f8b9 libdrm-2.4.4.tar.gz
    SHA1: 4b904e4eafc368d9f1b827a7439fc80a41746cb3 libdrm-2.4.4.tar.gz

    Leave a comment:


  • Snacksou
    replied
    Sorry to replay but have you got any idea or suggestions ?

    Is it the package fglrx come from debian or another one or...?

    Thanks.

    Leave a comment:


  • Snacksou
    replied
    Originally posted by Kano View Post
    The patch is not against the kernel, it is against fglrx (extracted).
    i've installed fglrx-driver and fglrx-driver-src, i've extracted it and so there is a tree like this:
    Code:
    $ cd /usr/src
    $ tar xvjf fglrx.tar.bz2
    $ cd modules/fglrx
    $ ls
    debian
    drm_compat.h
    drm.h
    drm_os_linux.h
    drmP.h
    drm_proc.h
    ...
    firegl_public.c
    firegl_public.h
    ...
    kcl_agp.c
    ...
    kcl_io.c
    ...
    Makefile
    make.sh
    so i think i've got a right tree but there's not any folder like:
    Code:
    a/common/lib/modules/fglrx/build_mod/common/lib/common/lib/modules/fglrx/build_mod/modules/fglrx/build_mod/2.6.x/
    in line 8. Is there other source i haven't dl or i'm stupid ?

    Can you exactly explain me what is to way to do. Sorry for this, i've never used any patch or things like that.

    Thanks a lot.

    P.S: i've forget to precise that i'm on Debian testing 64 on an Turion64.

    Leave a comment:


  • Kano
    replied
    The patch is not against the kernel, it is against fglrx (extracted).

    Leave a comment:


  • Snacksou
    replied
    Hello everybody,

    i've also tried to install 2.6.29 kernel with fglrx driver and i also get an error, probably the same as mentionned before. I also tried to patch with this one but i'm not able to find the files. I get an error line 11 with this:
    Code:
    a/common/lib/modules/fglrx/build_mod/2.6.x/Makefile
    i searched in /usr/src/linux-source-2.6.29 and in modules but i didn't find them. Can anyone tell me where are they ?

    Thks.

    Leave a comment:


  • Phlogiston
    replied
    Thats what I get when I try to load it:

    Code:
    [fglrx] Maximum main memory to use for locked dma buffers: 1412 MBytes.                                                                             
    [fglrx:drm_alloc] *ERROR* [driver] Allocating 0 bytes                                                                                               
    [fglrx:firegl_init_device_list] *ERROR* Out of memory when allocating device heads                                                                   
    [fglrx:firegl_init_module] *ERROR* firegl_init_devices failed
    I get this on .28 as well without patch...

    Leave a comment:


  • mewtwo
    replied
    Doesn't work with fglrx 9.3?

    I tried to install fglrx 9.3 on the 2.6.29 32bit kernel, I applied the 'big and ugly' patch, however, the kernel module got compiled and can be loaded.
    Originally posted by dmesg
    [fglrx] Maximum main memory to use for locked dma buffers: 1898 MBytes.
    [fglrx] vendor: 1002 device: 7280 count: 1
    [fglrx] ioport: bar 4, base 0x7000, size: 0x100
    [fglrx] Kernel PAT support detected, disabling driver built-in PAT support
    [fglrx] module loaded - fglrx 8.59.2 [Mar 13 2009] with 1 minors
    Still, I don't get X running with it
    Originally posted by Xorg.0.log
    (EE) fglrx(0): [FB] Can not get FB MC address range.
    (EE) fglrx(0): atiddxDriScreenInit failed, GPS not been initialized.
    (EE) fglrx(0): XMM failed to open CMMQS connection.
    (EE) fglrx(0): firegl_SetSuspendResumeState FAILED -9.
    (EE) fglrx(0): firegl_GetSuspendResumeState FAILED -9.
    The Card used is a X1950Pro.

    Leave a comment:

Working...
X