summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorVi0L02015-12-13 22:07:16 +0100
committerVi0L02015-12-13 22:07:16 +0100
commit2b8bbee1a102ff47f11b3c8dac68fb6ecb53a846 (patch)
tree28039313f87ea4dc2c01f62edec0993822a190bc
parent6ba2cb92eac8ae292a785c970f13f5b8ebe882e1 (diff)
downloadaur-2b8bbee1a102ff47f11b3c8dac68fb6ecb53a846.tar.gz
adding support for up to 4.3 linux kernel + adding custom ACPI files for events handling
-rw-r--r--.SRCINFO36
-rw-r--r--4.2-fglrx-has_fpu.patch20
-rw-r--r--4.2-kolasa-fpu_save_init.patch26
-rw-r--r--4.2-ubuntu_buildfix_kernel_4.2-modified.patch67
-rw-r--r--4.3-gentoo-mtrr.patch27
-rw-r--r--4.3-kolasa-seq_printf.patch15
-rw-r--r--PKGBUILD61
-rw-r--r--a-ac-aticonfig6
-rw-r--r--a-lid-aticonfig4
-rwxr-xr-xati-powermode.sh106
-rw-r--r--atieventsd.service4
-rw-r--r--atieventsd.sh6
-rwxr-xr-xcatalyst_build_module2
-rw-r--r--kolasa_4.0-cr4-strn.patch70
-rw-r--r--kolasa_4.1_remove-IRQF_DISABLED.patch15
-rw-r--r--ubuntu_buildfix_kernel_4.0.patch39
-rw-r--r--ubuntu_buildfix_kernel_4.1.patch16
17 files changed, 403 insertions, 117 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 0f089de70b6e..c6d98e4ffee3 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,18 +1,17 @@
pkgbase = catalyst-total-hd234k
pkgdesc = AMD/ATI legacy drivers. catalyst-hook + catalyst-utils + lib32-catalyst-utils
pkgver = 13.1
- pkgrel = 31
+ pkgrel = 32
url = http://www.amd.com
install = catalyst-total-hd234k.install
arch = i686
arch = x86_64
license = custom
depends = linux>=3.0
- depends = linux<4.2
+ depends = linux<4.4
depends = linux-headers
depends = xorg-server>=1.7.0
depends = xorg-server<1.13.0
- depends = netkit-bsd-finger
depends = libxrandr
depends = libsm
depends = fontconfig
@@ -24,6 +23,7 @@ pkgbase = catalyst-total-hd234k
depends = patch
depends = libxinerama
depends = mesa>=10.1.0-4
+ depends = gcc49
optdepends = qt4: to run ATi Catalyst Control Center (amdcccle)
optdepends = libxxf86vm: to run ATi Catalyst Control Center (amdcccle)
optdepends = opencl-headers: headers necessary for OpenCL development
@@ -61,6 +61,9 @@ pkgbase = catalyst-total-hd234k
source = catalyst.sh
source = atieventsd.sh
source = atieventsd.service
+ source = ati-powermode.sh
+ source = a-ac-aticonfig
+ source = a-lid-aticonfig
source = catalyst.conf
source = arch-fglrx-authatieventsd_new.patch
source = hook-fglrx
@@ -76,15 +79,23 @@ pkgbase = catalyst-total-hd234k
source = cold-fglrx-3.14-current_euid.patch
source = fglrx_gpl_symbol.patch
source = kolasa-3.19-get_cpu_var.patch
- source = kolasa_4.0-cr4-strn.patch
- source = kolasa_4.1_remove-IRQF_DISABLED.patch
+ source = ubuntu_buildfix_kernel_4.0.patch
+ source = ubuntu_buildfix_kernel_4.1.patch
source = arch-fglrx-acpi_handle.patch
+ source = 4.2-ubuntu_buildfix_kernel_4.2-modified.patch
+ source = 4.2-fglrx-has_fpu.patch
+ source = 4.2-kolasa-fpu_save_init.patch
+ source = 4.3-kolasa-seq_printf.patch
+ source = 4.3-gentoo-mtrr.patch
md5sums = c07fd1332abe4c742a9a0d0e0d0a90de
- md5sums = 769d233666d4353f514b5d7ff035f6b6
+ md5sums = 82c4e97854c020ad147a9122805a8936
md5sums = af7fb8ee4fc96fd54c5b483e33dc71c4
md5sums = bdafe749e046bfddee2d1c5e90eabd83
- md5sums = f729bf913613f49b0b9759c246058a87
- md5sums = bccf181a981ff429fe66f6ca5c3ea75a
+ md5sums = 9d9ea496eadf7e883d56723d65e96edf
+ md5sums = b79e144932616221f6d01c4b05dc9306
+ md5sums = 514899437eb209a1d4670df991cdfc10
+ md5sums = 80fdfbff93d96a1dfca2c7f684be8cc1
+ md5sums = 9054786e08cf3ea2a549fe22d7f2cd92
md5sums = 3e19c2285c76f4cb92108435a1e9c302
md5sums = b3ceefeb97c609037845f65d0956c4f0
md5sums = 9126e1ef0c724f8b57d3ac0fe77efe2f
@@ -100,9 +111,14 @@ pkgbase = catalyst-total-hd234k
md5sums = ba33b6ef10896d3e1b5e4cd96390b771
md5sums = ef97fc080ce7e5a275fe0c372bc2a418
md5sums = 3aa45013515b724a71bbd8e01f98ad99
- md5sums = dee3df1c5d3ed87363f4304da917fc00
- md5sums = 81a9e38dee025151cccb7e5db2362cfb
+ md5sums = 40aaf97acae268f8f7949e0fecb926d9
+ md5sums = 34f818673aec1eb2edb5f913b071ba08
md5sums = 645422762125052a0f13ecd03d7bf9dd
+ md5sums = 65ec204c8013fb5dc6aa624563c14512
+ md5sums = ae67dff6c218e028443dff6eacb26485
+ md5sums = ccfdf4784735a742c53bdc1309f49a51
+ md5sums = cdea2b2055df7d843b6096615e82d030
+ md5sums = 98828e3eeaec2b3795e584883cc1b746
pkgname = catalyst-total-hd234k
diff --git a/4.2-fglrx-has_fpu.patch b/4.2-fglrx-has_fpu.patch
new file mode 100644
index 000000000000..4247a1dfe90e
--- /dev/null
+++ b/4.2-fglrx-has_fpu.patch
@@ -0,0 +1,20 @@
+--- 15.11/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-11-08 17:46:13.157284759 +0100
++++ 15.11b/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-11-08 18:03:26.426797430 +0100
+@@ -6152,6 +6152,7 @@
+ */
+ struct task_struct *cur_task = current;
+ preempt_disable();
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,3,0)
+ /* The thread structure is changed with the commit below for kernel 3.3:
+ * https://github.com/torvalds/linux/commit/7e16838d94b566a17b65231073d179bc04d590c8
+@@ -6160,6 +6161,9 @@
+ #else
+ if (cur_task->thread.has_fpu)
+ #endif
++#else
++ if (cur_task->thread.fpu.fpregs_active)
++#endif
+ __save_init_fpu(cur_task);
+ else
+ clts();
diff --git a/4.2-kolasa-fpu_save_init.patch b/4.2-kolasa-fpu_save_init.patch
new file mode 100644
index 000000000000..de6475f16a68
--- /dev/null
+++ b/4.2-kolasa-fpu_save_init.patch
@@ -0,0 +1,26 @@
+---15.11/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-11-08 18:03:26.426797430 +0100
++++ 15.11b/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-11-08 18:11:43.177831390 +0100
+@@ -6143,7 +6143,11 @@
+ struct task_struct *cur_task = get_current();
+ preempt_disable();
+ if (cur_thread->status & TS_USEDFPU)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)
++ copy_fpregs_to_fpstate(&cur_task->thread.fpu);
++#else
+ __save_init_fpu(cur_task);
++#endif
+ else
+ clts();
+ #else
+@@ -6164,7 +6168,11 @@
+ #else
+ if (cur_task->thread.fpu.fpregs_active)
+ #endif
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)
++ copy_fpregs_to_fpstate(&cur_task->thread.fpu);
++#else
+ __save_init_fpu(cur_task);
++#endif
+ else
+ clts();
+ #endif
diff --git a/4.2-ubuntu_buildfix_kernel_4.2-modified.patch b/4.2-ubuntu_buildfix_kernel_4.2-modified.patch
new file mode 100644
index 000000000000..60a82b7c1d1a
--- /dev/null
+++ b/4.2-ubuntu_buildfix_kernel_4.2-modified.patch
@@ -0,0 +1,67 @@
+--- 15.11/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-11-08 17:32:54.748514621 +0100
++++ 15.11b/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-11-08 17:46:13.157284759 +0100
+@@ -190,9 +190,17 @@
+ #include <linux/string.h>
+ #include <linux/gfp.h>
+ #include <linux/swap.h>
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
+ #include "asm/i387.h"
++#else
++#include <asm/fpu/api.h>
++#endif
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
+ #include <asm/fpu-internal.h>
++#else
++#include <asm/fpu/internal.h>
++#endif
+ #endif
+
+ #include "firegl_public.h"
+@@ -1662,6 +1670,9 @@
+
+ #if defined(__i386__)
+ #ifndef __HAVE_ARCH_CMPXCHG
++#ifndef __xg
++#define __xg(x) ((volatile long *)(x))
++#endif
+ static inline
+ unsigned long __fgl_cmpxchg(volatile void *ptr, unsigned long old,
+ unsigned long new, int size)
+@@ -1698,7 +1709,11 @@
+ unsigned long new, int size)
+ {
+ #ifndef __HAVE_ARCH_CMPXCHG
++#if defined(__i386__)
+ return __fgl_cmpxchg(ptr,old,new,size);
++#elif defined(__x86_64__)
++ return cmpxchg((unsigned long*)ptr,old,new);
++#endif
+ #else
+ /* On kernel version 2.6.34 passing a variable or unsupported size
+ * argument to the __cmpxchg macro causes the default-clause of a
+@@ -6117,8 +6132,12 @@
+ void ATI_API_CALL KCL_fpu_begin(void)
+ {
+ #ifdef CONFIG_X86_64
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
+ kernel_fpu_begin();
+ #else
++ __kernel_fpu_begin();
++#endif
++#else
+ #ifdef TS_USEDFPU
+ struct thread_info *cur_thread = current_thread_info();
+ struct task_struct *cur_task = get_current();
+@@ -6154,7 +6173,11 @@
+ */
+ void ATI_API_CALL KCL_fpu_end(void)
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
+ kernel_fpu_end();
++#else
++ __kernel_fpu_end();
++#endif
+ }
+
+ #endif /* __KERNEL__ */
diff --git a/4.3-gentoo-mtrr.patch b/4.3-gentoo-mtrr.patch
new file mode 100644
index 000000000000..86d7ffc3cc2b
--- /dev/null
+++ b/4.3-gentoo-mtrr.patch
@@ -0,0 +1,27 @@
+--- 15.9/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-09-09 00:57:14.000000000 +0200
++++ 15.9/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-11-03 19:00:09.121884973 +0100
+@@ -3412,7 +3412,11 @@
+ int ATI_API_CALL KCL_MEM_MTRR_AddRegionWc(unsigned long base, unsigned long size)
+ {
+ #ifdef CONFIG_MTRR
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)
++ return arch_phys_wc_add(base, size);
++#else
+ return mtrr_add(base, size, MTRR_TYPE_WRCOMB, 1);
++#endif
+ #else /* !CONFIG_MTRR */
+ return -EPERM;
+ #endif /* !CONFIG_MTRR */
+@@ -3421,7 +3425,12 @@
+ int ATI_API_CALL KCL_MEM_MTRR_DeleteRegion(int reg, unsigned long base, unsigned long size)
+ {
+ #ifdef CONFIG_MTRR
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)
++ arch_phys_wc_del(reg);
++ return reg;
++#else
+ return mtrr_del(reg, base, size);
++#endif
+ #else /* !CONFIG_MTRR */
+ return -EPERM;
+ #endif /* !CONFIG_MTRR */
diff --git a/4.3-kolasa-seq_printf.patch b/4.3-kolasa-seq_printf.patch
new file mode 100644
index 000000000000..4b1a3b9b266e
--- /dev/null
+++ b/4.3-kolasa-seq_printf.patch
@@ -0,0 +1,15 @@
+--- 15.11/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-11-08 18:11:43.177831390 +0100
++++ 15.11b/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-11-08 18:23:11.599197785 +0100
+@@ -559,7 +559,12 @@
+ *start = buf; // For ProcFS: inform procfs that we start output at the beginning of the buffer
+ *eof = 1;
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,3,0)
+ len = snprintf(buf, request, "%d\n", major);
++#else
++ seq_printf(m, "%d\n", major);
++ len = 0;
++#endif
+
+ KCL_DEBUG1(FN_FIREGL_PROC, "return len=%i\n",len);
+
diff --git a/PKGBUILD b/PKGBUILD
index af7a5ecd43db..8f0c62ab8ab7 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -24,13 +24,13 @@
pkgname=catalyst-total-hd234k
pkgver=13.1
-pkgrel=31
+pkgrel=32
pkgdesc="AMD/ATI legacy drivers. catalyst-hook + catalyst-utils + lib32-catalyst-utils"
arch=('i686' 'x86_64')
url="http://www.amd.com"
license=('custom')
options=('staticlibs' 'libtool' '!strip' '!upx')
-depends=('linux>=3.0' 'linux<4.2' 'linux-headers' 'xorg-server>=1.7.0' 'xorg-server<1.13.0' 'netkit-bsd-finger' 'libxrandr' 'libsm' 'fontconfig' 'libxcursor' 'libxi' 'gcc-libs' 'gcc>4.0.0' 'make' 'patch' 'libxinerama' 'mesa>=10.1.0-4')
+depends=('linux>=3.0' 'linux<4.4' 'linux-headers' 'xorg-server>=1.7.0' 'xorg-server<1.13.0' 'libxrandr' 'libsm' 'fontconfig' 'libxcursor' 'libxi' 'gcc-libs' 'gcc>4.0.0' 'make' 'patch' 'libxinerama' 'mesa>=10.1.0-4' 'gcc49')
optdepends=('qt4: to run ATi Catalyst Control Center (amdcccle)'
'libxxf86vm: to run ATi Catalyst Control Center (amdcccle)'
'opencl-headers: headers necessary for OpenCL development'
@@ -64,12 +64,16 @@ source=(
catalyst.sh
atieventsd.sh
atieventsd.service
+ ati-powermode.sh
+ a-ac-aticonfig
+ a-lid-aticonfig
catalyst.conf
arch-fglrx-authatieventsd_new.patch
hook-fglrx
ati_make.sh
makefile_compat.patch
catalyst-hook.service
+
3.5-do_mmap.patch
arch-fglrx-3.7.patch
gentoo_linux-3.10-proc.diff
@@ -79,22 +83,32 @@ source=(
cold-fglrx-3.14-current_euid.patch
fglrx_gpl_symbol.patch
kolasa-3.19-get_cpu_var.patch
- kolasa_4.0-cr4-strn.patch
- kolasa_4.1_remove-IRQF_DISABLED.patch
- arch-fglrx-acpi_handle.patch)
+
+ ubuntu_buildfix_kernel_4.0.patch
+ ubuntu_buildfix_kernel_4.1.patch
+ arch-fglrx-acpi_handle.patch
+ 4.2-ubuntu_buildfix_kernel_4.2-modified.patch
+ 4.2-fglrx-has_fpu.patch
+ 4.2-kolasa-fpu_save_init.patch
+ 4.3-kolasa-seq_printf.patch
+ 4.3-gentoo-mtrr.patch)
md5sums=('c07fd1332abe4c742a9a0d0e0d0a90de'
- '769d233666d4353f514b5d7ff035f6b6'
+ '82c4e97854c020ad147a9122805a8936'
'af7fb8ee4fc96fd54c5b483e33dc71c4'
'bdafe749e046bfddee2d1c5e90eabd83'
- 'f729bf913613f49b0b9759c246058a87'
- 'bccf181a981ff429fe66f6ca5c3ea75a'
+ '9d9ea496eadf7e883d56723d65e96edf'
+ 'b79e144932616221f6d01c4b05dc9306'
+ '514899437eb209a1d4670df991cdfc10'
+ '80fdfbff93d96a1dfca2c7f684be8cc1'
+ '9054786e08cf3ea2a549fe22d7f2cd92'
'3e19c2285c76f4cb92108435a1e9c302'
'b3ceefeb97c609037845f65d0956c4f0'
'9126e1ef0c724f8b57d3ac0fe77efe2f'
'62239156a9656c6f41e89a879578925c'
'3e1b82bd69774ea808da69c983d6a43b'
'a64e2eae5addc6d670911ccf94b8cda4'
+
'a450e2e3db61994b09e9d99d95bee837'
'ff60c162b46e21e9810a722718023451'
'5872d95907a93ada44982e355e91e59d'
@@ -104,9 +118,15 @@ md5sums=('c07fd1332abe4c742a9a0d0e0d0a90de'
'ba33b6ef10896d3e1b5e4cd96390b771'
'ef97fc080ce7e5a275fe0c372bc2a418'
'3aa45013515b724a71bbd8e01f98ad99'
- 'dee3df1c5d3ed87363f4304da917fc00'
- '81a9e38dee025151cccb7e5db2362cfb'
- '645422762125052a0f13ecd03d7bf9dd')
+
+ '40aaf97acae268f8f7949e0fecb926d9'
+ '34f818673aec1eb2edb5f913b071ba08'
+ '645422762125052a0f13ecd03d7bf9dd'
+ '65ec204c8013fb5dc6aa624563c14512'
+ 'ae67dff6c218e028443dff6eacb26485'
+ 'ccfdf4784735a742c53bdc1309f49a51'
+ 'cdea2b2055df7d843b6096615e82d030'
+ '98828e3eeaec2b3795e584883cc1b746')
build() {
@@ -227,9 +247,13 @@ package() {
install -m644 usr/share/applications/*.desktop ${pkgdir}/usr/share/applications
# ACPI example files
- install -m755 usr/share/doc/fglrx/examples/etc/acpi/*.sh ${pkgdir}/etc/acpi
- sed -i -e "s/usr\/X11R6/usr/g" ${pkgdir}/etc/acpi/ati-powermode.sh
- install -m644 usr/share/doc/fglrx/examples/etc/acpi/events/* ${pkgdir}/etc/acpi/events
+# install -m755 usr/share/doc/fglrx/examples/etc/acpi/*.sh ${pkgdir}/etc/acpi
+# sed -i -e "s/usr\/X11R6/usr/g" ${pkgdir}/etc/acpi/ati-powermode.sh
+# install -m644 usr/share/doc/fglrx/examples/etc/acpi/events/* ${pkgdir}/etc/acpi/events
+ # lets check our own files - V
+ install -m755 ${srcdir}/ati-powermode.sh ${pkgdir}/etc/acpi
+ install -m644 ${srcdir}/a-ac-aticonfig ${pkgdir}/etc/acpi/events
+ install -m644 ${srcdir}/a-lid-aticonfig ${pkgdir}/etc/acpi/events
# Add ATI Events Daemon launcher
install -m755 ${srcdir}/atieventsd.sh ${pkgdir}/etc/rc.d/atieventsd
@@ -272,9 +296,14 @@ package() {
# 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
+ patch -Np1 -i ../ubuntu_buildfix_kernel_4.0.patch
+ patch -Np1 -i ../ubuntu_buildfix_kernel_4.1.patch
patch -Np1 -i ../arch-fglrx-acpi_handle.patch
+ patch -Np1 -i ../4.2-ubuntu_buildfix_kernel_4.2-modified.patch
+ patch -Np1 -i ../4.2-fglrx-has_fpu.patch
+ patch -Np1 -i ../4.2-kolasa-fpu_save_init.patch
+ patch -Np1 -i ../4.3-kolasa-seq_printf.patch
+ patch -Np1 -i ../4.3-gentoo-mtrr.patch
# Prepare modules source files
_archdir=x86_64
diff --git a/a-ac-aticonfig b/a-ac-aticonfig
new file mode 100644
index 000000000000..753e3af063f9
--- /dev/null
+++ b/a-ac-aticonfig
@@ -0,0 +1,6 @@
+# /etc/acpi/events/ac
+# Called when the user connects ac power to us
+#
+
+event=ac_adapter
+action=/etc/acpi/ati-powermode.sh "%e"
diff --git a/a-lid-aticonfig b/a-lid-aticonfig
new file mode 100644
index 000000000000..021f834ba6dd
--- /dev/null
+++ b/a-lid-aticonfig
@@ -0,0 +1,4 @@
+# Called when the user opens/closes the laptop lid
+
+event=button/lid
+action=/etc/acpi/ati-powermode.sh "%e"
diff --git a/ati-powermode.sh b/ati-powermode.sh
new file mode 100755
index 000000000000..ded996c43057
--- /dev/null
+++ b/ati-powermode.sh
@@ -0,0 +1,106 @@
+#!/bin/bash
+
+#
+# Control script for ACPI lid state and AC adapter state
+#
+
+getXuser() {
+ user=`pinky -fw | awk '{ if ($2 == ":'$displaynum'" || $(NF) == ":'$displaynum'" ) { print $1; exit; } }'`
+ if [ x"$user" = x"" ]; then
+ startx=`pgrep -n startx`
+ if [ x"$startx" != x"" ]; then
+ user=`ps -o user --no-headers $startx`
+ fi
+ fi
+ if [ x"$user" != x"" ]; then
+ userhome=`getent passwd $user | cut -d: -f6`
+ export XAUTHORITY=$userhome/.Xauthority
+ else
+ export XAUTHORITY=""
+ fi
+ export XUSER=$user
+}
+
+#Find the right XServer to be configured.
+getXserver() {
+for x in /tmp/.X11-unix/*; do
+ displaynum=`echo $x | sed s#/tmp/.X11-unix/X##`
+ getXuser;
+ if [ x"$XAUTHORITY" != x"" ]; then
+ export DISPLAY=":$displaynum"
+ fi
+done
+}
+
+#If PPLIB is enabled
+checkPPLIB() {
+su $user -c '/usr/bin/aticonfig --pplib-cmd="get version"' | grep PPLIB
+if [ $? = 0 ]; then
+ echo "Has PPLIB"
+ has_pplib=1
+else
+ echo "No PPLIB"
+ has_pplib=0
+fi
+}
+
+case "$1" in
+ ac_adapter)
+ case "$2" in
+ AC|ACAD|ADP0)
+ case "$4" in
+ 00000000)
+ logger 'AC unpluged'
+ getXserver;
+ checkPPLIB;
+ if [ ${has_pplib} -eq 1 ]; then
+ su $user -c '/usr/bin/aticonfig --pplib-cmd="notify psrc dc"'
+ else
+ su $user -c "/usr/bin/aticonfig --set-powerstate=1 --effective=now"
+ fi
+ ;;
+ 00000001)
+ logger 'AC pluged'
+ getXserver;
+ checkPPLIB;
+ if [ ${has_pplib} -eq 1 ]; then
+ su $user -c '/usr/bin/aticonfig --pplib-cmd="notify psrc ac"'
+ else
+ su $user -c "/usr/bin/aticonfig --set-powerstate=3 --effective=now"
+ fi
+ ;;
+ esac
+ ;;
+ *)
+ logger "ACPI action undefined: $2"
+ ;;
+ esac
+ ;;
+ button/lid)
+ case "$3" in
+ close)
+ logger 'LID closed'
+ getXserver;
+ checkPPLIB;
+ if [ ${has_pplib} -eq 1 ]; then
+ su $user -c '/usr/bin/aticonfig --pplib-cmd="notify psrc dc"'
+ else
+ su $user -c "/usr/bin/aticonfig --set-powerstate=1 --effective=now"
+ fi
+ ;;
+ open)
+ logger 'LID opened'
+ getXserver;
+ checkPPLIB;
+ if [ ${has_pplib} -eq 1 ]; then
+ su $user -c '/usr/bin/aticonfig --pplib-cmd="notify psrc ac"'
+ else
+ su $user -c "/usr/bin/aticonfig --set-powerstate=3 --effective=now"
+ fi
+ ;;
+ *)
+ logger "ACPI action undefined: $3"
+ ;;
+ esac
+ ;;
+esac \ No newline at end of file
diff --git a/atieventsd.service b/atieventsd.service
index ccf3a5975f1f..ff58ce7540ee 100644
--- a/atieventsd.service
+++ b/atieventsd.service
@@ -1,9 +1,9 @@
[Unit]
Description=Catalyst event Daemon
-Requires=acpid.socket
+Requires=acpid.service
[Service]
-ExecStart=/usr/sbin/atieventsd --nodaemon
+ExecStart=/usr/bin/atieventsd --nodaemon
[Install]
WantedBy=multi-user.target
diff --git a/atieventsd.sh b/atieventsd.sh
index 16bd9a4fa7b5..35968d29b17a 100644
--- a/atieventsd.sh
+++ b/atieventsd.sh
@@ -3,13 +3,13 @@
. /etc/rc.conf
. /etc/rc.d/functions
-ATID_PID=`pidof -o %PPID /usr/sbin/atieventsd`
+ATID_PID=`pidof -o %PPID /usr/bin/atieventsd`
case "$1" in
start)
rc=0
stat_busy "Starting ATI Events Daemon"
- [ -z "$ATID_PID" ] && /usr/sbin/atieventsd
+ [ -z "$ATID_PID" ] && /usr/bin/atieventsd
rc=$(($rc+$?))
if [ $rc -gt 0 ]; then
stat_fail
@@ -36,6 +36,6 @@ case "$1" in
$0 start
;;
*)
- echo "usage: $0 {start|stop|restart}"
+ echo "usage: $0 {start|stop|restart}"
esac
exit 0
diff --git a/catalyst_build_module b/catalyst_build_module
index 1476035c007f..6505ed68010a 100755
--- a/catalyst_build_module
+++ b/catalyst_build_module
@@ -34,7 +34,7 @@ install_module(){
#------------------------------------------------------------------------------------------
## Compile module using _ati_check variables
- make -C /usr/lib/modules/${kernver}/build SUBDIRS="`pwd`" ARCH=${arch} \
+ make CC=gcc-4.9 -C /usr/lib/modules/${kernver}/build SUBDIRS="`pwd`" ARCH=${arch} \
MODFLAGS="-DMODULE -DATI -DFGL -DPAGE_ATTR_FIX=$PAGE_ATTR_FIX -DCOMPAT_ALLOC_USER_SPACE=$COMPAT_ALLOC_USER_SPACE $def_smp $def_modversions" \
PAGE_ATTR_FIX=$PAGE_ATTR_FIX COMPAT_ALLOC_USER_SPACE=$COMPAT_ALLOC_USER_SPACE modules || return 1
diff --git a/kolasa_4.0-cr4-strn.patch b/kolasa_4.0-cr4-strn.patch
deleted file mode 100644
index 7bce698bad33..000000000000
--- a/kolasa_4.0-cr4-strn.patch
+++ /dev/null
@@ -1,70 +0,0 @@
-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
deleted file mode 100644
index f0b1b62756e9..000000000000
--- a/kolasa_4.1_remove-IRQF_DISABLED.patch
+++ /dev/null
@@ -1,15 +0,0 @@
---- 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/ubuntu_buildfix_kernel_4.0.patch b/ubuntu_buildfix_kernel_4.0.patch
new file mode 100644
index 000000000000..c46029187eaa
--- /dev/null
+++ b/ubuntu_buildfix_kernel_4.0.patch
@@ -0,0 +1,39 @@
+From 9029e189f8431a39146ac3477c7e4491e06c6f4b Mon Sep 17 00:00:00 2001
+From: Alberto Milone <alberto.milone@canonical.com>
+Date: Thu, 4 Jun 2015 18:03:39 +0200
+Subject: [PATCH 1/1] Add support for Linux 4.0
+
+---
+ firegl_public.c | 5 +++++
+ kcl_str.c | 4 ++++
+ 2 files changed, 9 insertions(+)
+
+--- 15.7/common/lib/modules/fglrx/build_mod/firegl_public.c
++++ 15.7b/common/lib/modules/fglrx/build_mod/firegl_public.c
+@@ -275,6 +275,11 @@ MODULE_LICENSE("Proprietary. (C) 2002 - ATI Technologies, Starnberg, GERMANY");
+ MODULE_DEVICE_TABLE(pci, fglrx_pci_table);
+ #endif
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 20, 0)
++#define read_cr4() __read_cr4()
++#define write_cr4(cr4) __write_cr4(cr4)
++#endif
++
+ /* globals constants */
+ const char* KCL_SYSINFO_OsVersionString = UTS_RELEASE;
+ const unsigned int KCL_SYSINFO_PageSize = PAGE_SIZE;
+diff --git a/kcl_str.c b/kcl_str.c
+index 2d89eb0..bacdb69 100755
+--- 15.7/common/lib/modules/fglrx/build_mod/kcl_str.c
++++ 15.7b/common/lib/modules/fglrx/build_mod/kcl_str.c
+@@ -42,6 +42,10 @@
+ #include "kcl_type.h"
+ #include "kcl_str.h"
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 20, 0)
++#define strnicmp strncasecmp
++#endif
++
+ /** \brief Fill memory with a constant byte
+ * \param s Pointer to memory
+ * \param c Initializing value
diff --git a/ubuntu_buildfix_kernel_4.1.patch b/ubuntu_buildfix_kernel_4.1.patch
new file mode 100644
index 000000000000..605420d7f5a1
--- /dev/null
+++ b/ubuntu_buildfix_kernel_4.1.patch
@@ -0,0 +1,16 @@
+--- 15.10/common/lib/modules/fglrx/build_mod/firegl_public.c 2013-01-15 22:33:27.000000000 +0100
++++ 15.10b/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-10-31 20:56:09.934455950 +0100
+@@ -2904,10 +2904,12 @@
+ KCL_PUB_InterruptHandlerWrap,
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,22)
+ ((useMSI) ? (SA_INTERRUPT) : (SA_SHIRQ)),
+-#else
++#elif LINUX_VERSION_CODE < KERNEL_VERSION(4,1,0)
+ //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)),
++#else
++ ((useMSI) ? (0x0) : (IRQF_SHARED)),
+ #endif
+ dev_name,
+ context);