1 |
commit: 6913a35966d89d28ed6208ab9a58c20fd8a80396 |
2 |
Author: Fernando Rodriguez <frodriguez.developer <AT> outlook <DOT> com> |
3 |
AuthorDate: Wed Sep 16 22:24:47 2015 +0000 |
4 |
Commit: Ian Delaney <idella4 <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Sep 23 09:21:10 2015 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6913a359 |
7 |
|
8 |
x11-drivers/ati-drivers: Fix compile errors and preemption bug |
9 |
|
10 |
Ebuild cleanup and patches to compile against recent kernels by |
11 |
replacing calls that use GPL'd kernel symbols with our own |
12 |
implementation and several others to fix compile errors caused |
13 |
by API changes on recent kernels. |
14 |
|
15 |
Also adds patch to disable preemption before calling certain |
16 |
kernel functions that trigger the following error: |
17 |
|
18 |
BUG: using smp_processor_id() in preemptible [00000000] code:firegl/3657 |
19 |
|
20 |
Gentoo-Bug: 548118 |
21 |
Gentoo-Bug: 542320 |
22 |
|
23 |
x11-drivers/ati-drivers/ati-drivers-15.9.ebuild | 56 +++++++---- |
24 |
x11-drivers/ati-drivers/files/15.9-fpu.patch | 39 ++++++++ |
25 |
x11-drivers/ati-drivers/files/15.9-kcl_str.patch | 14 +++ |
26 |
x11-drivers/ati-drivers/files/15.9-mtrr.patch | 27 ++++++ |
27 |
x11-drivers/ati-drivers/files/15.9-preempt.patch | 103 +++++++++++++++++++++ |
28 |
.../files/15.9-remove-gpl-symbols.patch | 74 +++++++++++++++ |
29 |
.../ati-drivers/files/15.9-sep_printf.patch | 11 +++ |
30 |
7 files changed, 307 insertions(+), 17 deletions(-) |
31 |
|
32 |
diff --git a/x11-drivers/ati-drivers/ati-drivers-15.9.ebuild b/x11-drivers/ati-drivers/ati-drivers-15.9.ebuild |
33 |
index 0d90755..9bc5788 100644 |
34 |
--- a/x11-drivers/ati-drivers/ati-drivers-15.9.ebuild |
35 |
+++ b/x11-drivers/ati-drivers/ati-drivers-15.9.ebuild |
36 |
@@ -13,8 +13,10 @@ RUN="${WORKDIR}/AMD-Catalyst-15.9-Linux-installer-15.201.1151-x86.x86_64.run" |
37 |
SLOT="1" |
38 |
# Uses javascript for download YESSSS |
39 |
#DRIVERS_URI="http://www2.ati.com/drivers/linux/amd-catalyst-13.12-linux-x86.x86_64.zip" |
40 |
-DRIVERS_URI="mirror://gentoo/amd-catalyst-${PV}-linux-installer-15.201.1151-x86.x86_64.zip" |
41 |
-XVBA_SDK_URI="http://developer.amd.com/wordpress/media/2012/10/xvba-sdk-0.74-404001.tar.gz" |
42 |
+DRV_VER="amd-catalyst-${PV}-linux-installer-15.201.1151-x86.x86_64.zip" |
43 |
+DRIVERS_URI="mirror://gentoo/${DRV_VER}" |
44 |
+SDK_VER="xvba-sdk-0.74-404001.tar.gz" |
45 |
+XVBA_SDK_URI="http://developer.amd.com/wordpress/media/2012/10/${SDK_VER}" |
46 |
SRC_URI="${DRIVERS_URI} ${XVBA_SDK_URI}" |
47 |
FOLDER_PREFIX="common/" |
48 |
IUSE="debug +modules qt4 static-libs pax_kernel gdm-hack" |
49 |
@@ -149,19 +151,21 @@ pkg_nofetch() { |
50 |
einfo "The driver packages" |
51 |
einfo ${A} |
52 |
einfo "need to be downloaded manually from" |
53 |
- einfo "http://support.amd.com/en-us/download/desktop?os=Linux%20x86_64" |
54 |
+ einfo "http://support.amd.com/en-us/download/desktop?os=Linux+x86" |
55 |
einfo "and ${XVBA_SDK_URI}" |
56 |
} |
57 |
|
58 |
pkg_pretend() { |
59 |
- local CONFIG_CHECK="~MTRR ~!DRM ACPI PCI_MSI !LOCKDEP !PAX_KERNEXEC_PLUGIN_METHOD_OR" |
60 |
+ local CONFIG_CHECK="~MTRR ~!DRM ACPI PCI_MSI \ |
61 |
+ !LOCKDEP !PAX_KERNEXEC_PLUGIN_METHOD_OR" |
62 |
use amd64 && CONFIG_CHECK+=" COMPAT" |
63 |
|
64 |
local ERROR_MTRR="CONFIG_MTRR required for direct rendering." |
65 |
- local ERROR_DRM="CONFIG_DRM must be disabled or compiled as a module and not loaded for direct |
66 |
- rendering to work." |
67 |
- local ERROR_LOCKDEP="CONFIG_LOCKDEP (lock tracking) exports the symbol lock_acquire |
68 |
- as GPL-only. This prevents ${P} from compiling with an error like this: |
69 |
+ local ERROR_DRM="CONFIG_DRM must be disabled or compiled as a |
70 |
+ module and not loaded for direct rendering to work." |
71 |
+ local ERROR_LOCKDEP="CONFIG_LOCKDEP (lock tracking) exports |
72 |
+ the symbol lock_acquire as GPL-only. This prevents ${P} from |
73 |
+ compiling with an error like this: |
74 |
FATAL: modpost: GPL-incompatible module fglrx.ko uses GPL-only symbol 'lock_acquire'" |
75 |
local ERROR_PAX_KERNEXEC_PLUGIN_METHOD_OR="This config option will cause |
76 |
kernel to reject loading the fglrx module with |
77 |
@@ -191,15 +195,18 @@ pkg_pretend() { |
78 |
|
79 |
pkg_setup() { |
80 |
if use modules; then |
81 |
- MODULE_NAMES="fglrx(video:${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod/2.6.x)" |
82 |
+ MODULE_PATH="${S}/${FOLDER_PREFIX}/lib/modules/fglrx/build_mod/2.6.x" |
83 |
+ MODULE_NAMES="fglrx(video:${MODULE_PATH})" |
84 |
BUILD_TARGETS="kmod_build" |
85 |
linux-mod_pkg_setup |
86 |
BUILD_PARAMS="GCC_VER_MAJ=$(gcc-major-version) KVER=${KV_FULL} KDIR=${KV_OUT_DIR}" |
87 |
BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=\"-DMODULE -DATI -DFGL\"" |
88 |
if grep -q arch_compat_alloc_user_space ${KV_DIR}/arch/x86/include/asm/compat.h ; then |
89 |
- BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=arch_compat_alloc_user_space" |
90 |
+ BUILD_PARAMS="${BUILD_PARAMS} \ |
91 |
+ CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=arch_compat_alloc_user_space" |
92 |
else |
93 |
- BUILD_PARAMS="${BUILD_PARAMS} CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=compat_alloc_user_space" |
94 |
+ BUILD_PARAMS="${BUILD_PARAMS} \ |
95 |
+ CFLAGS_MODULE+=-DCOMPAT_ALLOC_USER_SPACE=compat_alloc_user_space" |
96 |
fi |
97 |
fi |
98 |
# Define module dir. |
99 |
@@ -310,6 +317,16 @@ src_prepare() { |
100 |
# Compile fix, #526602 |
101 |
epatch "${FILESDIR}/use-kernel_fpu_begin.patch" |
102 |
|
103 |
+ # Fix #542320 |
104 |
+ epatch "${FILESDIR}/15.9-preempt.patch" |
105 |
+ |
106 |
+ # Compile fixes, #548118 |
107 |
+ epatch "${FILESDIR}/15.9-remove-gpl-symbols.patch" |
108 |
+ epatch "${FILESDIR}/15.9-fpu.patch" |
109 |
+ epatch "${FILESDIR}/15.9-kcl_str.patch" |
110 |
+ epatch "${FILESDIR}/15.9-sep_printf.patch" |
111 |
+ epatch "${FILESDIR}/15.9-mtrr.patch" |
112 |
+ |
113 |
epatch_user |
114 |
|
115 |
cd "${MODULE_DIR}" |
116 |
@@ -393,7 +410,9 @@ src_install() { |
117 |
|
118 |
#516816 |
119 |
if use gdm-hack; then |
120 |
- sed -i 's#/proc/%i/fd/0#/etc/ati/xvrn#g' "${D}/usr/$(get_libdir)/xorg/modules/drivers/fglrx_drv.so" || die "Applying gdm-hack failed" |
121 |
+ sed -i 's#/proc/%i/fd/0#/etc/ati/xvrn#g' \ |
122 |
+ "${D}/usr/$(get_libdir)/xorg/modules/drivers/fglrx_drv.so" || \ |
123 |
+ die "Applying gdm-hack failed" |
124 |
fi |
125 |
|
126 |
# Arch-specific files. |
127 |
@@ -500,7 +519,9 @@ src_install-libs() { |
128 |
|
129 |
#516816 |
130 |
if use gdm-hack; then |
131 |
- sed -i 's#/proc/%i/fd/0#/etc/ati/xvrn#g' "${D}/${ATI_ROOT}/extensions/libglx.so" || die "Applying gdm-hack failed" |
132 |
+ sed -i 's#/proc/%i/fd/0#/etc/ati/xvrn#g' \ |
133 |
+ "${D}/${ATI_ROOT}/extensions/libglx.so" \ |
134 |
+ || die "Applying gdm-hack failed" |
135 |
fi |
136 |
fi |
137 |
|
138 |
@@ -585,10 +606,11 @@ pkg_postinst() { |
139 |
"${ROOT}"/usr/bin/eselect opencl set --use-old amd |
140 |
|
141 |
if has_version "x11-drivers/xf86-video-intel[sna]"; then |
142 |
- ewarn "It is reported that xf86-video-intel built with USE=\"sna\" causes the X server" |
143 |
- ewarn "to crash on systems that use hybrid AMD/Intel graphics. If you experience" |
144 |
- ewarn "this crash, downgrade to xf86-video-intel-2.20.2 or earlier or" |
145 |
- ewarn "try disabling sna for xf86-video-intel." |
146 |
+ ewarn "It is reported that xf86-video-intel built with USE=\"sna\"" |
147 |
+ ewarn "causes the X server to crash on systems that use hybrid" |
148 |
+ ewarn "AMD/Intel graphics. If you experience this crash, downgrade" |
149 |
+ ewarn "to xf86-video-intel-2.20.2 or earlier or try disabling sna" |
150 |
+ ewarn "for xf86-video-intel." |
151 |
ewarn "For details, see https://bugs.gentoo.org/show_bug.cgi?id=430000" |
152 |
fi |
153 |
|
154 |
|
155 |
diff --git a/x11-drivers/ati-drivers/files/15.9-fpu.patch b/x11-drivers/ati-drivers/files/15.9-fpu.patch |
156 |
new file mode 100644 |
157 |
index 0000000..d059f14 |
158 |
--- /dev/null |
159 |
+++ b/x11-drivers/ati-drivers/files/15.9-fpu.patch |
160 |
@@ -0,0 +1,39 @@ |
161 |
+--- a/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-09-13 13:55:29.000000000 -0400 |
162 |
++++ b/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-09-13 14:56:24.000000000 -0400 |
163 |
+@@ -192,8 +192,13 @@ |
164 |
+ #include <linux/string.h> |
165 |
+ #include <linux/gfp.h> |
166 |
+ #include <linux/swap.h> |
167 |
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0) |
168 |
+ #include "asm/i387.h" |
169 |
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0) |
170 |
++#endif |
171 |
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0) |
172 |
++#include <asm/fpu/internal.h> |
173 |
++#define __HAVE_ARCH_CMPXCHG 1 |
174 |
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,4,0) |
175 |
+ #include <asm/fpu-internal.h> |
176 |
+ #endif |
177 |
+ |
178 |
+@@ -3528,8 +3533,12 @@ int ATI_API_CALL KCL_InstallInterruptHan |
179 |
+ #else |
180 |
+ //when MSI enabled. keep irq disabled when calling the action handler, |
181 |
+ //exclude this IRQ from irq balancing (only on one CPU) |
182 |
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0) |
183 |
++ ((useMSI) ? (IRQF_NOBALANCING) : (IRQF_SHARED)), |
184 |
++#else |
185 |
+ ((useMSI) ? (IRQF_DISABLED) : (IRQF_SHARED)), |
186 |
+ #endif |
187 |
++#endif |
188 |
+ dev_name, |
189 |
+ context); |
190 |
+ } |
191 |
+@@ -6465,7 +6474,7 @@ void ATI_API_CALL KCL_create_uuid(void * |
192 |
+ generate_random_uuid((char *)buf); |
193 |
+ } |
194 |
+ |
195 |
+-#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0) |
196 |
++#if (!defined(CONFIG_X86_64) || LINUX_VERSION_CODE < KERNEL_VERSION(4,2,0)) && LINUX_VERSION_CODE >= KERNEL_VERSION(3,15,0) |
197 |
+ static int KCL_fpu_save_init(struct task_struct *tsk) |
198 |
+ { |
199 |
+ struct fpu *fpu = &tsk->thread.fpu; |
200 |
|
201 |
diff --git a/x11-drivers/ati-drivers/files/15.9-kcl_str.patch b/x11-drivers/ati-drivers/files/15.9-kcl_str.patch |
202 |
new file mode 100644 |
203 |
index 0000000..20c3bc8 |
204 |
--- /dev/null |
205 |
+++ b/x11-drivers/ati-drivers/files/15.9-kcl_str.patch |
206 |
@@ -0,0 +1,14 @@ |
207 |
+--- a/common/lib/modules/fglrx/build_mod/kcl_str.c 2015-09-13 13:47:30.000000000 -0400 |
208 |
++++ b/common/lib/modules/fglrx/build_mod/kcl_str.c 2015-09-13 13:49:42.000000000 -0400 |
209 |
+@@ -169,7 +169,11 @@ int ATI_API_CALL KCL_STR_Strnicmp(const |
210 |
+ const char* s2, |
211 |
+ KCL_TYPE_SizeSigned count) |
212 |
+ { |
213 |
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4,0,0) |
214 |
+ return strnicmp(s1, s2, count); |
215 |
++#else |
216 |
++ return strncasecmp(s1, s2, count); |
217 |
++#endif |
218 |
+ } |
219 |
+ |
220 |
+ /** \brief Locate character in string |
221 |
|
222 |
diff --git a/x11-drivers/ati-drivers/files/15.9-mtrr.patch b/x11-drivers/ati-drivers/files/15.9-mtrr.patch |
223 |
new file mode 100644 |
224 |
index 0000000..bdf70b4 |
225 |
--- /dev/null |
226 |
+++ b/x11-drivers/ati-drivers/files/15.9-mtrr.patch |
227 |
@@ -0,0 +1,27 @@ |
228 |
+--- a/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-09-19 23:43:22.000000000 -0400 |
229 |
++++ b/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-09-19 23:52:07.000000000 -0400 |
230 |
+@@ -3442,7 +3442,11 @@ int ATI_API_CALL KCL_MEM_MTRR_Support(vo |
231 |
+ int ATI_API_CALL KCL_MEM_MTRR_AddRegionWc(unsigned long base, unsigned long size) |
232 |
+ { |
233 |
+ #ifdef CONFIG_MTRR |
234 |
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0) |
235 |
++ return arch_phys_wc_add(base, size); |
236 |
++#else |
237 |
+ return mtrr_add(base, size, MTRR_TYPE_WRCOMB, 1); |
238 |
++#endif |
239 |
+ #else /* !CONFIG_MTRR */ |
240 |
+ return -EPERM; |
241 |
+ #endif /* !CONFIG_MTRR */ |
242 |
+@@ -3451,7 +3455,12 @@ int ATI_API_CALL KCL_MEM_MTRR_AddRegionW |
243 |
+ int ATI_API_CALL KCL_MEM_MTRR_DeleteRegion(int reg, unsigned long base, unsigned long size) |
244 |
+ { |
245 |
+ #ifdef CONFIG_MTRR |
246 |
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0) |
247 |
++ arch_phys_wc_del(reg); |
248 |
++ return reg; |
249 |
++#else |
250 |
+ return mtrr_del(reg, base, size); |
251 |
++#endif |
252 |
+ #else /* !CONFIG_MTRR */ |
253 |
+ return -EPERM; |
254 |
+ #endif /* !CONFIG_MTRR */ |
255 |
|
256 |
diff --git a/x11-drivers/ati-drivers/files/15.9-preempt.patch b/x11-drivers/ati-drivers/files/15.9-preempt.patch |
257 |
new file mode 100644 |
258 |
index 0000000..c659883 |
259 |
--- /dev/null |
260 |
+++ b/x11-drivers/ati-drivers/files/15.9-preempt.patch |
261 |
@@ -0,0 +1,103 @@ |
262 |
+--- a/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-08-30 17:36:02.000000000 -0400 |
263 |
++++ b/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-08-30 17:39:36.000000000 -0400 |
264 |
+@@ -21,6 +21,8 @@ |
265 |
+ !!! since it requires changes to linux/init/main.c. |
266 |
+ #endif /* !MODULE */ |
267 |
+ |
268 |
++#include <linux/preempt.h> |
269 |
++ |
270 |
+ // ============================================================ |
271 |
+ #include <linux/version.h> |
272 |
+ |
273 |
+@@ -4997,7 +4999,9 @@ static unsigned int kas_spin_unlock(kas_ |
274 |
+ unsigned long ATI_API_CALL KAS_GetExecutionLevel(void) |
275 |
+ { |
276 |
+ unsigned long ret; |
277 |
++ preempt_disable(); |
278 |
+ ret = kas_GetExecutionLevel(); |
279 |
++ preempt_enable(); |
280 |
+ return ret; |
281 |
+ } |
282 |
+ |
283 |
+@@ -5022,8 +5026,10 @@ unsigned int ATI_API_CALL KAS_Ih_Execute |
284 |
+ KCL_DEBUG5(FN_FIREGL_KAS,"0x%08X, 0x%08X\n", ih_routine, ih_context); |
285 |
+ |
286 |
+ //Prevent simultaneous entry on some SMP systems. |
287 |
++ preempt_disable(); |
288 |
+ if (test_and_set_bit(0, (void *)&(kasContext.in_interrupts[smp_processor_id()]))) |
289 |
+ { |
290 |
++ preempt_enable(); |
291 |
+ KCL_DEBUG1(FN_FIREGL_KAS, "The processor is handling the interrupt\n"); |
292 |
+ return IRQ_NONE; |
293 |
+ } |
294 |
+@@ -5036,9 +5042,9 @@ unsigned int ATI_API_CALL KAS_Ih_Execute |
295 |
+ |
296 |
+ kasSetExecutionLevel(orig_level); |
297 |
+ spin_unlock(&kasContext.lock_ih); |
298 |
+- |
299 |
+ clear_bit(0, (void *)&(kasContext.in_interrupts[smp_processor_id()])); |
300 |
+ KCL_DEBUG5(FN_FIREGL_KAS,"%d\n", ret); |
301 |
++ preempt_enable(); |
302 |
+ |
303 |
+ return ret; |
304 |
+ } |
305 |
+@@ -5256,6 +5262,7 @@ unsigned int ATI_API_CALL KAS_Spinlock_A |
306 |
+ |
307 |
+ KCL_DEBUG5(FN_FIREGL_KAS,"0x%08X\n", hSpinLock); |
308 |
+ |
309 |
++ preempt_disable(); |
310 |
+ spin_lock_info.routine_type = spinlock_obj->routine_type; |
311 |
+ spin_lock_info.plock = &(spinlock_obj->lock); |
312 |
+ |
313 |
+@@ -5263,6 +5270,7 @@ unsigned int ATI_API_CALL KAS_Spinlock_A |
314 |
+ |
315 |
+ spinlock_obj->acquire_type = spin_lock_info.acquire_type; |
316 |
+ spinlock_obj->flags = spin_lock_info.flags; |
317 |
++ preempt_enable(); |
318 |
+ |
319 |
+ KCL_DEBUG5(FN_FIREGL_KAS,"%d\n", ret); |
320 |
+ return ret; |
321 |
+@@ -6034,6 +6042,8 @@ unsigned int ATI_API_CALL KAS_Interlocke |
322 |
+ |
323 |
+ KCL_DEBUG5(FN_FIREGL_KAS,"0x%08X, 0x%08X, 0x%08X\n", hListHead, hListEntry, phPrevEntry); |
324 |
+ |
325 |
++ preempt_disable(); |
326 |
++ |
327 |
+ /* Protect the operation with spinlock */ |
328 |
+ spin_lock_info.routine_type = listhead_obj->routine_type; |
329 |
+ spin_lock_info.plock = &(listhead_obj->lock); |
330 |
+@@ -6041,6 +6051,7 @@ unsigned int ATI_API_CALL KAS_Interlocke |
331 |
+ if (!kas_spin_lock(&spin_lock_info)) |
332 |
+ { |
333 |
+ KCL_DEBUG_ERROR("Unable to grab list spinlock\n"); |
334 |
++ preempt_enable(); |
335 |
+ return 0; /* No spinlock - no operation */ |
336 |
+ } |
337 |
+ |
338 |
+@@ -6065,6 +6076,7 @@ unsigned int ATI_API_CALL KAS_Interlocke |
339 |
+ spin_unlock_info.flags = spin_lock_info.flags; |
340 |
+ |
341 |
+ ret = kas_spin_unlock(&spin_unlock_info); |
342 |
++ preempt_enable(); |
343 |
+ KCL_DEBUG5(FN_FIREGL_KAS,"%d", ret); |
344 |
+ return ret; |
345 |
+ } |
346 |
+@@ -6153,8 +6165,10 @@ unsigned int ATI_API_CALL KAS_Interlocke |
347 |
+ spin_lock_info.routine_type = listhead_obj->routine_type; |
348 |
+ spin_lock_info.plock = &(listhead_obj->lock); |
349 |
+ |
350 |
++ preempt_disable(); |
351 |
+ if (!kas_spin_lock(&spin_lock_info)) |
352 |
+ { |
353 |
++ preempt_enable(); |
354 |
+ KCL_DEBUG_ERROR("Unable to grab list spinlock"); |
355 |
+ return 0; /* No spinlock - no operation */ |
356 |
+ } |
357 |
+@@ -6178,6 +6192,7 @@ unsigned int ATI_API_CALL KAS_Interlocke |
358 |
+ spin_unlock_info.flags = spin_lock_info.flags; |
359 |
+ |
360 |
+ ret = kas_spin_unlock(&spin_unlock_info); |
361 |
++ preempt_enable(); |
362 |
+ KCL_DEBUG5(FN_FIREGL_KAS,"%d", ret); |
363 |
+ return ret; |
364 |
+ } |
365 |
|
366 |
diff --git a/x11-drivers/ati-drivers/files/15.9-remove-gpl-symbols.patch b/x11-drivers/ati-drivers/files/15.9-remove-gpl-symbols.patch |
367 |
new file mode 100644 |
368 |
index 0000000..51fc6c2 |
369 |
--- /dev/null |
370 |
+++ b/x11-drivers/ati-drivers/files/15.9-remove-gpl-symbols.patch |
371 |
@@ -0,0 +1,74 @@ |
372 |
+--- a/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-09-18 23:57:02.000000000 -0400 |
373 |
++++ b/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-09-18 23:57:11.000000000 -0400 |
374 |
+@@ -136,7 +136,6 @@ |
375 |
+ #include <asm/mman.h> |
376 |
+ #include <asm/uaccess.h> |
377 |
+ #include <asm/processor.h> |
378 |
+-#include <asm/tlbflush.h> // for flush_tlb_page |
379 |
+ #include <asm/cpufeature.h> |
380 |
+ #ifdef CONFIG_MTRR |
381 |
+ #include <asm/mtrr.h> |
382 |
+@@ -251,6 +250,26 @@ |
383 |
+ #define WRITE_CR4(x) write_cr4(x) |
384 |
+ #endif |
385 |
+ |
386 |
++#define __flush_tlb_one(addr) asm volatile("invlpg (%0)" ::"r" (addr) : "memory") |
387 |
++#define __flush_tlb() native_write_cr3(native_read_cr3()) |
388 |
++ |
389 |
++static inline void __flush_tlb_all(void) |
390 |
++{ |
391 |
++ if (cpu_has_pge) |
392 |
++ { |
393 |
++ unsigned long flags, cr4; |
394 |
++ raw_local_irq_save(flags); |
395 |
++ cr4 = native_read_cr4(); |
396 |
++ native_write_cr4(cr4 & ~X86_CR4_PGE); |
397 |
++ native_write_cr4(cr4); |
398 |
++ raw_local_irq_restore(flags); |
399 |
++ } |
400 |
++ else |
401 |
++ { |
402 |
++ __flush_tlb(); |
403 |
++ } |
404 |
++} |
405 |
++ |
406 |
+ // ============================================================ |
407 |
+ /* globals */ |
408 |
+ |
409 |
+@@ -6479,7 +6498,12 @@ static int KCL_fpu_save_init(struct task |
410 |
+ void ATI_API_CALL KCL_fpu_begin(void) |
411 |
+ { |
412 |
+ #if defined(CONFIG_X86_64) || LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0) |
413 |
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0) |
414 |
++ preempt_disable(); |
415 |
++ __kernel_fpu_begin(); |
416 |
++#else |
417 |
+ kernel_fpu_begin(); |
418 |
++#endif |
419 |
+ #else |
420 |
+ #ifdef TS_USEDFPU |
421 |
+ struct thread_info *cur_thread = current_thread_info(); |
422 |
+@@ -6525,7 +6549,12 @@ void ATI_API_CALL KCL_fpu_begin(void) |
423 |
+ */ |
424 |
+ void ATI_API_CALL KCL_fpu_end(void) |
425 |
+ { |
426 |
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,2,0) |
427 |
++ __kernel_fpu_end(); |
428 |
++ preempt_enable(); |
429 |
++#else |
430 |
+ kernel_fpu_end(); |
431 |
++#endif |
432 |
+ } |
433 |
+ |
434 |
+ /** Create new directory entry under "/proc/...." |
435 |
+--- a/common/lib/modules/fglrx/build_mod/kcl_acpi.c 2015-09-19 00:43:35.000000000 -0400 |
436 |
++++ b/common/lib/modules/fglrx/build_mod/kcl_acpi.c 2015-09-19 00:43:48.000000000 -0400 |
437 |
+@@ -868,7 +868,7 @@ void ATI_API_CALL KCL_ACPI_No_Hotplug(vo |
438 |
+ #elif LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0) |
439 |
+ if(pdev) |
440 |
+ { |
441 |
+-#if (UTS_UBUNTU_RELEASE_ABI < 0 && LINUX_VERSION_CODE < KERNEL_VERSION(4,1,3)) || (UTS_UBUNTU_RELEASE_ABI >= 0 && UTS_UBUNTU_RELEASE_ABI < 26 && LINUX_VERSION_CODE <= KERNEL_VERSION(3,19,8)) |
442 |
++#if 0 && (UTS_UBUNTU_RELEASE_ABI < 0 && LINUX_VERSION_CODE < KERNEL_VERSION(4,1,3)) || (UTS_UBUNTU_RELEASE_ABI >= 0 && UTS_UBUNTU_RELEASE_ABI < 26 && LINUX_VERSION_CODE <= KERNEL_VERSION(3,19,8)) |
443 |
+ pci_ignore_hotplug(pdev); |
444 |
+ #else |
445 |
+ pdev->ignore_hotplug = 1; |
446 |
|
447 |
diff --git a/x11-drivers/ati-drivers/files/15.9-sep_printf.patch b/x11-drivers/ati-drivers/files/15.9-sep_printf.patch |
448 |
new file mode 100644 |
449 |
index 0000000..3e4e8d6 |
450 |
--- /dev/null |
451 |
+++ b/x11-drivers/ati-drivers/files/15.9-sep_printf.patch |
452 |
@@ -0,0 +1,11 @@ |
453 |
+--- a/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-09-14 15:14:36.000000000 -0400 |
454 |
++++ b/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-09-14 16:18:58.000000000 -0400 |
455 |
+@@ -649,6 +649,8 @@ static int firegl_major_proc_read(struct |
456 |
+ *eof = 1; |
457 |
+ |
458 |
+ len = snprintf(buf, request, "%d\n", major); |
459 |
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0) |
460 |
++ seq_printf(m, "%d\n", major); |
461 |
+ #else |
462 |
+ len = seq_printf(m, "%d\n", major); |
463 |
+ #endif |