summary refs log tree commit diff
path: root/pkgs/os-specific/linux/ati-drivers/patches
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/os-specific/linux/ati-drivers/patches')
-rw-r--r--pkgs/os-specific/linux/ati-drivers/patches/15.12-xstate-fp.patch26
-rw-r--r--pkgs/os-specific/linux/ati-drivers/patches/15.9-kcl_str.patch14
-rw-r--r--pkgs/os-specific/linux/ati-drivers/patches/15.9-mtrr.patch27
-rw-r--r--pkgs/os-specific/linux/ati-drivers/patches/15.9-preempt.patch103
-rw-r--r--pkgs/os-specific/linux/ati-drivers/patches/15.9-sep_printf.patch11
-rw-r--r--pkgs/os-specific/linux/ati-drivers/patches/patch-samples.patch26
6 files changed, 207 insertions, 0 deletions
diff --git a/pkgs/os-specific/linux/ati-drivers/patches/15.12-xstate-fp.patch b/pkgs/os-specific/linux/ati-drivers/patches/15.12-xstate-fp.patch
new file mode 100644
index 00000000000..22e43fc0c7b
--- /dev/null
+++ b/pkgs/os-specific/linux/ati-drivers/patches/15.12-xstate-fp.patch
@@ -0,0 +1,26 @@
+From: Krzysztof Kolasa <kkolasa@winsoft.pl>
+Date: Thu, 26 Nov 2015 14:28:46 +0100
+Subject: [PATCH] Patch for kernel 4.4.0-rc2
+
+constant change of name XSTATE_XP to name XFEATURE_MASK_FP
+---
+ firegl_public.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/common/lib/modules/fglrx/build_mod/firegl_public.c b/common/lib/modules/fglrx/build_mod/firegl_public.c
+index 3626c7b..f071d42 100644
+--- a/common/lib/modules/fglrx/build_mod/firegl_public.c
++++ b/common/lib/modules/fglrx/build_mod//firegl_public.c
+@@ -6463,7 +6463,11 @@ static int KCL_fpu_save_init(struct task_struct *tsk)
+       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))
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,4,0)
++      if (!(fpu->state.xsave.header.xfeatures & XFEATURE_MASK_FP))
++#else
++      if (!(fpu->state.xsave.header.xfeatures & XSTATE_FP))
++#endif
+ #endif
+          return 1;
+    } else if (static_cpu_has(X86_FEATURE_FXSR)) {
diff --git a/pkgs/os-specific/linux/ati-drivers/patches/15.9-kcl_str.patch b/pkgs/os-specific/linux/ati-drivers/patches/15.9-kcl_str.patch
new file mode 100644
index 00000000000..20c3bc8a169
--- /dev/null
+++ b/pkgs/os-specific/linux/ati-drivers/patches/15.9-kcl_str.patch
@@ -0,0 +1,14 @@
+--- a/common/lib/modules/fglrx/build_mod/kcl_str.c	2015-09-13 13:47:30.000000000 -0400
++++ b/common/lib/modules/fglrx/build_mod/kcl_str.c	2015-09-13 13:49:42.000000000 -0400
+@@ -169,7 +169,11 @@ int ATI_API_CALL KCL_STR_Strnicmp(const
+                                   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/pkgs/os-specific/linux/ati-drivers/patches/15.9-mtrr.patch b/pkgs/os-specific/linux/ati-drivers/patches/15.9-mtrr.patch
new file mode 100644
index 00000000000..bdf70b4ccdc
--- /dev/null
+++ b/pkgs/os-specific/linux/ati-drivers/patches/15.9-mtrr.patch
@@ -0,0 +1,27 @@
+--- a/common/lib/modules/fglrx/build_mod/firegl_public.c	2015-09-19 23:43:22.000000000 -0400
++++ b/common/lib/modules/fglrx/build_mod/firegl_public.c	2015-09-19 23:52:07.000000000 -0400
+@@ -3442,7 +3442,11 @@ int ATI_API_CALL KCL_MEM_MTRR_Support(vo
+ 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 */
+@@ -3451,7 +3455,12 @@ int ATI_API_CALL KCL_MEM_MTRR_AddRegionW
+ 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/pkgs/os-specific/linux/ati-drivers/patches/15.9-preempt.patch b/pkgs/os-specific/linux/ati-drivers/patches/15.9-preempt.patch
new file mode 100644
index 00000000000..c6598835133
--- /dev/null
+++ b/pkgs/os-specific/linux/ati-drivers/patches/15.9-preempt.patch
@@ -0,0 +1,103 @@
+--- a/common/lib/modules/fglrx/build_mod/firegl_public.c	2015-08-30 17:36:02.000000000 -0400
++++ b/common/lib/modules/fglrx/build_mod/firegl_public.c	2015-08-30 17:39:36.000000000 -0400
+@@ -21,6 +21,8 @@
+ !!! since it requires changes to linux/init/main.c.
+ #endif /* !MODULE */
+ 
++#include <linux/preempt.h>
++
+ // ============================================================
+ #include <linux/version.h>
+ 
+@@ -4997,7 +4999,9 @@ static unsigned int kas_spin_unlock(kas_
+ unsigned long ATI_API_CALL KAS_GetExecutionLevel(void)
+ {
+     unsigned long ret;
++    preempt_disable();
+     ret = kas_GetExecutionLevel();
++    preempt_enable();
+     return ret;
+ }
+ 
+@@ -5022,8 +5026,10 @@ unsigned int ATI_API_CALL KAS_Ih_Execute
+     KCL_DEBUG5(FN_FIREGL_KAS,"0x%08X, 0x%08X\n", ih_routine, ih_context);
+ 
+     //Prevent simultaneous entry on some SMP systems.
++    preempt_disable();
+     if (test_and_set_bit(0, (void *)&(kasContext.in_interrupts[smp_processor_id()])))
+     {
++    	preempt_enable();
+         KCL_DEBUG1(FN_FIREGL_KAS, "The processor is handling the interrupt\n");
+         return IRQ_NONE;
+     }
+@@ -5036,9 +5042,9 @@ unsigned int ATI_API_CALL KAS_Ih_Execute
+ 
+     kasSetExecutionLevel(orig_level);
+     spin_unlock(&kasContext.lock_ih); 
+-
+     clear_bit(0, (void *)&(kasContext.in_interrupts[smp_processor_id()]));
+     KCL_DEBUG5(FN_FIREGL_KAS,"%d\n", ret);
++    preempt_enable();
+ 
+     return ret;
+ }
+@@ -5256,6 +5262,7 @@ unsigned int ATI_API_CALL KAS_Spinlock_A
+ 
+     KCL_DEBUG5(FN_FIREGL_KAS,"0x%08X\n", hSpinLock);
+ 
++    preempt_disable();
+     spin_lock_info.routine_type = spinlock_obj->routine_type;
+     spin_lock_info.plock = &(spinlock_obj->lock);
+ 
+@@ -5263,6 +5270,7 @@ unsigned int ATI_API_CALL KAS_Spinlock_A
+ 
+     spinlock_obj->acquire_type = spin_lock_info.acquire_type;
+     spinlock_obj->flags = spin_lock_info.flags;
++    preempt_enable();
+ 
+     KCL_DEBUG5(FN_FIREGL_KAS,"%d\n", ret);
+     return ret;
+@@ -6034,6 +6042,8 @@ unsigned int ATI_API_CALL KAS_Interlocke
+ 
+     KCL_DEBUG5(FN_FIREGL_KAS,"0x%08X, 0x%08X, 0x%08X\n", hListHead, hListEntry, phPrevEntry);
+ 
++    preempt_disable();
++
+     /* Protect the operation with spinlock */
+     spin_lock_info.routine_type = listhead_obj->routine_type;
+     spin_lock_info.plock = &(listhead_obj->lock);
+@@ -6041,6 +6051,7 @@ unsigned int ATI_API_CALL KAS_Interlocke
+     if (!kas_spin_lock(&spin_lock_info))
+     {
+         KCL_DEBUG_ERROR("Unable to grab list spinlock\n");
++	preempt_enable();
+         return 0; /* No spinlock - no operation */
+     }
+ 
+@@ -6065,6 +6076,7 @@ unsigned int ATI_API_CALL KAS_Interlocke
+     spin_unlock_info.flags = spin_lock_info.flags;
+ 
+     ret = kas_spin_unlock(&spin_unlock_info);
++    preempt_enable();
+     KCL_DEBUG5(FN_FIREGL_KAS,"%d", ret);
+     return ret;
+ }
+@@ -6153,8 +6165,10 @@ unsigned int ATI_API_CALL KAS_Interlocke
+     spin_lock_info.routine_type = listhead_obj->routine_type;
+     spin_lock_info.plock = &(listhead_obj->lock);
+ 
++    preempt_disable();
+     if (!kas_spin_lock(&spin_lock_info))
+     {
++        preempt_enable();
+         KCL_DEBUG_ERROR("Unable to grab list spinlock");
+         return 0; /* No spinlock - no operation */
+     }
+@@ -6178,6 +6192,7 @@ unsigned int ATI_API_CALL KAS_Interlocke
+     spin_unlock_info.flags = spin_lock_info.flags;
+ 
+     ret = kas_spin_unlock(&spin_unlock_info);
++    preempt_enable();
+     KCL_DEBUG5(FN_FIREGL_KAS,"%d", ret);
+     return ret;
+ }
diff --git a/pkgs/os-specific/linux/ati-drivers/patches/15.9-sep_printf.patch b/pkgs/os-specific/linux/ati-drivers/patches/15.9-sep_printf.patch
new file mode 100644
index 00000000000..3e4e8d6499a
--- /dev/null
+++ b/pkgs/os-specific/linux/ati-drivers/patches/15.9-sep_printf.patch
@@ -0,0 +1,11 @@
+--- a/common/lib/modules/fglrx/build_mod/firegl_public.c	2015-09-14 15:14:36.000000000 -0400
++++ b/common/lib/modules/fglrx/build_mod/firegl_public.c	2015-09-14 16:18:58.000000000 -0400
+@@ -649,6 +649,8 @@ static int firegl_major_proc_read(struct
+     *eof = 1;
+ 
+     len = snprintf(buf, request, "%d\n", major);
++#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)
++    seq_printf(m, "%d\n", major);
+ #else
+     len = seq_printf(m, "%d\n", major);
+ #endif
diff --git a/pkgs/os-specific/linux/ati-drivers/patches/patch-samples.patch b/pkgs/os-specific/linux/ati-drivers/patches/patch-samples.patch
new file mode 100644
index 00000000000..8bd24b1d022
--- /dev/null
+++ b/pkgs/os-specific/linux/ati-drivers/patches/patch-samples.patch
@@ -0,0 +1,26 @@
+diff --git a/samples/fgl_glxgears/fgl_glxgears.c b/samples/fgl_glxgears/fgl_glxgears.c
+index 6c8e313..2b8d035 100644
+--- a/samples/fgl_glxgears/fgl_glxgears.c
++++ b/samples/fgl_glxgears/fgl_glxgears.c
+@@ -1096,8 +1096,6 @@ static void event_loop(void)
+                   view_rotx -= 5.0;
+                }
+                else {
+-                  r = XLookupString(&event.xkey, buffer, sizeof(buffer),
+-                                    NULL, NULL);
+                   if (buffer[0] == 27) {
+                      /* escape */
+                      return;
+
+
+diff -Nur a/samples/fgl_glxgears/fgl_glxgears.c b/samples/fgl_glxgears/fgl_glxgears.c
+--- a/samples/fgl_glxgears/fgl_glxgears.c	2012-08-29 09:59:03.000000000 +0300
++++ b/samples/fgl_glxgears/fgl_glxgears.c	2013-09-07 09:26:11.034723135 +0300
+@@ -78,7 +78,6 @@
+ #endif // _WIN32
+ 
+ #define INT_PTR ptrdiff_t
+-#include <GL/glATI.h>
+ 
+ #ifdef _WIN32
+ #include <GL/wglATI.h>