summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorkammag2015-06-08 19:53:56 +0200
committerkammag2015-06-08 19:53:56 +0200
commitdcccbbddfe6253c6a14e6b0f8c4b546ce90381df (patch)
treea8a14675aff0eb164af0c72d9123fb66e70d38e7
downloadaur-dcccbbddfe6253c6a14e6b0f8c4b546ce90381df.tar.gz
Initial import
-rw-r--r--.SRCINFO44
-rw-r--r--PKGBUILD119
-rw-r--r--ati_make.sh145
-rw-r--r--catalyst.install32
-rw-r--r--cold-fglrx-3.14-current_euid.patch14
-rw-r--r--fglrx_3.17rc6-no_hotplug.patch29
-rw-r--r--fglrx_gpl_symbol.patch11
-rw-r--r--kolasa-3.19-get_cpu_var.patch28
-rw-r--r--kolasa_4.0-cr4-strn.patch70
-rw-r--r--kolasa_4.1_remove-IRQF_DISABLED.patch15
-rw-r--r--lano1106_fglrx-13.8_proc.patch50
-rw-r--r--lano1106_fglrx_intel_iommu.patch11
-rw-r--r--lano1106_kcl_agp_13_4.patch90
-rw-r--r--makefile_compat.patch10
14 files changed, 668 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..3f83d719782f
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,44 @@
+pkgbase = catalyst
+ pkgdesc = AMD/ATI Catalyst drivers for linux. fglrx kernel module only. Radeons HD 2 3 4 xxx ARE NOT SUPPORTED
+ pkgver = 15.5
+ pkgrel = 1
+ url = http://www.amd.com
+ install = catalyst.install
+ arch = i686
+ arch = x86_64
+ license = custom
+ makedepends = gcc-libs
+ makedepends = gcc>4.0.0
+ makedepends = make
+ makedepends = linux-headers
+ depends = linux>=3.0
+ depends = linux<4.2
+ depends = catalyst-utils
+ conflicts = catalyst-test
+ source = http://www2.ati.com/drivers/linux/amd-catalyst-omega-15.5-linux-run-installers.zip
+ source = ati_make.sh
+ source = makefile_compat.patch
+ source = lano1106_fglrx_intel_iommu.patch
+ source = lano1106_kcl_agp_13_4.patch
+ source = lano1106_fglrx-13.8_proc.patch
+ source = cold-fglrx-3.14-current_euid.patch
+ source = fglrx_gpl_symbol.patch
+ source = fglrx_3.17rc6-no_hotplug.patch
+ source = kolasa-3.19-get_cpu_var.patch
+ source = kolasa_4.0-cr4-strn.patch
+ source = kolasa_4.1_remove-IRQF_DISABLED.patch
+ md5sums = 979f9f2e0948fa6e92ff0125f5c6b575
+ md5sums = fd98b7e486d7fd4cad8de7b95b5b031e
+ md5sums = 3e1b82bd69774ea808da69c983d6a43b
+ md5sums = 5184b94a2a40216a67996999481dd9ee
+ md5sums = c5156eddf81c8a1719b160d05a2e8d67
+ md5sums = 2ab4837233de42332753882445373d7b
+ md5sums = ba33b6ef10896d3e1b5e4cd96390b771
+ md5sums = ef97fc080ce7e5a275fe0c372bc2a418
+ md5sums = 67a22f624bae95a76638ce269392cb01
+ md5sums = 3aa45013515b724a71bbd8e01f98ad99
+ md5sums = dee3df1c5d3ed87363f4304da917fc00
+ md5sums = 81a9e38dee025151cccb7e5db2362cfb
+
+pkgname = catalyst
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..87db4d929465
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,119 @@
+# Maintainer: Vi0L0 <vi0l093@gmail.com>
+# Great Contributor: Eduardo "kensai" Romero (previous maintainer)
+# Contributor: aidanlinz
+# Contributor: Rip-Rip
+# Contributor: OvsInc
+# Contributor: lano1106 (patch to fix support of intel's iommu and to remove dependency of kernel's CONFIG_AGP option)
+# Contributor: lano1106 (patch to remove dependency of kernel's CONFIG_AGP option)
+# Contributor: lano1106 (patch to improve jacob@amd patch)
+# Contributor: zoopp
+# Contributor: Cold (current_euid patch)
+# Contributor: kolasa (3.19, 4.0 & 4.1 kernel patch)
+
+_kernver=`uname -r`
+
+pkgname=catalyst
+pkgver=15.5
+pkgrel=1
+#_amdver=15.101.1001
+pkgdesc="AMD/ATI Catalyst drivers for linux. fglrx kernel module only. Radeons HD 2 3 4 xxx ARE NOT SUPPORTED"
+arch=('i686' 'x86_64')
+url="http://www.amd.com"
+license=('custom')
+depends=('linux>=3.0' 'linux<4.2' 'catalyst-utils')
+makedepends=('gcc-libs' 'gcc>4.0.0' 'make' 'linux-headers')
+conflicts=('catalyst-test')
+install=catalyst.install
+
+url_ref="http://support.amd.com/en-us/download/desktop?os=Linux+x86"
+DLAGENTS="http::/usr/bin/curl --referer ${url_ref} -o %o %u"
+
+source=(
+ http://www2.ati.com/drivers/linux/amd-catalyst-omega-${pkgver}-linux-run-installers.zip
+ ati_make.sh
+ makefile_compat.patch
+ lano1106_fglrx_intel_iommu.patch
+ lano1106_kcl_agp_13_4.patch
+ lano1106_fglrx-13.8_proc.patch
+ cold-fglrx-3.14-current_euid.patch
+ fglrx_gpl_symbol.patch
+ fglrx_3.17rc6-no_hotplug.patch
+ kolasa-3.19-get_cpu_var.patch
+ kolasa_4.0-cr4-strn.patch
+ kolasa_4.1_remove-IRQF_DISABLED.patch)
+
+md5sums=('979f9f2e0948fa6e92ff0125f5c6b575'
+ 'fd98b7e486d7fd4cad8de7b95b5b031e'
+ '3e1b82bd69774ea808da69c983d6a43b'
+ '5184b94a2a40216a67996999481dd9ee'
+ 'c5156eddf81c8a1719b160d05a2e8d67'
+ '2ab4837233de42332753882445373d7b'
+ 'ba33b6ef10896d3e1b5e4cd96390b771'
+ 'ef97fc080ce7e5a275fe0c372bc2a418'
+ '67a22f624bae95a76638ce269392cb01'
+ '3aa45013515b724a71bbd8e01f98ad99'
+ 'dee3df1c5d3ed87363f4304da917fc00'
+ '81a9e38dee025151cccb7e5db2362cfb')
+
+
+build() {
+# /bin/sh ./amd-catalyst-${pkgver}-linux-x86.x86_64.run --extract archive_files
+ /bin/sh ./amd-catalyst-omega-${pkgver}-linux-run-installers.run --extract archive_files
+
+ ## include ati_make.sh and use _ati_check function from it
+ . ati_make.sh
+ _ati_check
+
+ if [ "${CARCH}" = "x86_64" ]; then
+ BUILDARCH=x86_64
+ _archdir=x86_64
+ fi
+ if [ "${CARCH}" = "i686" ]; then
+ BUILDARCH=i386
+ _archdir=x86
+ fi
+ cd ${srcdir}/archive_files
+ ## makefile patch to choose arch_compat_alloc_user_space or older compat_alloc_user_space
+ ## works only in combination with ati_make.sh script
+ patch -Np1 -i ../makefile_compat.patch
+ patch -Np1 -i ../lano1106_fglrx_intel_iommu.patch
+ patch -Np1 -i ../lano1106_kcl_agp_13_4.patch
+ patch -Np1 -i ../lano1106_fglrx-13.8_proc.patch
+ patch -Np1 -i ../cold-fglrx-3.14-current_euid.patch
+ patch -Np1 -i ../fglrx_3.17rc6-no_hotplug.patch
+ patch -Np1 -i ../kolasa-3.19-get_cpu_var.patch
+# test "${CARCH}" = "i686" && patch -Np1 -i ../fglrx_gpl_symbol.patch
+# since 3.19 not only i686 needs gpl symbol - V
+ patch -Np1 -i ../fglrx_gpl_symbol.patch
+ patch -Np1 -i ../kolasa_4.0-cr4-strn.patch
+ patch -Np1 -i ../kolasa_4.1_remove-IRQF_DISABLED.patch
+
+ cd ${srcdir}/archive_files/common/lib/modules/fglrx/build_mod
+ cp ${srcdir}/archive_files/arch/${_archdir}/lib/modules/fglrx/build_mod/libfglrx_ip.a .
+ cp 2.6.x/Makefile .
+ ## Compile module using _ati_check variables
+ CFLAGS_MODULE="-DMODULE -DATI -DFGL -DPAGE_ATTR_FIX=$PAGE_ATTR_FIX -DCOMPAT_ALLOC_USER_SPACE=$COMPAT_ALLOC_USER_SPACE $def_smp $def_modversions"
+ make -C /usr/lib/modules/${_kernver}/build SUBDIRS="`pwd`" ARCH=${BUILDARCH} \
+ MODFLAGS="$CFLAGS_MODULE" \
+ CFLAGS_MODULE="$CFLAGS_MODULE" \
+ PAGE_ATTR_FIX=$PAGE_ATTR_FIX COMPAT_ALLOC_USER_SPACE=$COMPAT_ALLOC_USER_SPACE modules
+}
+
+package() {
+ for r in /usr/lib/modules/*; do
+ if [[ ${r:17:3} = "ext" ]]; then
+ if [[ `cat ${r}/version | grep -c ${_kernver}` != 0 ]]; then
+ _destidir=${r}
+ sed -i -e "s/EXTRAMODULES=.*/EXTRAMODULES=${r:17}/" $startdir/catalyst.install
+ fi
+ fi
+ done
+
+ cd ${srcdir}/archive_files/common/lib/modules/fglrx/build_mod
+ install -m755 -d ${pkgdir}${_destidir}
+ install -m644 fglrx.ko ${pkgdir}${_destidir}
+ find ${pkgdir} -name '*.ko' -exec gzip -9 {} \;
+ install -m755 -d ${pkgdir}/usr/share/licenses/${pkgname}
+ install -m644 ${srcdir}/archive_files/LICENSE.TXT ${pkgdir}/usr/share/licenses/${pkgname}
+ sed -i -e "s/KERNEL_VERSION=.*/KERNEL_VERSION=${_kernver}/" $startdir/catalyst.install
+} \ No newline at end of file
diff --git a/ati_make.sh b/ati_make.sh
new file mode 100644
index 000000000000..6a407e615e2c
--- /dev/null
+++ b/ati_make.sh
@@ -0,0 +1,145 @@
+#!/bin/bash
+### Vi0L0: it is ati's code from their make.sh file, modified a bit to fit our arch linux system, used inside PKGBUILD
+
+# Copyright 1999-2005 ATI Technologies Inc., Markham, Ontario, CANADA.
+# All Rights Reserved.
+#
+# Your use and or redistribution of this software in source and \ or
+# binary form, with or without modification, is subject to: (i) your
+# ongoing acceptance of and compliance with the terms and conditions of
+# the ATI Technologies Inc. software End User License Agreement; and (ii)
+# your inclusion of this notice in any version of this software that you
+# use or redistribute. A copy of the ATI Technologies Inc. software End
+# User License Agreement is included with this software and is also
+# available by contacting ATI Technologies Inc. at http://www.ati.com
+
+
+function _ati_check()
+{
+# ==============================================================
+# resolve if we are running a SMP enabled kernel
+
+SMP=0
+
+# 1
+# grep in OsVersion string for SMP specific keywords
+OsVersion=`uname -v`
+
+if [ `echo $OsVersion | grep [sS][mM][pP] -c` -ne 0 ]; then
+ SMP=1
+ echo "OsVersion says: SMP=$SMP"
+fi
+
+# 2
+# grep in /proc/ksyms for SMP specific kernel symbols
+# use triggerlevel of 10 occurences
+# (UP kernels might have 0-1, SMP kernels might have 32-45 or much more)
+
+src_file=/proc/kallsyms
+
+if [ -e $src_file ]; then
+ if [ `fgrep smp $src_file -c` -gt 10 ]; then
+ SMP=1
+ echo "file $src_file says: SMP=$SMP"
+ fi
+fi
+
+# 3
+# linux/autoconf.h may contain this: #define CONFIG_SMP 1
+
+# Before 2.6.33 autoconf.h is under linux/.
+# For 2.6.33 and later autoconf.h is under generated/.
+if [ -f /usr/lib/modules/${_kernver}/build/include/generated/autoconf.h ]; then
+ autoconf_h=/usr/lib/modules/${_kernver}/build/include/generated/autoconf.h
+else
+ autoconf_h=/usr/lib/modules/${_kernver}/build/include/linux/autoconf.h
+fi
+src_file=$autoconf_h
+
+if [ ! -e $src_file ]; then
+ echo "Warning:"
+ echo "kernel includes at /usr/lib/modules/${_kernver}/build/include not found or incomplete"
+ echo "file: $src_file"
+ echo ""
+else
+ if [ `cat $src_file | grep "#undef" | grep "CONFIG_SMP" -c` = 0 ]; then
+ SMP=`cat $src_file | grep CONFIG_SMP | cut -d' ' -f3`
+ echo "file $src_file says: SMP=$SMP"
+ fi
+fi
+
+if [ "$SMP" = 0 ]; then
+ echo "assuming default: SMP=$SMP"
+fi
+
+# act on final result
+if [ ! "$SMP" = 0 ]; then
+ smp="-SMP"
+ def_smp=-D__SMP__
+fi
+# ==============================================================
+# resolve whether we need to set PAGE_ATTR_FIX
+PAGE_ATTR_FIX=0
+
+src_file=/proc/kallsyms
+
+if [ -e $src_file ]; then
+ if [ `fgrep " change_page_attr\$" $src_file -c` -gt 0 ]; then
+ PAGE_ATTR_FIX=1
+ echo "file $src_file says: PAGE_ATTR_FIX=$PAGE_ATTR_FIX"
+ fi
+fi
+# ==============================================================
+# resolve if we are running a MODVERSIONS enabled kernel
+
+MODVERSIONS=0
+
+# autoconf.h may contain this: #define CONFIG_MODVERSIONS 1
+src_file=$autoconf_h
+if [ ! -e $src_file ];
+then
+ echo "Warning:"
+ echo "kernel includes at /usr/lib/modules/${_kernver}/build/include not found or incomplete"
+ echo "file: $src_file"
+ echo ""
+else
+ if [ `cat $src_file | grep "#undef" | grep "CONFIG_MODVERSIONS" -c` = 0 ]
+ then
+ MODVERSIONS=`cat $src_file | grep CONFIG_MODVERSIONS | cut -d' ' -f3`
+ echo "file $src_file says: MODVERSIONS=$MODVERSIONS"
+ fi
+fi
+
+if [ "$MODVERSIONS" = 0 ]
+then
+ echo "assuming default: MODVERSIONS=$MODVERSIONS"
+fi
+
+# act on final result
+if [ ! "$MODVERSIONS" = 0 ]
+then
+ def_modversions="-DMODVERSIONS"
+fi
+
+# ==============================================================
+# resolve if we are building for a kernel with a fix for CVE-2010-3081
+# On kernels with the fix, use arch_compat_alloc_user_space instead
+# of compat_alloc_user_space since the latter is GPL-only
+
+COMPAT_ALLOC_USER_SPACE=compat_alloc_user_space
+
+src_file=/usr/lib/modules/${_kernver}/build/arch/x86/include/asm/compat.h
+if [ ! -e $src_file ];
+then
+ echo "Warning:"
+ echo "kernel includes at /usr/lib/modules/${_kernver}/build/include not found or incomplete"
+ echo "file: $src_file"
+ echo ""
+else
+ if [ `cat $src_file | grep -c arch_compat_alloc_user_space` -gt 0 ]
+ then
+ COMPAT_ALLOC_USER_SPACE=arch_compat_alloc_user_space
+ fi
+ echo "file $src_file says: COMPAT_ALLOC_USER_SPACE=$COMPAT_ALLOC_USER_SPACE"
+fi
+} \ No newline at end of file
diff --git a/catalyst.install b/catalyst.install
new file mode 100644
index 000000000000..f1401f0b17bf
--- /dev/null
+++ b/catalyst.install
@@ -0,0 +1,32 @@
+KERNEL_VERSION=4.1.0-1-mainline
+EXTRAMODULES=extramodules-4.1-mainline
+
+
+dep_extr_mod(){
+if [ $EXTRAMODULES != null ]; then
+ depmod $(cat usr/lib/modules/$EXTRAMODULES/version)
+else
+ depmod $KERNEL_VERSION
+fi
+}
+
+whisperer(){
+ echo "----------------------------------------------------------------"
+ echo "For more info and troubleshooting visit:"
+ echo "http://wiki.archlinux.org/index.php/AMD_Catalyst"
+ echo "----------------------------------------------------------------"
+}
+
+
+post_install() {
+ dep_extr_mod
+ whisperer
+}
+
+post_upgrade() {
+ dep_extr_mod
+}
+
+post_remove() {
+ dep_extr_mod
+} \ No newline at end of file
diff --git a/cold-fglrx-3.14-current_euid.patch b/cold-fglrx-3.14-current_euid.patch
new file mode 100644
index 000000000000..77bfe2565492
--- /dev/null
+++ b/cold-fglrx-3.14-current_euid.patch
@@ -0,0 +1,14 @@
+--- 14.1/common/lib/modules/fglrx/build_mod/firegl_public.c 2014-02-23 19:26:52.215995002 +0100
++++ 14.1/common/lib/modules/fglrx/build_mod/firegl_public.c 2014-02-23 19:27:59.320999596 +0100
+@@ -1761,7 +1761,11 @@
+ #else
+
+ #ifdef current_euid
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)
++ return __kuid_val(current_euid());
++#else
+ return current_euid();
++#endif
+ #else
+ return current->euid;
+ #endif
diff --git a/fglrx_3.17rc6-no_hotplug.patch b/fglrx_3.17rc6-no_hotplug.patch
new file mode 100644
index 000000000000..7fbe1a25064c
--- /dev/null
+++ b/fglrx_3.17rc6-no_hotplug.patch
@@ -0,0 +1,29 @@
+diff -uNr 14.9/common/lib/modules/fglrx/build_mod/firegl_public.c 14.9/common/lib/modules/fglrx/build_mod/firegl_public.c
+--- 14.9/common/lib/modules/fglrx/build_mod/firegl_public.c 2014-09-09 16:10:17.000000000 +0200
++++ 14.9/common/lib/modules/fglrx/build_mod/firegl_public.c 2014-09-26 19:01:44.000000000 +0200
+@@ -1093,6 +1093,9 @@
+ // directly here to allow suspend/resume without X server start.
+ firegl_pci_save_state((KCL_PCI_DevHandle)pdev, privdev);
+ pci_disable_device(pdev);
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)
++ pci_ignore_hotplug(pdev);
++#endif
+ PMSG_EVENT(pdev->dev.power.power_state) = state;
+ }
+ else
+diff -uNr 14.9/common/lib/modules/fglrx/build_mod/kcl_acpi.c 14.9/common/lib/modules/fglrx/build_mod/kcl_acpi.c
+--- 14.9/common/lib/modules/fglrx/build_mod/kcl_acpi.c 2014-09-09 16:10:17.000000000 +0200
++++ 14.9/common/lib/modules/fglrx/build_mod/kcl_acpi.c 2014-09-26 18:57:27.000000000 +0200
+@@ -840,10 +840,12 @@
+ if(tdev != NULL)
+ {
+ device = (acpi_device_adr(tdev) >> 16) & 0xffff;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)
+ if(PCI_SLOT(pdev->devfn) == device)
+ {
+ tdev->flags.no_hotplug = true;
+ }
++#endif
+ }
+ #endif
+ return 0;
diff --git a/fglrx_gpl_symbol.patch b/fglrx_gpl_symbol.patch
new file mode 100644
index 000000000000..2030b9eadd57
--- /dev/null
+++ b/fglrx_gpl_symbol.patch
@@ -0,0 +1,11 @@
+--- 13.1/common/lib/modules/fglrx/build_mod/firegl_public.c 2013-01-15 22:33:27.000000000 +0100
++++ 13.1/common/lib/modules/fglrx/build_mod/firegl_public.c 2014-08-18 20:05:44.327520475 +0200
+@@ -250,7 +250,7 @@
+ #endif
+
+ #ifdef MODULE_LICENSE
+-MODULE_LICENSE("Proprietary. (C) 2002 - ATI Technologies, Starnberg, GERMANY");
++MODULE_LICENSE("GPL\0Proprietary. (C) 2002 - ATI Technologies, Starnberg, GERMANY");
+ #endif
+ #ifdef MODULE_DEVICE_TABLE
+ MODULE_DEVICE_TABLE(pci, fglrx_pci_table);
diff --git a/kolasa-3.19-get_cpu_var.patch b/kolasa-3.19-get_cpu_var.patch
new file mode 100644
index 000000000000..5a571da9fd96
--- /dev/null
+++ b/kolasa-3.19-get_cpu_var.patch
@@ -0,0 +1,28 @@
+--- 14.12/common/lib/modules/fglrx/build_mod/firegl_public.c 2014-12-11 00:15:11.000000000 +0100
++++ 14.12/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-01-01 21:39:40.471543282 +0100
+@@ -4823,8 +4823,13 @@
+ {
+ unsigned long orig_level;
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
++ orig_level = __this_cpu_read(kasExecutionLevel);
++ __this_cpu_write(kasExecutionLevel,level);
++#else
+ orig_level = __get_cpu_var(kasExecutionLevel);
+ __get_cpu_var(kasExecutionLevel) = level;
++#endif
+
+ return orig_level;
+ }
+@@ -4836,7 +4841,11 @@
+ */
+ static unsigned long kas_GetExecutionLevel(void)
+ {
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,19,0)
++ return __this_cpu_read(kasExecutionLevel);
++#else
+ return __get_cpu_var(kasExecutionLevel);
++#endif
+ }
+
+ /** \brief Type definition for kas_spin_lock() parameter */
diff --git a/kolasa_4.0-cr4-strn.patch b/kolasa_4.0-cr4-strn.patch
new file mode 100644
index 000000000000..7bce698bad33
--- /dev/null
+++ b/kolasa_4.0-cr4-strn.patch
@@ -0,0 +1,70 @@
+diff -uNr 14.12/common/lib/modules/fglrx/build_mod/firegl_public.c 14.12_2/common/lib/modules/fglrx/build_mod/firegl_public.c
+--- 14.12/common/lib/modules/fglrx/build_mod/firegl_public.c 2014-11-28 21:02:10.000000000 +0100
++++ 14.12_2/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-03-08 13:30:42.565275902 +0100
+@@ -4468,8 +4468,13 @@
+
+ if (cpu_has_pge)
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)
+ cr4 = read_cr4();
+ write_cr4(cr4 & ~X86_CR4_PGE);
++#else
++ cr4 = __read_cr4();
++ __write_cr4(cr4 & ~X86_CR4_PGE);
++#endif
+ }
+ __flush_tlb();
+
+@@ -4482,7 +4487,11 @@
+ write_cr0(cr0 & 0xbfffffff);
+ if (cpu_has_pge)
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)
+ write_cr4(cr4);
++#else
++ __write_cr4(cr4);
++#endif
+ }
+ local_irq_restore(flags);
+
+@@ -4509,8 +4518,13 @@
+
+ if (cpu_has_pge)
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)
+ cr4 = read_cr4();
+ write_cr4(cr4 & ~X86_CR4_PGE);
++#else
++ cr4 = __read_cr4();
++ __write_cr4(cr4 & ~X86_CR4_PGE);
++#endif
+ }
+ __flush_tlb();
+
+@@ -4522,7 +4536,11 @@
+ write_cr0(cr0 & 0xbfffffff);
+ if (cpu_has_pge)
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)
+ write_cr4(cr4);
++#else
++ __write_cr4(cr4);
++#endif
+ }
+ local_irq_restore(flags);
+
+diff -uNr 14.12/common/lib/modules/fglrx/build_mod/kcl_str.c 14.12_2/common/lib/modules/fglrx/build_mod/kcl_str.c
+--- 14.12/common/lib/modules/fglrx/build_mod/kcl_str.c 2014-11-28 21:02:10.000000000 +0100
++++ 14.12_2/common/lib/modules/fglrx/build_mod/kcl_str.c 2015-03-08 13:25:11.568396701 +0100
+@@ -169,7 +169,11 @@
+ const char* s2,
+ KCL_TYPE_SizeSigned count)
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0)
+ return strnicmp(s1, s2, count);
++#else
++ return strncasecmp(s1, s2, count);
++#endif
+ }
+
+ /** \brief Locate character in string
diff --git a/kolasa_4.1_remove-IRQF_DISABLED.patch b/kolasa_4.1_remove-IRQF_DISABLED.patch
new file mode 100644
index 000000000000..f0b1b62756e9
--- /dev/null
+++ b/kolasa_4.1_remove-IRQF_DISABLED.patch
@@ -0,0 +1,15 @@
+--- 15.3/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-03-06 17:44:48.000000000 +0100
++++ 15.3/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-06-04 12:12:04.997661763 +0200
+@@ -3496,7 +3496,11 @@
+ #else
+ //when MSI enabled. keep irq disabled when calling the action handler,
+ //exclude this IRQ from irq balancing (only on one CPU)
+- ((useMSI) ? (IRQF_DISABLED | IRQF_NOBALANCING) : (IRQF_SHARED)),
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0)
++ ((useMSI) ? (IRQF_DISABLED | IRQF_NOBALANCING) : (IRQF_SHARED)),
++#else
++ ((useMSI) ? (IRQF_NOBALANCING) : (IRQF_SHARED)),
++#endif
+ #endif
+ dev_name,
+ context);
diff --git a/lano1106_fglrx-13.8_proc.patch b/lano1106_fglrx-13.8_proc.patch
new file mode 100644
index 000000000000..e2ec7c30d0d0
--- /dev/null
+++ b/lano1106_fglrx-13.8_proc.patch
@@ -0,0 +1,50 @@
+--- 13.8/common/lib/modules/fglrx/build_mod/firegl_public.c 2013-09-26 00:59:28.292596334 -0400
++++ 13.8/common/lib/modules/fglrx/build_mod/firegl_public.c 2013-09-26 01:02:35.036252455 -0400
+@@ -821,7 +821,7 @@ static struct proc_dir_entry *firegl_pro
+ KCL_DEBUG1(FN_FIREGL_PROC, "minor %d, proc_list 0x%08lx\n", minor, (unsigned long)proc_list);
+ if (!minor)
+ {
+- root = KCL_create_proc_dir(NULL, "ati", S_IRUGO|S_IXUGO);
++ root = KCL_create_proc_dir(NULL, "ati", 0);
+ }
+
+ if (!root)
+@@ -835,7 +835,7 @@ static struct proc_dir_entry *firegl_pro
+ // Global major debice number entry and Global debug entry
+ while (globallist->rp || globallist->fops)
+ {
+- ent = KCL_create_proc_entry(root, globallist->name, S_IFREG|S_IRUGO, globallist->fops, globallist->rp, globallist->wp, dev);
++ ent = KCL_create_proc_entry(root, globallist->name, 0, globallist->fops, globallist->rp, globallist->wp, dev);
+ if (!ent)
+ {
+ KCL_remove_proc_dir_entry(NULL, "ati");
+@@ -847,7 +847,7 @@ static struct proc_dir_entry *firegl_pro
+ }
+
+ sprintf(name, "%d", minor);
+- *dev_root = KCL_create_proc_dir(root, name, S_IRUGO|S_IXUGO);
++ *dev_root = KCL_create_proc_dir(root, name, 0);
+ if (!*dev_root) {
+ KCL_remove_proc_dir_entry(root, "major");
+ KCL_remove_proc_dir_entry(NULL, "ati");
+@@ -857,7 +857,7 @@ static struct proc_dir_entry *firegl_pro
+
+ while (list->rp || list->fops)
+ {
+- ent = KCL_create_proc_entry(*dev_root, list->name, S_IFREG|S_IRUGO, list->fops, list->rp, list->wp,
++ ent = KCL_create_proc_entry(*dev_root, list->name, 0, list->fops, list->rp, list->wp,
+ ((dev->pubdev.signature == FGL_DEVICE_SIGNATURE)? firegl_find_device(minor) : (dev)));
+ if (!ent)
+ {
+@@ -6358,9 +6358,9 @@ void * KCL_create_proc_dir(void *root_di
+ dir = create_proc_entry(name, S_IFDIR | access, (struct proc_dir_entry *)root_dir);
+ #else
+ if (root_dir == NULL)
+- dir = proc_mkdir_mode(name, S_IFDIR | access, NULL);
++ dir = proc_mkdir_mode(name, access, NULL);
+ else
+- dir = proc_mkdir_mode(name, S_IFDIR | access, (struct proc_dir_entry *)root_dir);
++ dir = proc_mkdir_mode(name, access, (struct proc_dir_entry *)root_dir);
+ #endif
+
+ return dir;
diff --git a/lano1106_fglrx_intel_iommu.patch b/lano1106_fglrx_intel_iommu.patch
new file mode 100644
index 000000000000..101654c41c68
--- /dev/null
+++ b/lano1106_fglrx_intel_iommu.patch
@@ -0,0 +1,11 @@
+--- 13.4/common/lib/modules/fglrx/build_mod/firegl_public.c 2013-04-16 23:29:55.000000000 +0200
++++ 13.4/common/lib/modules/fglrx/build_mod/firegl_public.c 2013-05-21 17:05:34.726681102 +0200
+@@ -93,7 +93,7 @@
+ and they use different config options. These options can only be enabled
+ on x86_64 with newer 2.6 kernels (2.6.23 for intel, 2.6.26 for amd).
+ */
+-#if defined(CONFIG_AMD_IOMMU) || defined(CONFIG_DMAR)
++#if defined(CONFIG_AMD_IOMMU) || defined(CONFIG_INTEL_IOMMU)
+ #define FIREGL_DMA_REMAPPING
+ #endif
+
diff --git a/lano1106_kcl_agp_13_4.patch b/lano1106_kcl_agp_13_4.patch
new file mode 100644
index 000000000000..d39c5aaeb108
--- /dev/null
+++ b/lano1106_kcl_agp_13_4.patch
@@ -0,0 +1,90 @@
+--- 13.4/common/lib/modules/fglrx/build_mod/kcl_agp.c 2013-05-24 16:45:52.236740084 -0400
++++ 13.4/common/lib/modules/fglrx/build_mod/kcl_agp.c 2013-05-24 16:49:29.283579408 -0400
+@@ -56,6 +56,43 @@ unsigned int KCL_AGP_IsInUse(void)
+ return kcl_agp_is_in_use;
+ }
+
++/** \brief Find AGP caps registers in PCI config space
++ ** \param dev PCI device handle
++ ** \return Positive register index on success, negative errno on error
++ */
++int ATI_API_CALL KCL_AGP_FindCapsRegisters(KCL_PCI_DevHandle dev)
++{
++ u8 capndx;
++ u32 cap_id;
++
++ if (!dev)
++ {
++ return -ENODEV;
++ }
++
++ pci_read_config_byte((struct pci_dev*)dev, 0x34, &capndx);
++
++ if (capndx == 0x00)
++ {
++ return -ENODATA;
++ }
++
++ do
++ { // search capability list for AGP caps
++ pci_read_config_dword((struct pci_dev*)dev, capndx, &cap_id);
++
++ if ((cap_id & 0xff) == 0x02)
++ {
++ return capndx;
++ }
++
++ capndx = (cap_id >> 8) & 0xff;
++ }
++ while (capndx != 0x00);
++
++ return -ENODATA;
++}
++
+ #if defined(CONFIG_AGP) || defined(CONFIG_AGP_MODULE)
+
+ typedef struct {
+@@ -272,43 +309,6 @@ int ATI_API_CALL KCL_AGP_Enable(unsigned
+ }
+ }
+
+-/** \brief Find AGP caps registers in PCI config space
+- ** \param dev PCI device handle
+- ** \return Positive register index on success, negative errno on error
+- */
+-int ATI_API_CALL KCL_AGP_FindCapsRegisters(KCL_PCI_DevHandle dev)
+-{
+- u8 capndx;
+- u32 cap_id;
+-
+- if (!dev)
+- {
+- return -ENODEV;
+- }
+-
+- pci_read_config_byte((struct pci_dev*)dev, 0x34, &capndx);
+-
+- if (capndx == 0x00)
+- {
+- return -ENODATA;
+- }
+-
+- do
+- { // search capability list for AGP caps
+- pci_read_config_dword((struct pci_dev*)dev, capndx, &cap_id);
+-
+- if ((cap_id & 0xff) == 0x02)
+- {
+- return capndx;
+- }
+-
+- capndx = (cap_id >> 8) & 0xff;
+- }
+- while (capndx != 0x00);
+-
+- return -ENODATA;
+-}
+-
+ /** \brief Get AGP caps
+ ** \param dev PCI device handle
+ ** \param caps pointer to caps vector
diff --git a/makefile_compat.patch b/makefile_compat.patch
new file mode 100644
index 000000000000..defa3d8d8d5e
--- /dev/null
+++ b/makefile_compat.patch
@@ -0,0 +1,10 @@
+--- 10.10/common/lib/modules/fglrx/build_mod/2.6.x/Makefile 2010-09-22 09:15:33.000000000 +0200
++++ 10.10/common/lib/modules/fglrx/build_mod/2.6.x/Makefile 2010-10-01 17:57:21.057820899 +0200
+@@ -66,6 +66,7 @@
+ -DFGL_GART_RESERVED_SLOT \
+ -DFGL_LINUX253P1_VMA_API \
+ -DPAGE_ATTR_FIX=$(PAGE_ATTR_FIX) \
++ -DCOMPAT_ALLOC_USER_SPACE=$(COMPAT_ALLOC_USER_SPACE) \
+
+ ifeq ($(KERNELRELEASE),)
+ # on first call from remote location we get into this path