File: 08-4.2.0-build.patch

package info (click to toggle)
fglrx-driver 1:15.9-4~deb8u1~bpo70+1
  • links: PTS, VCS
  • area: non-free
  • in suites: wheezy-backports
  • size: 505,568 kB
  • sloc: ansic: 15,231; xml: 4,141; sh: 2,401; makefile: 425
file content (110 lines) | stat: -rw-r--r-- 3,263 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
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

diff -Naur fglrx-driver-15.9.orig/common/lib/modules/fglrx/build_mod/firegl_public.c fglrx-driver-15.9/common/lib/modules/fglrx/build_mod/firegl_public.c
--- fglrx-driver-15.9.orig/common/lib/modules/fglrx/build_mod/firegl_public.c	2015-09-27 10:54:11.858303746 +0200
+++ fglrx-driver-15.9/common/lib/modules/fglrx/build_mod/firegl_public.c	2015-09-27 10:57:09.055500917 +0200
@@ -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"
@@ -1714,6 +1722,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)                      
@@ -1750,7 +1761,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
@@ -6446,21 +6461,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))
+#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
@@ -6472,8 +6502,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();
@@ -6518,7 +6552,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
 }
 
 /** Create new directory entry under "/proc/...."