summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO49
-rw-r--r--4.2-amd-from_crimson_15.11.patch447
-rw-r--r--4.2-fglrx-has_fpu.patch20
-rw-r--r--4.2-kolasa-fpu_save_init.patch34
-rw-r--r--4.4-manjaro-xstate.patch22
-rw-r--r--PKGBUILD63
-rwxr-xr-xcatalyst_build_module2
-rw-r--r--crimson_i686_xg.patch12
-rw-r--r--fglrx_3.17rc6-no_hotplug.patch29
-rw-r--r--grsec_arch.patch77
-rw-r--r--kolasa-3.19-get_cpu_var.patch28
-rw-r--r--ubuntu_buildfix_kernel_4.0.patch39
-rw-r--r--ubuntu_buildfix_kernel_4.1.patch29
-rw-r--r--ubuntu_buildfix_kernel_4.2-build.copy_xregs_to_kernel.patch60
-rw-r--r--ubuntu_buildfix_kernel_4.2.patch114
15 files changed, 604 insertions, 421 deletions
diff --git a/.SRCINFO b/.SRCINFO
index ee8946018764..2447d88cc7c7 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,7 +1,7 @@
pkgbase = catalyst-firepro
pkgdesc = AMD/ATI beta drivers for FirePro/GL/MV brand cards. catalyst-hook + catalyst-utils + lib32-catalyst-utils + experimental powerXpress suppport.
- pkgver = 14.502.1040
- pkgrel = 2
+ pkgver = 15.201.2401
+ pkgrel = 1
url = http://www.amd.com
install = catalyst-firepro.install
arch = i686
@@ -9,10 +9,10 @@ pkgbase = catalyst-firepro
license = custom
makedepends = unzip
depends = linux>=3.0
- depends = linux<4.4
+ depends = linux<4.5
depends = linux-headers
depends = xorg-server>=1.7.0
- depends = xorg-server<1.17.0
+ depends = xorg-server<1.18.0
depends = libxrandr
depends = libsm
depends = fontconfig
@@ -24,18 +24,17 @@ pkgbase = catalyst-firepro
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
optdepends = acpid: acpi event support / atieventsd
optdepends = linux-lts-headers: to build the fglrx module for the linux-lts kernel
provides = libgl
- provides = libatical=14.502.1040
- provides = catalyst=14.502.1040
- provides = catalyst-libgl=14.502.1040
- provides = catalyst-utils=14.502.1040
- provides = catalyst-hook=14.502.1040
+ provides = libatical=15.201.2401
+ provides = catalyst=15.201.2401
+ provides = catalyst-libgl=15.201.2401
+ provides = catalyst-utils=15.201.2401
+ provides = catalyst-hook=15.201.2401
provides = libcl
provides = dri
provides = libtxc_dxtn
@@ -55,7 +54,7 @@ pkgbase = catalyst-firepro
options = libtool
options = !strip
options = !upx
- source = http://www2.ati.com/drivers/firepro/14.502.1040-linux-cert-retail.zip
+ source = http://www2.ati.com/drivers/firepro/15.201.2401-linux-retail_end_user.zip
source = catalyst_build_module
source = lib32-catalyst.sh
source = catalyst.sh
@@ -80,18 +79,14 @@ pkgbase = catalyst-firepro
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 = ubuntu_buildfix_kernel_4.0.patch
- source = ubuntu_buildfix_kernel_4.1.patch
- source = ubuntu_buildfix_kernel_4.2.patch
- source = 4.2-fglrx-has_fpu.patch
- source = 4.2-kolasa-fpu_save_init.patch
- source = ubuntu_buildfix_kernel_4.2-build.copy_xregs_to_kernel.patch
source = 4.3-kolasa-seq_printf.patch
source = 4.3-gentoo-mtrr.patch
- md5sums = 37d01238c76792592bfbc77c11dfa9fc
- md5sums = f3aaed0084725304cf607f6915e4bfee
+ source = 4.2-amd-from_crimson_15.11.patch
+ source = crimson_i686_xg.patch
+ source = 4.4-manjaro-xstate.patch
+ source = grsec_arch.patch
+ md5sums = 6b5633069fa8a331185ac903252507f5
+ md5sums = 601d9c756571dd79d26944e54827631e
md5sums = af7fb8ee4fc96fd54c5b483e33dc71c4
md5sums = bdafe749e046bfddee2d1c5e90eabd83
md5sums = 9d9ea496eadf7e883d56723d65e96edf
@@ -115,16 +110,12 @@ pkgbase = catalyst-firepro
md5sums = 2ab4837233de42332753882445373d7b
md5sums = ba33b6ef10896d3e1b5e4cd96390b771
md5sums = ef97fc080ce7e5a275fe0c372bc2a418
- md5sums = 67a22f624bae95a76638ce269392cb01
- md5sums = 3aa45013515b724a71bbd8e01f98ad99
- md5sums = 40aaf97acae268f8f7949e0fecb926d9
- md5sums = 982451bcc1fa1ee3da53ffa481d65581
- md5sums = 88832af8d6769aa51fa9b266a74394e0
- md5sums = ed7748a593d6b894269f8c7856b7ae50
- md5sums = dd51495a1d8f2d1042f04a783bf01e08
- md5sums = 2f7d42fde403a1b4a22e5db8de738d0f
md5sums = 0e0666e95d1d590a7a83192805679485
md5sums = 98828e3eeaec2b3795e584883cc1b746
+ md5sums = fd2851026228ca72124972d1ea0335ea
+ md5sums = 6cdbaf5f71d867d225721a0369413616
+ md5sums = d9bea135ae3e1b3ca87c5bbe6dcf8e72
+ md5sums = 8941e91fc58cb44ce21ab9bda135754e
pkgname = catalyst-firepro
diff --git a/4.2-amd-from_crimson_15.11.patch b/4.2-amd-from_crimson_15.11.patch
new file mode 100644
index 000000000000..cd957917b1bf
--- /dev/null
+++ b/4.2-amd-from_crimson_15.11.patch
@@ -0,0 +1,447 @@
+diff -uNr 15.12/common/lib/modules/fglrx//build_mod/firegl_public.c 15.12b/common/lib/modules/fglrx//build_mod/firegl_public.c
+--- 15.12/common/lib/modules/fglrx//build_mod/firegl_public.c 2015-09-09 00:57:14.000000000 +0200
++++ 15.12b/common/lib/modules/fglrx//build_mod/firegl_public.c 2015-11-21 00:35:38.000000000 +0100
+@@ -191,9 +191,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"
+@@ -1742,7 +1750,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
+@@ -3503,10 +3515,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_SHARED)),
++ ((useMSI) ? (IRQF_DISABLED) : (IRQF_SHARED)),
++#else
++ ((useMSI) ? (0x0) : (IRQF_SHARED)),
+ #endif
+ dev_name,
+ context);
+@@ -5031,7 +5045,7 @@
+ orig_level = kasSetExecutionLevel(kasContext.exec_level_ih);
+
+ ret = kasContext.callback_wrapper_ret(ih_routine, ih_context);
+- KCL_DEBUG1(FN_FIREGL_KAS,"Interrupt handler returned 0x%08X\n", ret);
++ KCL_DEBUG1(FN_FIREGL_KAS,"Interrupt handler returned 0x%08X\n", ret);
+
+ kasSetExecutionLevel(orig_level);
+ spin_unlock(&kasContext.lock_ih);
+@@ -6436,21 +6450,36 @@
+ struct fpu *fpu = &tsk->thread.fpu;
+
+ if(static_cpu_has(X86_FEATURE_XSAVE)) {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
+ fpu_xsave(fpu);
+ if (!(fpu->state->xsave.xsave_hdr.xstate_bv & XSTATE_FP))
+- return 1;
++#else
++ copy_xregs_to_kernel(&fpu->state.xsave);
++ if (!(fpu->state.xsave.header.xfeatures & XSTATE_FP))
++#endif
++ return 1;
+ } else if (static_cpu_has(X86_FEATURE_FXSR)) {
+- fpu_fxsave(fpu);
+- } else {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
++ fpu_fxsave(fpu);
++#else
++ copy_fxregs_to_kernel(fpu);
++#endif
++} else {
+ asm volatile("fnsave %[fx]; fwait"
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
+ : [fx] "=m" (fpu->state->fsave));
+- return 0;
++#else
++ : [fx] "=m" (fpu->state.fsave));
++#endif
++ return 0;
+ }
+
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
+ if (unlikely(fpu->state->fxsave.swd & X87_FSW_ES)) {
+- asm volatile("fnclex");
+- return 0;
++ asm volatile("fnclex");
++ return 0;
+ }
++#endif
+ return 1;
+ }
+ #endif
+@@ -6462,8 +6491,13 @@
+ 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
++ preempt_disable();
++ __kernel_fpu_begin();
++#endif
++#else
+ #ifdef TS_USEDFPU
+ struct thread_info *cur_thread = current_thread_info();
+ struct task_struct *cur_task = get_current();
+@@ -6487,8 +6521,12 @@
+ /* The thread structure is changed with the commit below for kernel 3.3:
+ * https://github.com/torvalds/linux/commit/7e16838d94b566a17b65231073d179bc04d590c8
+ */
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
+ if (cur_task->thread.fpu.has_fpu)
+ #else
++ if (cur_task->thread.fpu.fpregs_active)
++#endif
++#else
+ if (cur_task->thread.has_fpu)
+ #endif
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)
+@@ -6508,7 +6546,12 @@
+ */
+ void ATI_API_CALL KCL_fpu_end(void)
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
+ kernel_fpu_end();
++#else
++ __kernel_fpu_end();
++ preempt_enable();
++#endif
+ }
+
+ /** Create new directory entry under "/proc/...."
+diff -uNr 15.12/common/lib/modules/fglrx//build_mod/kcl_debug.c 15.12b/common/lib/modules/fglrx//build_mod/kcl_debug.c
+--- 15.12/common/lib/modules/fglrx//build_mod/kcl_debug.c 2015-09-09 00:57:14.000000000 +0200
++++ 15.12b/common/lib/modules/fglrx//build_mod/kcl_debug.c 2015-11-21 00:35:38.000000000 +0100
+@@ -35,10 +35,10 @@
+ #include <linux/kernel.h>
+ #include <linux/sysrq.h>
+ #include <linux/thread_info.h>
+-
++#include "firegl_public.h"
+ #include "kcl_debug.h"
+
+-extern void* ATI_API_CALL KCL_MEM_SmallBufferAllocAtomic(unsigned long size);
++extern void* ATI_API_CALL KCL_MEM_SmallBufferAllocAtomic(kcl_size_t size);
+ extern void ATI_API_CALL KCL_MEM_SmallBufferFree(void* p);
+
+ extern int ATI_API_CALL firegl_debug_dump(void);
+@@ -156,6 +156,47 @@
+ KCL_MEM_SmallBufferFree(buffer);
+ }
+
++/** \brief Print debug information to the OS debug console according to traceMask and debugMask
++ * \param traceMask Bit mask of enabled trace function
++ * \param debugMask Bit mask of enabled debug level. 0-7 total
++ * \param name function name
++ * \param line line number inside the file
++ * \param the print parameter
++ * \param fmt printf-like formatting string
++ * \param ... printf-like parameters
++ */
++void ATI_API_CALL KCL_DEBUG_Print_Trace(unsigned int traceMask, unsigned int debugMask, void* name, int line, long param, const char* fmt, ...)
++{
++ int print = firegl_trace(traceMask, debugMask, name, line, param);
++ if(print)
++ {
++ int len;
++ char* buffer=KCL_MEM_SmallBufferAllocAtomic(MAX_STRING_LENGTH);
++ if(buffer==NULL)
++ return;
++ if(fmt == NULL)
++ {
++ buffer[0] = '\n';
++ buffer[1] = '\0';
++ }
++ else
++ {
++ va_list marker;
++ va_start(marker, fmt);
++ kcl_vsnprintf(buffer,255,fmt, marker);
++ va_end(marker);
++ len = strlen(buffer);
++ if(buffer[len-1] != '\n')
++ {
++ buffer[len]='\n';
++ buffer[len+1]='\0';
++ }
++ }
++ KCL_DEBUG_Print("[fglrx] %s:%d %s", (char*)name, line, buffer);
++ KCL_MEM_SmallBufferFree(buffer);
++ }
++}
++
+ /** \brief Register keyboard handler to dump module internal state
+ * \param enable 1 to register the handler, 0 to unregister it
+ * \return 0
+diff -uNr 15.12/common/lib/modules/fglrx//build_mod/kcl_debug.h 15.12b/common/lib/modules/fglrx//build_mod/kcl_debug.h
+--- 15.12/common/lib/modules/fglrx//build_mod/kcl_debug.h 2015-09-09 00:57:14.000000000 +0200
++++ 15.12b/common/lib/modules/fglrx//build_mod/kcl_debug.h 2015-11-21 00:35:38.000000000 +0100
+@@ -64,17 +64,22 @@
+ FN_GENERIC_MAXIMUM = 0x3f
+ } FN_TRACE;
+
+-extern void ATI_API_CALL firegl_trace(unsigned int traceMask,
++extern int ATI_API_CALL firegl_trace(unsigned int traceMask,
+ unsigned int debugMask,
+ void* name,
+ int line,
+- long param,
+- const char* fmt,
+- ...);
++ long param);
+
+ #define MAX_STRING_LENGTH 512
+
+ void ATI_API_CALL KCL_DEBUG_Print(const char* fmt, ...);
++void ATI_API_CALL KCL_DEBUG_Print_Trace(unsigned int traceMask,
++ unsigned int debugMask,
++ void* name,
++ int line,
++ long param,
++ const char* fmt,
++ ...);
+ int ATI_API_CALL KCL_DEBUG_RegKbdHandler(int enable);
+ int ATI_API_CALL KCL_DEBUG_RegKbdDumpHandler(int enable);
+ void ATI_API_CALL KCL_DEBUG_OsDump(void);
+@@ -211,102 +216,106 @@
+ KCL_DEBUG_Print("<6>[fglrx] " fmt, ##arg)
+
+
+-#define KCL_DEBUG_TRACE(m, p, fmt, arg...) \
+- do \
+- { \
+- firegl_trace(m, \
+- FN_DEBUG_TRACE, \
+- (void*)__FUNCTION__, \
+- (int)(__LINE__), \
+- (long)(p), \
+- fmt, \
+- ##arg); \
++#define KCL_DEBUG_TRACE(m, p, fmt, arg...) \
++ do \
++ { \
++ KCL_DEBUG_Print_Trace(m, \
++ FN_DEBUG_TRACE, \
++ (void*)__FUNCTION__, \
++ (int)(__LINE__), \
++ (long)(p), \
++ fmt, \
++ ##arg); \
+ } while (0)
+
+ #define KCL_DEBUG_TRACEIN KCL_DEBUG_TRACE
+
+-#define KCL_DEBUG_TRACEOUT(m, p, fmt, arg...) \
+- do \
+- { \
+- firegl_trace(m, \
+- FN_DEBUG_TRACEOUT, \
+- (void*)__FUNCTION__, \
+- (int)(__LINE__), \
+- (long)(p), \
+- fmt, \
+- ##arg); \
+- } while (0)
+-
+-#define KCL_DEBUG1(m, fmt, arg...) \
+- do \
+- { \
+- firegl_trace(m, \
+- FN_DEBUG_LEVEL1, \
+- (void*)__FUNCTION__, \
+- (int)__LINE__, \
+- 0, \
+- fmt, \
+- ##arg); \
+- } while (0)
+-
+-#define KCL_DEBUG2(m, fmt, arg...) \
+- do \
+- { \
+- firegl_trace(m, \
+- FN_DEBUG_LEVEL2, \
+- (void*)__FUNCTION__, \
+- (int)__LINE__, \
+- 0, \
+- fmt, \
+- ##arg); \
+- } while (0)
+-
+-#define KCL_DEBUG3(m, fmt, arg...) \
+- do \
+- { \
+- firegl_trace(m, \
+- FN_DEBUG_LEVEL3, \
+- (void*)__FUNCTION__, \
+- (int)__LINE__, \
+- 0, \
+- fmt, \
+- ##arg); \
+- } while (0)
+-
+-#define KCL_DEBUG4(m, fmt, arg...) \
+- do \
+- { \
+- firegl_trace(m, \
+- FN_DEBUG_LEVEL4, \
+- (void*)__FUNCTION__, \
+- (int)__LINE__, \
+- 0, \
+- fmt, \
+- ##arg); \
+- } while (0)
+-
+-#define KCL_DEBUG5(m, fmt, arg...) \
+- do \
+- { \
+- firegl_trace(m, \
+- FN_DEBUG_LEVEL5, \
+- (void*)__FUNCTION__, \
+- (int)__LINE__, \
+- 0, \
+- fmt, \
+- ##arg); \
+- } while (0)
+-
+-#define KCL_DEBUG6(m, fmt, arg...) \
+- do \
+- { \
+- firegl_trace(m, \
+- FN_DEBUG_LEVEL6, \
+- (void*)__FUNCTION__, \
+- (int)__LINE__, \
+- 0, \
+- fmt, \
+- ##arg); \
++#define KCL_DEBUG_TRACEOUT(m, p, fmt, arg...) \
++ do \
++ { \
++ KCL_DEBUG_Print_Trace(m, \
++ FN_DEBUG_TRACEOUT, \
++ (void*)__FUNCTION__, \
++ (int)(__LINE__), \
++ (long)(p), \
++ fmt, \
++ ##arg); \
++ } while (0)
++
++
++#define KCL_DEBUG1(m, fmt, arg...) \
++ do \
++ { \
++ KCL_DEBUG_Print_Trace(m, \
++ FN_DEBUG_LEVEL1, \
++ (void*)__FUNCTION__, \
++ (int)(__LINE__), \
++ 0, \
++ fmt, \
++ ##arg); \
++ } while (0)
++
++#define KCL_DEBUG2(m, fmt, arg...) \
++ do \
++ { \
++ KCL_DEBUG_Print_Trace(m, \
++ FN_DEBUG_LEVEL2, \
++ (void*)__FUNCTION__, \
++ (int)(__LINE__), \
++ 0, \
++ fmt, \
++ ##arg); \
++ } while (0)
++
++#define KCL_DEBUG3(m, fmt, arg...) \
++ do \
++ { \
++ KCL_DEBUG_Print_Trace(m, \
++ FN_DEBUG_LEVEL3, \
++ (void*)__FUNCTION__, \
++ (int)(__LINE__), \
++ 0, \
++ fmt, \
++ ##arg); \
++ } while (0)
++
++
++#define KCL_DEBUG4(m, fmt, arg...) \
++ do \
++ { \
++ KCL_DEBUG_Print_Trace(m, \
++ FN_DEBUG_LEVEL4, \
++ (void*)__FUNCTION__, \
++ (int)(__LINE__), \
++ 0, \
++ fmt, \
++ ##arg); \
++ } while (0)
++
++
++#define KCL_DEBUG5(m, fmt, arg...) \
++ do \
++ { \
++ KCL_DEBUG_Print_Trace(m, \
++ FN_DEBUG_LEVEL5, \
++ (void*)__FUNCTION__, \
++ (int)(__LINE__), \
++ 0, \
++ fmt, \
++ ##arg); \
++ } while (0)
++
++
++#define KCL_DEBUG6(m, fmt, arg...) \
++ do \
++ { \
++ KCL_DEBUG_Print_Trace(m, \
++ FN_DEBUG_LEVEL6, \
++ (void*)__FUNCTION__, \
++ (int)(__LINE__), \
++ 0, \
++ fmt, \
++ ##arg); \
+ } while (0)
+
+ #endif
+diff -uNr 15.12/common/lib/modules/fglrx//build_mod/kcl_str.c 15.12b/common/lib/modules/fglrx//build_mod/kcl_str.c
+--- 15.12/common/lib/modules/fglrx//build_mod/kcl_str.c 2015-09-09 00:57:14.000000000 +0200
++++ 15.12b/common/lib/modules/fglrx//build_mod/kcl_str.c 2015-11-21 00:35:38.000000000 +0100
+@@ -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/4.2-fglrx-has_fpu.patch b/4.2-fglrx-has_fpu.patch
deleted file mode 100644
index 173ec888dc74..000000000000
--- a/4.2-fglrx-has_fpu.patch
+++ /dev/null
@@ -1,20 +0,0 @@
---- 15.7/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-07-04 16:31:23.000000000 +0200
-+++ 15.7b/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-08-21 15:26:44.860536831 +0200
-@@ -6475,6 +6475,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
-@@ -6483,6 +6484,9 @@
- #else
- if (cur_task->thread.has_fpu)
- #endif
-+#else
-+ if (cur_task->thread.fpu.fpregs_active)
-+#endif
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)
- KCL_fpu_save_init(cur_task);
- #else
diff --git a/4.2-kolasa-fpu_save_init.patch b/4.2-kolasa-fpu_save_init.patch
deleted file mode 100644
index 6d2e4e70c0f5..000000000000
--- a/4.2-kolasa-fpu_save_init.patch
+++ /dev/null
@@ -1,34 +0,0 @@
---- 15.9/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-09-20 18:29:19.488890309 +0200
-+++ 15.9b/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-09-20 14:20:51.000000000 +0200
-@@ -6505,11 +6505,15 @@
- 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
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)
- KCL_fpu_save_init(cur_task);
- #else
- __save_init_fpu(cur_task);
- #endif
-+#endif
- else
- clts();
-
-@@ -6531,11 +6535,15 @@
- #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
- #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0)
- KCL_fpu_save_init(cur_task);
- #else
- __save_init_fpu(cur_task);
- #endif
-+#endif
- else
- clts();
- #endif
diff --git a/4.4-manjaro-xstate.patch b/4.4-manjaro-xstate.patch
new file mode 100644
index 000000000000..c221952d5ec7
--- /dev/null
+++ b/4.4-manjaro-xstate.patch
@@ -0,0 +1,22 @@
+--- 15.12/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-12-18 19:47:41.000000000 +0100
++++ 15.12b/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-12-19 20:48:13.223261632 +0100
+@@ -6450,12 +6450,15 @@
+ struct fpu *fpu = &tsk->thread.fpu;
+
+ if(static_cpu_has(X86_FEATURE_XSAVE)) {
+-#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
+- fpu_xsave(fpu);
+- if (!(fpu->state->xsave.xsave_hdr.xstate_bv & XSTATE_FP))
+-#else
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0)
++ copy_xregs_to_kernel(&fpu->state.xsave);
++ if (!(fpu->state.xsave.header.xfeatures & XFEATURE_MASK_FP))
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)
+ copy_xregs_to_kernel(&fpu->state.xsave);
+ if (!(fpu->state.xsave.header.xfeatures & XSTATE_FP))
++#else
++ fpu_xsave(fpu);
++ if (!(fpu->state->xsave.xsave_hdr.xstate_bv & XSTATE_FP))
+ #endif
+ return 1;
+ } else if (static_cpu_has(X86_FEATURE_FXSR)) {
diff --git a/PKGBUILD b/PKGBUILD
index 6b340a2c72ae..853eda4b3cbf 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -18,20 +18,21 @@
# Contributor: lano1106 (patch to improve jacob's patch)
# Contributor: zoopp
# Contributor: solar (authatieventsd' patch s/-1/255)
-# Contributor: Cold (current_euid patch)
-# Contributor: kolasa (3.19, 4.0 and 4.1 kernel patch)
+# Contributor: kolasa (part of 4.3 kernel patches)
+# Contributor: gentoo (part of 4.3 kernel patches)
+# Contributor: Philip Müller @ Manjaro (4.4 kernel patch)
# PKGEXT='.pkg.tar.gz' # imho time to pack this pkg into tar.xz is too long, unfortunatelly yaourt got problems when ext is different from .pkg.tar.xz - V
pkgname=catalyst-firepro
-pkgver=14.502.1040
-pkgrel=2
+pkgver=15.201.2401
+pkgrel=1
pkgdesc="AMD/ATI beta drivers for FirePro/GL/MV brand cards. catalyst-hook + catalyst-utils + lib32-catalyst-utils + experimental powerXpress suppport."
arch=('i686' 'x86_64')
url="http://www.amd.com"
license=('custom')
options=('staticlibs' 'libtool' '!strip' '!upx')
-depends=('linux>=3.0' 'linux<4.4' 'linux-headers' 'xorg-server>=1.7.0' 'xorg-server<1.17.0' 'libxrandr' 'libsm' 'fontconfig' 'libxcursor' 'libxi' 'gcc-libs' 'gcc>4.0.0' 'make' 'patch' 'libxinerama' 'mesa>=10.1.0-4' 'gcc49')
+depends=('linux>=3.0' 'linux<4.5' 'linux-headers' 'xorg-server>=1.7.0' 'xorg-server<1.18.0' 'libxrandr' 'libsm' 'fontconfig' 'libxcursor' 'libxi' 'gcc-libs' 'gcc>4.0.0' 'make' 'patch' 'libxinerama' 'mesa>=10.1.0-4')
makedepends=('unzip')
optdepends=('qt4: to run ATi Catalyst Control Center (amdcccle)'
'libxxf86vm: to run ATi Catalyst Control Center (amdcccle)'
@@ -60,7 +61,7 @@ url_ref="http://support.amd.com/en-us/download/workstation?os=Linux+x86"
DLAGENTS="http::/usr/bin/curl --referer ${url_ref} -o %o %u"
source=(
- http://www2.ati.com/drivers/firepro/14.502.1040-linux-cert-retail.zip
+ http://www2.ati.com/drivers/firepro/15.201.2401-linux-retail_end_user.zip
catalyst_build_module
lib32-catalyst.sh
catalyst.sh
@@ -85,19 +86,15 @@ source=(
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
- ubuntu_buildfix_kernel_4.0.patch
- ubuntu_buildfix_kernel_4.1.patch
- ubuntu_buildfix_kernel_4.2.patch
- 4.2-fglrx-has_fpu.patch
- 4.2-kolasa-fpu_save_init.patch
- ubuntu_buildfix_kernel_4.2-build.copy_xregs_to_kernel.patch
4.3-kolasa-seq_printf.patch
- 4.3-gentoo-mtrr.patch)
-
-md5sums=('37d01238c76792592bfbc77c11dfa9fc'
- 'f3aaed0084725304cf607f6915e4bfee'
+ 4.3-gentoo-mtrr.patch
+ 4.2-amd-from_crimson_15.11.patch
+ crimson_i686_xg.patch
+ 4.4-manjaro-xstate.patch
+ grsec_arch.patch)
+
+md5sums=('6b5633069fa8a331185ac903252507f5'
+ '601d9c756571dd79d26944e54827631e'
'af7fb8ee4fc96fd54c5b483e33dc71c4'
'bdafe749e046bfddee2d1c5e90eabd83'
'9d9ea496eadf7e883d56723d65e96edf'
@@ -121,16 +118,12 @@ md5sums=('37d01238c76792592bfbc77c11dfa9fc'
'2ab4837233de42332753882445373d7b'
'ba33b6ef10896d3e1b5e4cd96390b771'
'ef97fc080ce7e5a275fe0c372bc2a418'
- '67a22f624bae95a76638ce269392cb01'
- '3aa45013515b724a71bbd8e01f98ad99'
- '40aaf97acae268f8f7949e0fecb926d9'
- '982451bcc1fa1ee3da53ffa481d65581'
- '88832af8d6769aa51fa9b266a74394e0'
- 'ed7748a593d6b894269f8c7856b7ae50'
- 'dd51495a1d8f2d1042f04a783bf01e08'
- '2f7d42fde403a1b4a22e5db8de738d0f'
'0e0666e95d1d590a7a83192805679485'
- '98828e3eeaec2b3795e584883cc1b746')
+ '98828e3eeaec2b3795e584883cc1b746'
+ 'fd2851026228ca72124972d1ea0335ea'
+ '6cdbaf5f71d867d225721a0369413616'
+ 'd9bea135ae3e1b3ca87c5bbe6dcf8e72'
+ '8941e91fc58cb44ce21ab9bda135754e')
@@ -312,19 +305,13 @@ package() {
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
- patch -Np1 -i ../fglrx_gpl_symbol.patch
- patch -Np1 -i ../ubuntu_buildfix_kernel_4.0.patch
- patch -Np1 -i ../ubuntu_buildfix_kernel_4.1.patch
- patch -Np1 -i ../ubuntu_buildfix_kernel_4.2.patch
- patch -Np1 -i ../4.2-fglrx-has_fpu.patch
- patch -Np1 -i ../4.2-kolasa-fpu_save_init.patch
- patch -Np1 -i ../ubuntu_buildfix_kernel_4.2-build.copy_xregs_to_kernel.patch
+ patch -Np1 -i ../4.2-amd-from_crimson_15.11.patch
patch -Np1 -i ../4.3-kolasa-seq_printf.patch
patch -Np1 -i ../4.3-gentoo-mtrr.patch
+ patch -Np1 -i ../fglrx_gpl_symbol.patch
+ test "${CARCH}" = "i686" && patch -Np1 -i ../crimson_i686_xg.patch
+ patch -Np1 -i ../4.4-manjaro-xstate.patch
+ patch -Np1 -i ../grsec_arch.patch
# Prepare modules source files
_archdir=x86_64
diff --git a/catalyst_build_module b/catalyst_build_module
index 0afc3130c19a..02d75f9e4c4a 100755
--- a/catalyst_build_module
+++ b/catalyst_build_module
@@ -35,7 +35,7 @@ install_module(){
## 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 CC=gcc-4.9 -C /usr/lib/modules/${kernver}/build SUBDIRS="`pwd`" ARCH=${arch} \
+ make -C /usr/lib/modules/${kernver}/build SUBDIRS="`pwd`" ARCH=${arch} \
MODFLAGS="$CFLAGS_MODULE" \
CFLAGS_MODULE="$CFLAGS_MODULE" \
PAGE_ATTR_FIX=$PAGE_ATTR_FIX COMPAT_ALLOC_USER_SPACE=$COMPAT_ALLOC_USER_SPACE modules || return 1
diff --git a/crimson_i686_xg.patch b/crimson_i686_xg.patch
new file mode 100644
index 000000000000..e3ce379f33d2
--- /dev/null
+++ b/crimson_i686_xg.patch
@@ -0,0 +1,12 @@
+--- 15.11/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-11-21 00:35:38.000000000 +0100
++++ 15.11b/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-11-24 22:28:02.113843493 +0100
+@@ -1714,6 +1714,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)
diff --git a/fglrx_3.17rc6-no_hotplug.patch b/fglrx_3.17rc6-no_hotplug.patch
deleted file mode 100644
index 7fbe1a25064c..000000000000
--- a/fglrx_3.17rc6-no_hotplug.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-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/grsec_arch.patch b/grsec_arch.patch
new file mode 100644
index 000000000000..323e44fd02fa
--- /dev/null
+++ b/grsec_arch.patch
@@ -0,0 +1,77 @@
+diff -uNr 15.12/common/lib/modules/fglrx//build_mod/firegl_public.c 15.12b/common/lib/modules/fglrx//build_mod/firegl_public.c
+--- 15.12/common/lib/modules/fglrx//build_mod/firegl_public.c 2015-12-19 21:14:13.251002548 +0100
++++ 15.12b/common/lib/modules/fglrx//build_mod/firegl_public.c 2015-12-19 21:36:27.703783498 +0100
+@@ -6465,11 +6465,21 @@
+
+ if(static_cpu_has(X86_FEATURE_XSAVE)) {
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0)
++#ifdef CONFIG_GRKERNSEC
++ copy_xregs_to_kernel(&fpu->state->xsave);
++ if (!(fpu->state->xsave.header.xfeatures & XFEATURE_MASK_FP))
++#else
+ copy_xregs_to_kernel(&fpu->state.xsave);
+ if (!(fpu->state.xsave.header.xfeatures & XFEATURE_MASK_FP))
++#endif
+ #elif LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)
++#ifdef CONFIG_GRKERNSEC
++ copy_xregs_to_kernel(&fpu->state->xsave);
++ if (!(fpu->state->xsave.header.xfeatures & XSTATE_FP))
++#else
+ copy_xregs_to_kernel(&fpu->state.xsave);
+ if (!(fpu->state.xsave.header.xfeatures & XSTATE_FP))
++#endif
+ #else
+ fpu_xsave(fpu);
+ if (!(fpu->state->xsave.xsave_hdr.xstate_bv & XSTATE_FP))
+@@ -6486,8 +6496,12 @@
+ #if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
+ : [fx] "=m" (fpu->state->fsave));
+ #else
++#ifdef CONFIG_GRKERNSEC
++ : [fx] "=m" (fpu->state->fsave));
++#else
+ : [fx] "=m" (fpu->state.fsave));
+ #endif
++#endif
+ return 0;
+ }
+
+diff -uNr 15.12/common/lib/modules/fglrx//build_mod/kcl_acpi.c 15.12b/common/lib/modules/fglrx//build_mod/kcl_acpi.c
+--- 15.12/common/lib/modules/fglrx//build_mod/kcl_acpi.c 2015-12-19 21:14:13.247669219 +0100
++++ 15.12b/common/lib/modules/fglrx//build_mod/kcl_acpi.c 2015-12-19 21:10:27.224899708 +0100
+@@ -145,7 +145,11 @@
+ return NOTIFY_OK;
+ }
+
++#ifdef CONFIG_GRKERNSEC
++static notifier_block_no_const firegl_acpi_lid_notifier = {
++#else
+ static struct notifier_block firegl_acpi_lid_notifier = {
++#endif
+ .notifier_call = firegl_acpi_lid_event,
+ };
+ #endif
+@@ -400,7 +404,11 @@
+ KCL_DEBUG_ERROR ("Could not allocate enough memory for video notifier_block\n");
+ return -ENOMEM;
+ }
++#ifdef CONFIG_GRKERNSEC
++ ((notifier_block_no_const*)(*nb))->notifier_call = firegl_acpi_video_event;
++#else
+ ((struct notifier_block*)(*nb))->notifier_call = firegl_acpi_video_event;
++#endif
+ return register_acpi_notifier((struct notifier_block*)(*nb));
+ }
+
+@@ -413,7 +421,11 @@
+ KCL_DEBUG_ERROR ("Could not allocate enough memory for ac notifier_block\n");
+ return -ENOMEM;
+ }
++#ifdef CONFIG_GRKERNSEC
++ ((notifier_block_no_const*)(*nb))->notifier_call = firegl_acpi_ac_event;
++#else
+ ((struct notifier_block*)(*nb))->notifier_call = firegl_acpi_ac_event;
++#endif
+ return register_acpi_notifier((struct notifier_block*)(*nb));
+ }
+
diff --git a/kolasa-3.19-get_cpu_var.patch b/kolasa-3.19-get_cpu_var.patch
deleted file mode 100644
index 5a571da9fd96..000000000000
--- a/kolasa-3.19-get_cpu_var.patch
+++ /dev/null
@@ -1,28 +0,0 @@
---- 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/ubuntu_buildfix_kernel_4.0.patch b/ubuntu_buildfix_kernel_4.0.patch
deleted file mode 100644
index c46029187eaa..000000000000
--- a/ubuntu_buildfix_kernel_4.0.patch
+++ /dev/null
@@ -1,39 +0,0 @@
-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
deleted file mode 100644
index cf3dda0bfc57..000000000000
--- a/ubuntu_buildfix_kernel_4.1.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-From 94631bfd9b813d9d2f1af0ea744e7121d72d25c5 Mon Sep 17 00:00:00 2001
-From: Alberto Milone <alberto.milone@canonical.com>
-Date: Fri, 10 Jul 2015 16:52:29 +0200
-Subject: [PATCH 1/2] Add support for Linux 4.1
-
-Drop the IRQF_DISABLED flag, as it was removed in Linux 4.1
-
-Signed-off-by: Alberto Milone <alberto.milone@canonical.com>
----
- firegl_public.c | 4 +++-
- kcl_acpi.c | 4 ++++
- 2 files changed, 7 insertions(+), 1 deletion(-)
-
---- 15.7/common/lib/modules/fglrx/build_mod/firegl_public.c
-+++ 15.7b/common/lib/modules/fglrx/build_mod/firegl_public.c
-@@ -3495,10 +3495,12 @@ int ATI_API_CALL KCL_InstallInterruptHandler(
- 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_SHARED)),
-+#else
-+ ((useMSI) ? (0x0) : (IRQF_SHARED)),
- #endif
- dev_name,
- context); \ No newline at end of file
diff --git a/ubuntu_buildfix_kernel_4.2-build.copy_xregs_to_kernel.patch b/ubuntu_buildfix_kernel_4.2-build.copy_xregs_to_kernel.patch
deleted file mode 100644
index b92c64fd5b95..000000000000
--- a/ubuntu_buildfix_kernel_4.2-build.copy_xregs_to_kernel.patch
+++ /dev/null
@@ -1,60 +0,0 @@
---- 15.9/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-09-27 10:59:10.121499353 +0200
-+++ 15.9b/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-09-27 10:59:31.869133789 +0200
-@@ -6446,6 +6446,48 @@
- return i;
- }
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0)
-+/*
-+ * Save processor xstate to xsave area.
-+ */
-+static void _copy_xregs_to_kernel(struct xregs_state *xstate)
-+{
-+ u64 mask = -1;
-+ u32 lmask = mask;
-+ u32 hmask = mask >> 32;
-+ int err = 0;
-+
-+ /*WARN_ON(!alternatives_patched);*/
-+
-+ /*
-+ * If xsaves is enabled, xsaves replaces xsaveopt because
-+ * it supports compact format and supervisor states in addition to
-+ * modified optimization in xsaveopt.
-+ *
-+ * Otherwise, if xsaveopt is enabled, xsaveopt replaces xsave
-+ * because xsaveopt supports modified optimization which is not
-+ * supported by xsave.
-+ *
-+ * If none of xsaves and xsaveopt is enabled, use xsave.
-+ */
-+ alternative_input_2(
-+ "1:"XSAVE,
-+ XSAVEOPT,
-+ X86_FEATURE_XSAVEOPT,
-+ XSAVES,
-+ X86_FEATURE_XSAVES,
-+ [xstate] "D" (xstate), "a" (lmask), "d" (hmask) :
-+ "memory");
-+ asm volatile("2:\n\t"
-+ xstate_fault(err)
-+ : "0" (err)
-+ : "memory");
-+
-+ /* We should never fault when copying to a kernel buffer: */
-+ WARN_ON_FPU(err);
-+}
-+#endif
-+
- /** \brief Generate UUID
- * \param buf pointer to the generated UUID
- * \return None
-@@ -6465,7 +6507,7 @@
- fpu_xsave(fpu);
- if (!(fpu->state->xsave.xsave_hdr.xstate_bv & XSTATE_FP))
- #else
-- copy_xregs_to_kernel(&fpu->state.xsave);
-+ _copy_xregs_to_kernel(&fpu->state.xsave);
- if (!(fpu->state.xsave.header.xfeatures & XSTATE_FP))
- #endif
- return 1;
diff --git a/ubuntu_buildfix_kernel_4.2.patch b/ubuntu_buildfix_kernel_4.2.patch
deleted file mode 100644
index 9aa71bb11434..000000000000
--- a/ubuntu_buildfix_kernel_4.2.patch
+++ /dev/null
@@ -1,114 +0,0 @@
-From eb7beb0ea51de526e59a0c3edc76530b28ef10e7 Mon Sep 17 00:00:00 2001
-From: Alberto Milone <alberto.milone@canonical.com>
-Date: Tue, 14 Jul 2015 12:56:37 +0200
-Subject: [PATCH 1/1] Add support for Linux 4.2
-
-Deal with the FPU code renaming
----
- firegl_public.c | 38 ++++++++++++++++++++++++++++++++++++++
- 1 file changed, 38 insertions(+)
-
---- 15.7/common/lib/modules/fglrx/build_mod/firegl_public.c
-+++ 15.7b/common/lib/modules/fglrx/build_mod/firegl_public.c
-@@ -191,9 +191,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"
-@@ -1698,6 +1706,9 @@ void ATI_API_CALL KCL_SetCurrentProcessState(KCL_ENUM_ProcessState state)
-
- #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)
-@@ -1734,7 +1745,11 @@ unsigned long ATI_API_CALL kcl__cmpxchg(volatile void *ptr, unsigned long old,
- 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
-@@ -6430,21 +6445,36 @@ static int KCL_fpu_save_init(struct task_struct *tsk)
- struct fpu *fpu = &tsk->thread.fpu;
-
- if(static_cpu_has(X86_FEATURE_XSAVE)) {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
- fpu_xsave(fpu);
- if (!(fpu->state->xsave.xsave_hdr.xstate_bv & XSTATE_FP))
-+#else
-+ copy_xregs_to_kernel(&fpu->state.xsave);
-+ if (!(fpu->state.xsave.header.xfeatures & XSTATE_FP))
-+#endif
- return 1;
- } else if (static_cpu_has(X86_FEATURE_FXSR)) {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
- fpu_fxsave(fpu);
-+#else
-+ copy_fxregs_to_kernel(fpu);
-+#endif
- } else {
- asm volatile("fnsave %[fx]; fwait"
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
- : [fx] "=m" (fpu->state->fsave));
-+#else
-+ : [fx] "=m" (fpu->state.fsave));
-+#endif
- return 0;
- }
-
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)
- if (unlikely(fpu->state->fxsave.swd & X87_FSW_ES)) {
- asm volatile("fnclex");
- return 0;
- }
-+#endif
- return 1;
- }
- #endif
-@@ -6456,8 +6486,12 @@ static int KCL_fpu_save_init(struct task_struct *tsk)
- 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();
-@@ -6502,7 +6536,11 @@ void ATI_API_CALL KCL_fpu_begin(void)
- */
- 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
- }
-
- /** Create new directory entry under "/proc/...."