Announcement

Collapse
No announcement yet.

request: patch for catalyst (10.10+) to get 2.6.37-rc* working

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

  • request: patch for catalyst (10.10+) to get 2.6.37-rc* working

    anyone could offer a patch for catalyst/fglrx to get it running with 2.6.37-rc* please ?

    when trying to compile catalyst 10.10 with 2.6.37-rc1 it fails

    there must have been a change from shortly before 2.6.37-rc1 - nearly at rc1 or shortly after rc1:

     * Package: x11-drivers/ati-drivers-10.10-r2
     * Repository: portage
     * Maintainer: lu_zero@gentoo.org scarabeus@gentoo.org,x11@gentoo.org
     * USE: amd64 elibc_glibc kernel_linux modules multilib qt4 userland_GNU
    * Determining the location of the kernel source code
    * Found kernel source directory:
    * /usr/src/linux
    * Found sources for kernel version:
    * 2.6.37-rc1_plus+
    *
    * Please note that this driver supports only graphic cards based on
    * r600 chipset and newer.
    * This represent the ATI Radeon HD series at this moment.
    *
    * If your card is older then usage of x11-drivers/xf86-video-ati
    * as replacement is highly recommended. Rather than staying with
    * old versions of this driver.
    * For migration informations please reffer to:
    * http://www.gentoo.org/proj/en/deskto...tion-guide.xml
    *
    >>> Unpacking source...
    >>> Source unpacked in /var/tmp/portage/x11-drivers/ati-drivers-10.10-r2/work
    >>> Preparing source in /var/tmp/portage/x11-drivers/ati-drivers-10.10-r2/work ...
    * Applying ati-drivers-fix_compilation-bug-297322.patch ...
     [ ok ]
    * Applying ati-drivers-2.6.36.patch.txt ...
     [ ok ]
    * Applying arch-2.6.36.patch.txt ...
     [ ok ]
    * Applying 2.6.36_CFLAGS_MODULES.patch ...
     [ ok ]
    * Applying ati-powermode-opt-path-2.patch ...
     [ ok ]
    * Converting 2.6.x/Makefile to use M= instead of SUBDIRS= ...
     [ ok ]
    >>> Unpacking ./../common/usr/src/ati/fglrx_sample_source.tgz to /var/tmp/portage/x11-drivers/ati-drivers-10.10-r2/work/extra
    >>> Source prepared.
    >>> Configuring source in /var/tmp/portage/x11-drivers/ati-drivers-10.10-r2/work ...
    >>> Source configured.
    >>> Compiling source in /var/tmp/portage/x11-drivers/ati-drivers-10.10-r2/work ...
    * Preparing fglrx module
    make -j9 HOSTCC=x86_64-pc-linux-gnu-gcc CROSS_COMPILE=x86_64-pc-linux-gnu- LDFLAGS= GCC_VER_MAJ=4 KVER=2.6.37-rc1_plus+ KDIR=/usr/src/linux kmod_build
    make -C /usr/src/linux M=/var/tmp/portage/x11-drivers/ati-drivers-10.10-r2/work/common/lib/modules/fglrx/build_mod/2.6.x modules
    make[1]: Entering directory `/usr/src/linux-2.6.37-rc1_plus'
    CC [M] /var/tmp/portage/x11-drivers/ati-drivers-10.10-r2/work/common/lib/modules/fglrx/build_mod/2.6.x/firegl_public.o
    CC [M] /var/tmp/portage/x11-drivers/ati-drivers-10.10-r2/work/common/lib/modules/fglrx/build_mod/2.6.x/kcl_acpi.o
    CC [M] /var/tmp/portage/x11-drivers/ati-drivers-10.10-r2/work/common/lib/modules/fglrx/build_mod/2.6.x/kcl_agp.o
    CC [M] /var/tmp/portage/x11-drivers/ati-drivers-10.10-r2/work/common/lib/modules/fglrx/build_mod/2.6.x/kcl_debug.o
    CC [M] /var/tmp/portage/x11-drivers/ati-drivers-10.10-r2/work/common/lib/modules/fglrx/build_mod/2.6.x/kcl_ioctl.o
    CC [M] /var/tmp/portage/x11-drivers/ati-drivers-10.10-r2/work/common/lib/modules/fglrx/build_mod/2.6.x/kcl_io.o
    CC [M] /var/tmp/portage/x11-drivers/ati-drivers-10.10-r2/work/common/lib/modules/fglrx/build_mod/2.6.x/kcl_pci.o
    CC [M] /var/tmp/portage/x11-drivers/ati-drivers-10.10-r2/work/common/lib/modules/fglrx/build_mod/2.6.x/kcl_str.o
    CC [M] /var/tmp/portage/x11-drivers/ati-drivers-10.10-r2/work/common/lib/modules/fglrx/build_mod/2.6.x/kcl_wait.o
    /var/tmp/portage/x11-drivers/ati-drivers-10.10-r2/work/common/lib/modules/fglrx/build_mod/2.6.x/kcl_debug.c:51:44: warning: ‘struct tty_struct’ declared inside parameter list
    /var/tmp/portage/x11-drivers/ati-drivers-10.10-r2/work/common/lib/modules/fglrx/build_mod/2.6.x/kcl_debug.c:51:44: warning: its scope is only this definition or declaration, which is probably not what you want
    /var/tmp/portage/x11-drivers/ati-drivers-10.10-r2/work/common/lib/modules/fglrx/build_mod/2.6.x/kcl_debug.c:60:49: warning: ‘struct tty_struct’ declared inside parameter list
    /var/tmp/portage/x11-drivers/ati-drivers-10.10-r2/work/common/lib/modules/fglrx/build_mod/2.6.x/kcl_debug.c:67:5: warning: initialization from incompatible pointer type
    /var/tmp/portage/x11-drivers/ati-drivers-10.10-r2/work/common/lib/modules/fglrx/build_mod/2.6.x/kcl_debug.c:74:5: warning: initialization from incompatible pointer type
    /var/tmp/portage/x11-drivers/ati-drivers-10.10-r2/work/common/lib/modules/fglrx/build_mod/2.6.x/firegl_public.c:410:5: warning: initialization from incompatible pointer type
    /var/tmp/portage/x11-drivers/ati-drivers-10.10-r2/work/common/lib/modules/fglrx/build_mod/2.6.x/firegl_public.c: In function ‘KCL_MapPageToPfn’:
    /var/tmp/portage/x11-drivers/ati-drivers-10.10-r2/work/common/lib/modules/fglrx/build_mod/2.6.x/firegl_public.c:1638:16: warning: unused variable ‘bus_addr’
    /var/tmp/portage/x11-drivers/ati-drivers-10.10-r2/work/common/lib/modules/fglrx/build_mod/2.6.x/firegl_public.c: In function ‘KAS_Mutex_Initialize’:
    /var/tmp/portage/x11-drivers/ati-drivers-10.10-r2/work/common/lib/modules/fglrx/build_mod/2.6.x/firegl_public.c:5099:5: error: implicit declaration of function ‘init_MUTEX’
    make[2]: *** [/var/tmp/portage/x11-drivers/ati-drivers-10.10-r2/work/common/lib/modules/fglrx/build_mod/2.6.x/firegl_public.o] Error 1
    make[2]: *** Waiting for unfinished jobs....
    make[1]: *** [_module_/var/tmp/portage/x11-drivers/ati-drivers-10.10-r2/work/common/lib/modules/fglrx/build_mod/2.6.x] Error 2
    make[1]: Leaving directory `/usr/src/linux-2.6.37-rc1_plus'
    make: *** [kmod_build] Error 2
    emake failed
    * ERROR: x11-drivers/ati-drivers-10.10-r2 failed:
    * Unable to emake HOSTCC=x86_64-pc-linux-gnu-gcc CROSS_COMPILE=x86_64-pc-linux-gnu- LDFLAGS= GCC_VER_MAJ=4 KVER=2.6.37-rc1_plus+ KDIR=/usr/src/linux kmod_build
    *
    * Call stack:
    * ebuild.sh, line 56: Called src_compile
    * environment, line 3746: Called linux-mod_src_compile
    * environment, line 2879: Called die
    * The specific snippet of code:
    * eval "emake HOSTCC=\"$(tc-getBUILD_CC)\" CROSS_COMPILE=${CHOST}- LDFLAGS=\"$(get_abi_LDFLAGS)\" ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS} " || die "Unable to emake HOSTCC="$(tc-getBUILD_CC)" CROSS_COMPILE=${CHOST}- LDFLAGS="$(get_abi_LDFLAGS)" ${BUILD_FIXES} ${BUILD_PARAMS} ${BUILD_TARGETS}";
    many thanks in advance

  • #2
    I haven't tested it yet but the following is supposed to fix it:

    Code:
    diff -Naur orig/lib/modules/fglrx/build_mod/firegl_public.c final/lib/modules/fglrx/build_mod/firegl_public.c
    --- orig/lib/modules/fglrx/build_mod/firegl_public.c	2010-09-22 03:15:33.000000000 -0400
    +++ final/lib/modules/fglrx/build_mod/firegl_public.c	2010-11-01 23:00:32.672955001 -0400
    @@ -5094,7 +5094,7 @@
     unsigned int ATI_API_CALL KAS_Mutex_Initialize(void* hMutex)
     {
         kasMutex_t* mutex_obj = (kasMutex_t*)hMutex;
    -    init_MUTEX(&(mutex_obj->mutex));
    +    sema_init(&(mutex_obj->mutex),1);
         return 1;
     }
    you might need to add common between orig/ and /lib//modules

    kudos to cosmicencounter

    Comment


    • #3
      Could someone explain how can I use this patch? I've never done this before. I know how to create .deb packages on ubuntu from the .run on ati's site, so please start somewhere that point.

      Comment


      • #4
        Originally posted by argab View Post
        Could someone explain how can I use this patch? I've never done this before. I know how to create .deb packages on ubuntu from the .run on ati's site, so please start somewhere that point.
        use Kano's installer-script

        you might need to add that new patch - I'm sure Kano will soon add it too

        Comment


        • #5
          Originally posted by argab View Post
          Could someone explain how can I use this patch? I've never done this before. I know how to create .deb packages on ubuntu from the .run on ati's site, so please start somewhere that point.
          Great, then you've used the terminal at least.

          Start by downloading the installer.
          Make it executable. (You've probably already done these steps).
          Code:
          chmod u+x ati-driver-installer-10-10-x86.x86_64.run
          Extract the files from the installer.
          Code:
          ./ati-driver-installer-10-10-x86.x86_64.run --extract
          Save the content of the patch into a file. Lets call it fglrx.patch.

          Your working directory should now contain the following files. The name of the generated installer directory might vary [fglrx-install.******].
          Code:
          ati-driver-installer-10-10-x86.x86_64.run  fglrx-install.d0HznK  fglrx.patch
          Now you're going to apply the patch. Since the patch is probably using an erroneous path, we'll just point it in the right direction using an additional switch while using the patch command.
          Code:
          patch -p1 -d fglrx-install.d0HznK/common/ <fglrx.patch
          You should now get the following output for the above patch command. (We're actually patching common/lib/modules/...).
          Code:
          patching file lib/modules/fglrx/build_mod/firegl_public.c
          The only thing remaining is to generate the deb-files.
          Code:
          fglrx-install.d0HznK/ati-installer.sh --attributes --buildpkg
          Done.

          Comment


          • #6
            Thanks Silverthorn. I'm not afraid of using the terminal, just usually don't know how.
            I was able to create the packages with the patch included. Unfortunately I couldn't install them:
            Code:
            Error! Bad return status for module build on kernel: 2.6.37-020637rc1-generic (amd64)
            Consult the make.log in the build directory
            /var/lib/dkms/fglrx/8.783/build/ for more information.
            make.log
            Code:
            DKMS make.log for fglrx-8.783 for kernel 2.6.37-020637rc1-generic (amd64)
            2010. nov.  6., szombat, 17.11.32 CET
            AMD kernel module generator version 2.1
            doing Makefile based build for kernel 2.6.x and higher
            rm -rf *.c *.h *.o *.ko *.GCC* .??* *.symvers
            make -C /lib/modules/2.6.37-020637rc1-generic/build SUBDIRS=/var/lib/dkms/fglrx/8.783/build/2.6.x modules
            make[1]: Entering directory `/usr/src/linux-headers-2.6.37-020637rc1-generic'
              CC [M]  /var/lib/dkms/fglrx/8.783/build/2.6.x/firegl_public.o
            /var/lib/dkms/fglrx/8.783/build/2.6.x/firegl_public.c:410: error: unknown field ‘ioctl’ specified in initializer
            /var/lib/dkms/fglrx/8.783/build/2.6.x/firegl_public.c:410: warning: initialization from incompatible pointer type
            make[2]: *** [/var/lib/dkms/fglrx/8.783/build/2.6.x/firegl_public.o] Error 1
            make[1]: *** [_module_/var/lib/dkms/fglrx/8.783/build/2.6.x] Error 2
            make[1]: Leaving directory `/usr/src/linux-headers-2.6.37-020637rc1-generic'
            make: *** [kmod_build] Error 2
            build failed with return value 2

            Comment


            • #7
              Just guessing now...

              Enter the directory generated by the installer and the locate the file
              Code:
              common/lib/modules/fglrx/build_mod/firegl_public.c
              Open the file for editing and locate line number 410.

              change

              Code:
              static struct file_operations firegl_fops =
              {
              #ifdef THIS_MODULE
                  owner:   THIS_MODULE,
              #endif
                  open:    ip_firegl_open,
                  release: ip_firegl_release,
                  ioctl:   ip_firegl_ioctl,
                  mmap:    ip_firegl_mmap,
              
                  write:   ip_firegl_write,
                  read:    ip_firegl_read,
                  fasync:  ip_firegl_fasync,
                  poll:    ip_firegl_poll,
                  llseek:  ip_firegl_lseek,
              
              #if defined(KCL_OSCONFIG_IOCTL_COMPAT) && defined(__x86_64__)
                  compat_ioctl: ip_firegl_compat_ioctl,
              #endif
              };
              into

              Code:
              static struct file_operations firegl_fops =
              {
              #ifdef THIS_MODULE
                  owner:   THIS_MODULE,
              #endif
                  open:    ip_firegl_open,
                  release: ip_firegl_release,
                  compat_ioctl:   ip_firegl_ioctl,
                  mmap:    ip_firegl_mmap,
              
                  write:   ip_firegl_write,
                  read:    ip_firegl_read,
                  fasync:  ip_firegl_fasync,
                  poll:    ip_firegl_poll,
                  llseek:  ip_firegl_lseek,
              
              #if defined(KCL_OSCONFIG_IOCTL_COMPAT) && defined(__x86_64__)
                  compat_ioctl: ip_firegl_compat_ioctl,
              #endif
              };
              and then rebuild the deb-files.

              Comment


              • #8
                Unfortunately this causes some new errors, but thanks for trying.
                Code:
                DKMS make.log for fglrx-8.783 for kernel 2.6.37-020637rc1-generic (amd64)
                2010. nov.  6., szombat, 21.48.18 CET
                AMD kernel module generator version 2.1
                doing Makefile based build for kernel 2.6.x and higher
                rm -rf *.c *.h *.o *.ko *.GCC* .??* *.symvers
                make -C /lib/modules/2.6.37-020637rc1-generic/build SUBDIRS=/var/lib/dkms/fglrx/8.783/build/2.6.x modules
                make[1]: Entering directory `/usr/src/linux-headers-2.6.37-020637rc1-generic'
                  CC [M]  /var/lib/dkms/fglrx/8.783/build/2.6.x/firegl_public.o
                /var/lib/dkms/fglrx/8.783/build/2.6.x/firegl_public.c:410: warning: initialization from incompatible pointer type
                  CC [M]  /var/lib/dkms/fglrx/8.783/build/2.6.x/kcl_acpi.o
                  CC [M]  /var/lib/dkms/fglrx/8.783/build/2.6.x/kcl_agp.o
                  CC [M]  /var/lib/dkms/fglrx/8.783/build/2.6.x/kcl_debug.o
                /var/lib/dkms/fglrx/8.783/build/2.6.x/kcl_debug.c:51: warning: ‘struct tty_struct’ declared inside parameter list
                /var/lib/dkms/fglrx/8.783/build/2.6.x/kcl_debug.c:51: warning: its scope is only this definition or declaration, which is probably not what you want
                /var/lib/dkms/fglrx/8.783/build/2.6.x/kcl_debug.c:60: warning: ‘struct tty_struct’ declared inside parameter list
                /var/lib/dkms/fglrx/8.783/build/2.6.x/kcl_debug.c:67: warning: initialization from incompatible pointer type
                /var/lib/dkms/fglrx/8.783/build/2.6.x/kcl_debug.c:74: warning: initialization from incompatible pointer type
                  CC [M]  /var/lib/dkms/fglrx/8.783/build/2.6.x/kcl_ioctl.o
                /var/lib/dkms/fglrx/8.783/build/2.6.x/kcl_ioctl.c: In function ‘KCL_IOCTL_AllocUserSpace32’:
                /var/lib/dkms/fglrx/8.783/build/2.6.x/kcl_ioctl.c:196: error: implicit declaration of function ‘COMPAT_ALLOC_USER_SPACE’
                /var/lib/dkms/fglrx/8.783/build/2.6.x/kcl_ioctl.c:196: warning: initialization makes pointer from integer without a cast
                make[2]: *** [/var/lib/dkms/fglrx/8.783/build/2.6.x/kcl_ioctl.o] Error 1
                make[1]: *** [_module_/var/lib/dkms/fglrx/8.783/build/2.6.x] Error 2
                make[1]: Leaving directory `/usr/src/linux-headers-2.6.37-020637rc1-generic'
                make: *** [kmod_build] Error 2
                build failed with return value 2

                Comment


                • #9
                  you have 2 options:

                  * use Kano's script and add the missing patch to it

                  or

                  * apply manually ALL needed patches from cosmicencounter as indicated in the file ati-drivers-10.10.ebuild

                  which should be 4:
                  ati-drivers-2.6.36.patch
                  arch-2.6.36.patch
                  ati-drivers-fix_compilation-bug-297322.patch
                  sema_init.patch

                  Comment


                  • #10
                    None of those patches actually fixes the missing ioctl variable assignment. I guess 2.6.37rc1 and fglrx is a no go until a real patch is available. ioctl was removed by the merging of the BKL (big kernel lock) tree.

                    If you still want to experiment, apply the patches mentioned by kernelOfTruth. Then edit the firegl_public.c file again and change ioctl as mentioned before to either compat_ioctl as I said earlier or change it to unlocked_ioctl (I don't know the difference between them). Then because of different input parameters between the new functions and ioctl, locate line number 323 and change
                    Code:
                    int ip_firegl_ioctl(struct inode* inode, struct file* filp, unsigned int cmd, unsigned long arg)
                    {
                        return firegl_ioctl((KCL_IO_FILE_Handle)filp, cmd, arg);
                    }
                    into

                    Code:
                    long ip_firegl_ioctl(struct file* filp, unsigned int cmd, unsigned long arg)
                    {
                        return (long)firegl_ioctl((KCL_IO_FILE_Handle)filp, cmd, arg);
                    }
                    Hopefully these changes will allow the driver to compile and result in a working driver.

                    Comment

                    Working...
                    X