[Pkg-fglrx-devel] r1500 - in fglrx-driver/trunk/debian: . patches

Patrick Matthäi pmatthaei at moszumanska.debian.org
Tue Sep 1 08:19:02 UTC 2015


Author: pmatthaei
Date: 2015-09-01 08:19:02 +0000 (Tue, 01 Sep 2015)
New Revision: 1500

Added:
   fglrx-driver/trunk/debian/patches/09-4.2.0-build.fpregs_active.patch
   fglrx-driver/trunk/debian/patches/10-4.2.0-build.copy_xregs_to_kernel.patch
Modified:
   fglrx-driver/trunk/debian/changelog
   fglrx-driver/trunk/debian/patches/series
Log:
* Add Ubuntu patches 08-4.2.0-build, 09-4.2.0-build.fpregs_active and
  10-4.2.0-build.copy_xregs_to_kernel so fglrx may work with Linux 4.2.


Modified: fglrx-driver/trunk/debian/changelog
===================================================================
--- fglrx-driver/trunk/debian/changelog	2015-09-01 08:17:29 UTC (rev 1499)
+++ fglrx-driver/trunk/debian/changelog	2015-09-01 08:19:02 UTC (rev 1500)
@@ -9,6 +9,8 @@
   * Add Ubuntu patch 06-4.0.0-build-2.
   * Add Ubuntu patch 07-4.1.0-build to fix a FTBFS with Linux 4.1.
     Closes: #795222, #795230
+  * Add Ubuntu patches 08-4.2.0-build, 09-4.2.0-build.fpregs_active and
+    10-4.2.0-build.copy_xregs_to_kernel so fglrx may work with Linux 4.2.
 
  -- Andreas Beckmann <anbe at debian.org>  Tue, 11 Aug 2015 23:48:01 +0200
 

Added: fglrx-driver/trunk/debian/patches/09-4.2.0-build.fpregs_active.patch
===================================================================
--- fglrx-driver/trunk/debian/patches/09-4.2.0-build.fpregs_active.patch	                        (rev 0)
+++ fglrx-driver/trunk/debian/patches/09-4.2.0-build.fpregs_active.patch	2015-09-01 08:19:02 UTC (rev 1500)
@@ -0,0 +1,17 @@
+# Patch for 4.2 from Ubuntu.
+
+diff -Naur fglrx-driver-15.7.orig/common/lib/modules/fglrx/build_mod/firegl_public.c fglrx-driver-15.7/common/lib/modules/fglrx/build_mod/firegl_public.c
+--- fglrx-driver-15.7.orig/common/lib/modules/fglrx/build_mod/firegl_public.c	2015-09-01 10:05:46.703213696 +0200
++++ fglrx-driver-15.7/common/lib/modules/fglrx/build_mod/firegl_public.c	2015-09-01 10:06:10.839141228 +0200
+@@ -6541,7 +6541,11 @@
+     /* 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.fpregs_active)
++#else
+     if (cur_task->thread.fpu.has_fpu)
++#endif
+ #else
+     if (cur_task->thread.has_fpu)
+ #endif

Added: fglrx-driver/trunk/debian/patches/10-4.2.0-build.copy_xregs_to_kernel.patch
===================================================================
--- fglrx-driver/trunk/debian/patches/10-4.2.0-build.copy_xregs_to_kernel.patch	                        (rev 0)
+++ fglrx-driver/trunk/debian/patches/10-4.2.0-build.copy_xregs_to_kernel.patch	2015-09-01 08:19:02 UTC (rev 1500)
@@ -0,0 +1,63 @@
+# Second patch from Ubuntu for Linux 4.2.
+
+diff -Naur fglrx-driver-15.7.orig/common/lib/modules/fglrx/build_mod/firegl_public.c fglrx-driver-15.7/common/lib/modules/fglrx/build_mod/firegl_public.c
+--- fglrx-driver-15.7.orig/common/lib/modules/fglrx/build_mod/firegl_public.c	2015-09-01 10:07:50.874839878 +0200
++++ fglrx-driver-15.7/common/lib/modules/fglrx/build_mod/firegl_public.c	2015-09-01 10:09:05.130613738 +0200
+@@ -6456,6 +6456,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
+@@ -6475,7 +6517,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;

Modified: fglrx-driver/trunk/debian/patches/series
===================================================================
--- fglrx-driver/trunk/debian/patches/series	2015-09-01 08:17:29 UTC (rev 1499)
+++ fglrx-driver/trunk/debian/patches/series	2015-09-01 08:19:02 UTC (rev 1500)
@@ -6,3 +6,5 @@
 06-4.0.0-build-2.patch
 07-4.1.0-build.patch
 08-4.2.0-build.patch
+09-4.2.0-build.fpregs_active.patch
+10-4.2.0-build.copy_xregs_to_kernel.patch




More information about the Pkg-fglrx-devel mailing list