summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmil Karlson <jekarlson@gmail.com>2015-02-12 22:03:26 +0200
committerEmil Karlson <jekarlson@gmail.com>2015-02-12 22:03:26 +0200
commit5c7604800fef9c0b99674970467fb9feec9ec723 (patch)
treedeaa6205b08a15fe2e2a9e1d809d039bc2a22c83
parentx11-drivers/ati-drivers: add hack for bug 516816 (diff)
downloadx11-5c7604800fef9c0b99674970467fb9feec9ec723.tar.gz
x11-5c7604800fef9c0b99674970467fb9feec9ec723.tar.bz2
x11-5c7604800fef9c0b99674970467fb9feec9ec723.zip
x11-drivers/ati-drivers: fix compile on linux-3.19
-rw-r--r--x11-drivers/ati-drivers/ati-drivers-14.12-r3.ebuild2
-rw-r--r--x11-drivers/ati-drivers/files/get-percpu-without-preempt-on-linux-3.19.patch45
2 files changed, 47 insertions, 0 deletions
diff --git a/x11-drivers/ati-drivers/ati-drivers-14.12-r3.ebuild b/x11-drivers/ati-drivers/ati-drivers-14.12-r3.ebuild
index b4aa1916..a792e680 100644
--- a/x11-drivers/ati-drivers/ati-drivers-14.12-r3.ebuild
+++ b/x11-drivers/ati-drivers/ati-drivers-14.12-r3.ebuild
@@ -327,6 +327,8 @@ src_prepare() {
# Compile fix, #526602
epatch "${FILESDIR}/use-kernel_fpu_begin.patch"
+ epatch "${FILESDIR}/get-percpu-without-preempt-on-linux-3.19.patch"
+
cd "${MODULE_DIR}"
# bugged fglrx build system, this file should be copied by hand
diff --git a/x11-drivers/ati-drivers/files/get-percpu-without-preempt-on-linux-3.19.patch b/x11-drivers/ati-drivers/files/get-percpu-without-preempt-on-linux-3.19.patch
new file mode 100644
index 00000000..d2c6f70c
--- /dev/null
+++ b/x11-drivers/ati-drivers/files/get-percpu-without-preempt-on-linux-3.19.patch
@@ -0,0 +1,45 @@
+From 56ca74832b1f97c8e89329a313c7ca2405cd26cb Mon Sep 17 00:00:00 2001
+From: Emil Karlson <jekarlson@gmail.com>
+Date: Thu, 12 Feb 2015 21:59:46 +0200
+Subject: [PATCH] get percpu without preempton linux-3.19
+
+---
+ common/lib/modules/fglrx/build_mod/firegl_public.c | 15 ++++++++++++---
+ 1 file changed, 12 insertions(+), 3 deletions(-)
+
+diff --git a/common/lib/modules/fglrx/build_mod/firegl_public.c b/common/lib/modules/fglrx/build_mod/firegl_public.c
+index 360b6ac..3cba36e 100755
+--- a/common/lib/modules/fglrx/build_mod/firegl_public.c
++++ b/common/lib/modules/fglrx/build_mod/firegl_public.c
+@@ -4816,8 +4816,13 @@ static unsigned long kasSetExecutionLevel(unsigned long level)
+ {
+ unsigned long orig_level;
+
+- orig_level = __get_cpu_var(kasExecutionLevel);
+- __get_cpu_var(kasExecutionLevel) = level;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)
++ orig_level = __get_cpu_var(kasExecutionLevel);
++ __get_cpu_var(kasExecutionLevel) = level;
++#else
++ orig_level = (*this_cpu_ptr(&(kasExecutionLevel)));
++ (*this_cpu_ptr(&(kasExecutionLevel))) = level;
++#endif
+
+ return orig_level;
+ }
+@@ -4829,7 +4834,11 @@ static unsigned long kasSetExecutionLevel(unsigned long level)
+ */
+ static unsigned long kas_GetExecutionLevel(void)
+ {
+- return __get_cpu_var(kasExecutionLevel);
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0)
++ return __get_cpu_var(kasExecutionLevel);
++#else
++ return (*this_cpu_ptr(&(kasExecutionLevel)));
++#endif
+ }
+
+ /** \brief Type definition for kas_spin_lock() parameter */
+--
+2.0.5
+