summarylogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.SRCINFO23
-rw-r--r--4.3-gentoo-mtrr.patch27
-rw-r--r--4.3-kolasa-seq_printf.patch16
-rw-r--r--PKGBUILD50
-rw-r--r--catalyst-total.install8
-rwxr-xr-xcatalyst_build_module2
-rw-r--r--cold-fglrx-3.14-current_euid.patch14
-rw-r--r--fglrx_3.17rc6-no_hotplug.patch29
-rw-r--r--lano1106_fglrx-13.8_proc.patch50
-rw-r--r--ubuntu_buildfix_kernel_4.2-build.copy_xregs_to_kernel.patch60
10 files changed, 142 insertions, 137 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 81d7f9316032..fe345d30b0c4 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,15 +1,15 @@
pkgbase = catalyst-total
pkgdesc = AMD/ATI Catalyst drivers for linux. catalyst-hook + catalyst-utils + lib32-catalyst-utils + experimental powerXpress suppport. Radeons HD 2 3 4 xxx ARE NOT SUPPORTED
pkgver = 15.9
- pkgrel = 2
+ pkgrel = 6
url = http://www.amd.com
install = catalyst-total.install
arch = i686
arch = x86_64
license = custom
- depends = linux-lts>=3.0
- depends = linux-lts<4.2
- depends = linux-lts-headers
+ depends = linux>=3.0
+ depends = linux<4.4
+ depends = linux-headers
depends = xorg-server>=1.7.0
depends = xorg-server<1.18.0
depends = libxrandr
@@ -23,6 +23,7 @@ pkgbase = catalyst-total
depends = patch
depends = libxinerama
depends = mesa>=10.1.0-4
+ depends = gcc49
optdepends = qt4: to run ATi Catalyst Control Center (amdcccle)
optdepends = libxxf86vm: to run ATi Catalyst Control Center (amdcccle)
optdepends = opencl-headers: headers necessary for OpenCL development
@@ -76,17 +77,17 @@ pkgbase = catalyst-total
source = temp-links-catalyst.service
source = lano1106_fglrx_intel_iommu.patch
source = lano1106_kcl_agp_13_4.patch
- source = lano1106_fglrx-13.8_proc.patch
- source = cold-fglrx-3.14-current_euid.patch
source = fglrx_gpl_symbol.patch
- source = fglrx_3.17rc6-no_hotplug.patch
source = ubuntu_buildfix_kernel_4.0.patch
source = ubuntu_buildfix_kernel_4.1.patch
source = ubuntu_buildfix_kernel_4.2.patch
source = 4.2-fglrx-has_fpu.patch
source = 4.2-kolasa-fpu_save_init.patch
+ source = ubuntu_buildfix_kernel_4.2-build.copy_xregs_to_kernel.patch
+ source = 4.3-kolasa-seq_printf.patch
+ source = 4.3-gentoo-mtrr.patch
md5sums = d2de2df6946b452c266a3c892e6e46ff
- md5sums = 601d9c756571dd79d26944e54827631e
+ md5sums = f3aaed0084725304cf607f6915e4bfee
md5sums = af7fb8ee4fc96fd54c5b483e33dc71c4
md5sums = bdafe749e046bfddee2d1c5e90eabd83
md5sums = 9d9ea496eadf7e883d56723d65e96edf
@@ -107,15 +108,15 @@ pkgbase = catalyst-total
md5sums = 2c22bb4d4f828cb8b024f670c1ae7e45
md5sums = 5184b94a2a40216a67996999481dd9ee
md5sums = c5156eddf81c8a1719b160d05a2e8d67
- md5sums = 2ab4837233de42332753882445373d7b
- md5sums = ba33b6ef10896d3e1b5e4cd96390b771
md5sums = ef97fc080ce7e5a275fe0c372bc2a418
- md5sums = 67a22f624bae95a76638ce269392cb01
md5sums = 880d5e59554cda382f74206c202942be
md5sums = 982451bcc1fa1ee3da53ffa481d65581
md5sums = 88832af8d6769aa51fa9b266a74394e0
md5sums = ed7748a593d6b894269f8c7856b7ae50
md5sums = dd51495a1d8f2d1042f04a783bf01e08
+ md5sums = 2f7d42fde403a1b4a22e5db8de738d0f
+ md5sums = 0e0666e95d1d590a7a83192805679485
+ md5sums = 98828e3eeaec2b3795e584883cc1b746
pkgname = catalyst-total
diff --git a/4.3-gentoo-mtrr.patch b/4.3-gentoo-mtrr.patch
new file mode 100644
index 000000000000..86d7ffc3cc2b
--- /dev/null
+++ b/4.3-gentoo-mtrr.patch
@@ -0,0 +1,27 @@
+--- 15.9/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-09-09 00:57:14.000000000 +0200
++++ 15.9/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-11-03 19:00:09.121884973 +0100
+@@ -3412,7 +3412,11 @@
+ 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 */
+@@ -3421,7 +3425,12 @@
+ 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/4.3-kolasa-seq_printf.patch b/4.3-kolasa-seq_printf.patch
new file mode 100644
index 000000000000..6cd08a93acad
--- /dev/null
+++ b/4.3-kolasa-seq_printf.patch
@@ -0,0 +1,16 @@
+--- 15.9/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-09-09 00:57:14.000000000 +0200
++++ 15.9b/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-11-02 21:02:06.124639919 +0100
+@@ -623,8 +623,13 @@
+
+ len = snprintf(buf, request, "%d\n", major);
+ #else
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0)
++ seq_printf(m, "%d\n", major);
++ len = 0;
++#else
+ len = seq_printf(m, "%d\n", major);
+ #endif
++#endif
+
+ KCL_DEBUG1(FN_FIREGL_PROC, "return len=%i\n",len);
+
diff --git a/PKGBUILD b/PKGBUILD
index 3af8887aa408..4a715c8af86d 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -20,26 +20,27 @@
# Contributor: solar (authatieventsd' patch s/-1/255)
# Contributor: Cold (current_euid patch)
# Contributor: ubuntu (parts of 4.0, 4.1 and 4.2 kernel patches)
-# Contributor: kolasa (part of 4.2 kernel patches)
+# Contributor: kolasa (parts of 4.2 and 4.3 kernel patches)
+# Contributor: gentoo (part of 4.3 kernel patches)
# PKGEXT='.pkg.tar.gz' # imho time to pack this pkg into tar.xz is too long, unfortunatelly yaourt got problems when ext is different from .pkg.tar.xz - V
pkgname=catalyst-total
pkgver=15.9
-pkgrel=2
+pkgrel=6
+# _betano=1.0
_amdver=15.201.1151
pkgdesc="AMD/ATI Catalyst drivers for linux. catalyst-hook + catalyst-utils + lib32-catalyst-utils + experimental powerXpress suppport. Radeons HD 2 3 4 xxx ARE NOT SUPPORTED"
arch=('i686' 'x86_64')
url="http://www.amd.com"
license=('custom')
options=('staticlibs' 'libtool' '!strip' '!upx')
-depends=('linux-lts>=3.0' 'linux-lts<4.2' 'linux-lts-headers' 'xorg-server>=1.7.0' 'xorg-server<1.18.0' 'libxrandr' 'libsm' 'fontconfig' 'libxcursor' 'libxi' 'gcc-libs' 'gcc>4.0.0' 'make' 'patch' 'libxinerama' 'mesa>=10.1.0-4')
+depends=('linux>=3.0' 'linux<4.4' 'linux-headers' 'xorg-server>=1.7.0' 'xorg-server<1.18.0' 'libxrandr' 'libsm' 'fontconfig' 'libxcursor' 'libxi' 'gcc-libs' 'gcc>4.0.0' 'make' 'patch' 'libxinerama' 'mesa>=10.1.0-4' 'gcc49')
optdepends=('qt4: to run ATi Catalyst Control Center (amdcccle)'
'libxxf86vm: to run ATi Catalyst Control Center (amdcccle)'
'opencl-headers: headers necessary for OpenCL development'
'acpid: acpi event support / atieventsd'
'procps-ng: brings pgrep used in acpi event support')
-# 'linux-lts-headers: to build the fglrx module for the linux-lts kernel')
conflicts=('libgl' 'catalyst' 'catalyst-daemon' 'catalyst-generator' 'catalyst-hook' 'catalyst-utils' 'libcl' 'catalyst-dkms' 'mesa-libgl' 'mesa-libgl-git')
provides=('libgl' "libatical=${pkgver}" "catalyst=${pkgver}" "catalyst-utils=${pkgver}" "catalyst-hook=${pkgver}" "catalyst-libgl=${pkgver}" "opencl-catalyst=${pkgver}" 'libcl' 'dri' 'libtxc_dxtn' 'mesa-libgl' 'mesa-libgl-git')
@@ -58,13 +59,15 @@ fi
install=${pkgname}.install
-url_ref="http://support.amd.com/en-us/download/desktop?os=Linux+x86"
+url_ref="http://support.amd.com/en-us/kb-articles/Pages/latest-linux-beta-driver.aspx"
DLAGENTS="http::/usr/bin/curl --referer ${url_ref} -o %o %u"
source=(
# http://www2.ati.com/drivers/beta/amd-catalyst-${pkgver}-beta-v${_betano}-linux-x86.x86_64.run.zip
# http://www2.ati.com/drivers/linux/amd-catalyst-${pkgver}-linux-x86.x86_64.zip
# http://www2.ati.com/drivers/linux/amd-catalyst-${pkgver/./-}-linux-x86-x86-64.zip
+# http://www2.ati.com/drivers/linux/amd-catalyst-omega-14.12-linux-run-installers.zip
+# http://www2.ati.com/drivers/linux/amd-driver-installer-${_amdver}-x86.x86_64.zip
http://www2.ati.com/drivers/linux/amd-catalyst-${pkgver}-linux-installer-${_amdver}-x86.x86_64.zip
catalyst_build_module
lib32-catalyst.sh
@@ -87,18 +90,18 @@ source=(
temp-links-catalyst.service
lano1106_fglrx_intel_iommu.patch
lano1106_kcl_agp_13_4.patch
- lano1106_fglrx-13.8_proc.patch
- cold-fglrx-3.14-current_euid.patch
fglrx_gpl_symbol.patch
- fglrx_3.17rc6-no_hotplug.patch
ubuntu_buildfix_kernel_4.0.patch
ubuntu_buildfix_kernel_4.1.patch
ubuntu_buildfix_kernel_4.2.patch
4.2-fglrx-has_fpu.patch
- 4.2-kolasa-fpu_save_init.patch)
+ 4.2-kolasa-fpu_save_init.patch
+ ubuntu_buildfix_kernel_4.2-build.copy_xregs_to_kernel.patch
+ 4.3-kolasa-seq_printf.patch
+ 4.3-gentoo-mtrr.patch)
md5sums=('d2de2df6946b452c266a3c892e6e46ff'
- '601d9c756571dd79d26944e54827631e'
+ 'f3aaed0084725304cf607f6915e4bfee'
'af7fb8ee4fc96fd54c5b483e33dc71c4'
'bdafe749e046bfddee2d1c5e90eabd83'
'9d9ea496eadf7e883d56723d65e96edf'
@@ -119,26 +122,24 @@ md5sums=('d2de2df6946b452c266a3c892e6e46ff'
'2c22bb4d4f828cb8b024f670c1ae7e45'
'5184b94a2a40216a67996999481dd9ee'
'c5156eddf81c8a1719b160d05a2e8d67'
- '2ab4837233de42332753882445373d7b'
- 'ba33b6ef10896d3e1b5e4cd96390b771'
'ef97fc080ce7e5a275fe0c372bc2a418'
- '67a22f624bae95a76638ce269392cb01'
'880d5e59554cda382f74206c202942be'
'982451bcc1fa1ee3da53ffa481d65581'
'88832af8d6769aa51fa9b266a74394e0'
'ed7748a593d6b894269f8c7856b7ae50'
- 'dd51495a1d8f2d1042f04a783bf01e08')
-
+ 'dd51495a1d8f2d1042f04a783bf01e08'
+ '2f7d42fde403a1b4a22e5db8de738d0f'
+ '0e0666e95d1d590a7a83192805679485'
+ '98828e3eeaec2b3795e584883cc1b746')
build() {
## Unpack archive
-# /bin/sh ./fglrx-${_amdver}/amd-driver-installer-${_amdver}-x86.x86_64.run --extract archive_files
/bin/sh ./AMD-Catalyst-${pkgver}-Linux-installer-${_amdver}-x86.x86_64.run --extract archive_files
-#mkdir common
-#mv etc lib usr common
-#mkdir archive_files
-#mv arch common xpic xpic_64a archive_files
+# mkdir common
+# mv etc lib usr common
+# mkdir archive_files
+# mv arch common xpic xpic_64a archive_files
}
package() {
@@ -277,6 +278,7 @@ package() {
install -m755 ${srcdir}/catalyst.sh ${pkgdir}/etc/profile.d
# License
+# install -m644 ${srcdir}/archive_files/LICENSE.TXT ${pkgdir}/usr/share/licenses/${pkgname}
install -m644 ${srcdir}/archive_files/LICENSE.TXT ${pkgdir}/usr/share/licenses/${pkgname}
install -m644 ${srcdir}/archive_files/common/usr/share/doc/amdcccle/ccc_copyrights.txt \
${pkgdir}/usr/share/licenses/${pkgname}/amdcccle_copyrights.txt
@@ -310,17 +312,17 @@ package() {
patch -Np1 -i ../makefile_compat.patch
patch -Np1 -i ../lano1106_fglrx_intel_iommu.patch
patch -Np1 -i ../lano1106_kcl_agp_13_4.patch
-# patch -Np1 -i ../lano1106_fglrx-13.8_proc.patch
-# patch -Np1 -i ../cold-fglrx-3.14-current_euid.patch
-# patch -Np1 -i ../fglrx_3.17rc6-no_hotplug.patch
# test "${CARCH}" = "i686" && patch -Np1 -i ../fglrx_gpl_symbol.patch
# since 3.19 not only i686 needs gpl symbol - V
patch -Np1 -i ../fglrx_gpl_symbol.patch
patch -Np1 -i ../ubuntu_buildfix_kernel_4.0.patch
patch -Np1 -i ../ubuntu_buildfix_kernel_4.1.patch
- patch -Np1 -i ../ubuntu_buildfix_kernel_4.2.patch #three 4.2 patches left for testing purposes, use simultaneously - V
+ patch -Np1 -i ../ubuntu_buildfix_kernel_4.2.patch
patch -Np1 -i ../4.2-fglrx-has_fpu.patch
patch -Np1 -i ../4.2-kolasa-fpu_save_init.patch
+ patch -Np1 -i ../ubuntu_buildfix_kernel_4.2-build.copy_xregs_to_kernel.patch
+ patch -Np1 -i ../4.3-kolasa-seq_printf.patch
+ patch -Np1 -i ../4.3-gentoo-mtrr.patch
# Prepare modules source files
_archdir=x86_64
diff --git a/catalyst-total.install b/catalyst-total.install
index 4f8248167902..8386887d649c 100644
--- a/catalyst-total.install
+++ b/catalyst-total.install
@@ -35,14 +35,6 @@ whisperer(){
echo "Using uvesafb is a workaround:"
echo "https://wiki.archlinux.org/index.php/uvesafb"
echo -e "\e[1;31m----------------------------------------------------------------\e[0m"
- echo -e "\e[1;31m--------------------- NO 4.2 KERNEL SUPPORT---------------------\e[0m"
- echo "catalyst doesn't support linux kernels >= 4.2"
- echo "please configure bootloader to use proper kernel"
- echo "like linux-lts in example"
- echo ""
- echo "sleeping now for 5 seconds as this is important..."
- echo -e "\e[1;31m----------------------------------------------------------------\e[0m"
- sleep 5
}
bug_whisper(){
diff --git a/catalyst_build_module b/catalyst_build_module
index 02d75f9e4c4a..0afc3130c19a 100755
--- a/catalyst_build_module
+++ b/catalyst_build_module
@@ -35,7 +35,7 @@ install_module(){
## Compile module using _ati_check variables
CFLAGS_MODULE="-DMODULE -DATI -DFGL -DPAGE_ATTR_FIX=$PAGE_ATTR_FIX -DCOMPAT_ALLOC_USER_SPACE=$COMPAT_ALLOC_USER_SPACE $def_smp $def_modversions"
- make -C /usr/lib/modules/${kernver}/build SUBDIRS="`pwd`" ARCH=${arch} \
+ make CC=gcc-4.9 -C /usr/lib/modules/${kernver}/build SUBDIRS="`pwd`" ARCH=${arch} \
MODFLAGS="$CFLAGS_MODULE" \
CFLAGS_MODULE="$CFLAGS_MODULE" \
PAGE_ATTR_FIX=$PAGE_ATTR_FIX COMPAT_ALLOC_USER_SPACE=$COMPAT_ALLOC_USER_SPACE modules || return 1
diff --git a/cold-fglrx-3.14-current_euid.patch b/cold-fglrx-3.14-current_euid.patch
deleted file mode 100644
index 77bfe2565492..000000000000
--- a/cold-fglrx-3.14-current_euid.patch
+++ /dev/null
@@ -1,14 +0,0 @@
---- 14.1/common/lib/modules/fglrx/build_mod/firegl_public.c 2014-02-23 19:26:52.215995002 +0100
-+++ 14.1/common/lib/modules/fglrx/build_mod/firegl_public.c 2014-02-23 19:27:59.320999596 +0100
-@@ -1761,7 +1761,11 @@
- #else
-
- #ifdef current_euid
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,14,0)
-+ return __kuid_val(current_euid());
-+#else
- return current_euid();
-+#endif
- #else
- return current->euid;
- #endif
diff --git a/fglrx_3.17rc6-no_hotplug.patch b/fglrx_3.17rc6-no_hotplug.patch
deleted file mode 100644
index 7fbe1a25064c..000000000000
--- a/fglrx_3.17rc6-no_hotplug.patch
+++ /dev/null
@@ -1,29 +0,0 @@
-diff -uNr 14.9/common/lib/modules/fglrx/build_mod/firegl_public.c 14.9/common/lib/modules/fglrx/build_mod/firegl_public.c
---- 14.9/common/lib/modules/fglrx/build_mod/firegl_public.c 2014-09-09 16:10:17.000000000 +0200
-+++ 14.9/common/lib/modules/fglrx/build_mod/firegl_public.c 2014-09-26 19:01:44.000000000 +0200
-@@ -1093,6 +1093,9 @@
- // directly here to allow suspend/resume without X server start.
- firegl_pci_save_state((KCL_PCI_DevHandle)pdev, privdev);
- pci_disable_device(pdev);
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3,17,0)
-+ pci_ignore_hotplug(pdev);
-+#endif
- PMSG_EVENT(pdev->dev.power.power_state) = state;
- }
- else
-diff -uNr 14.9/common/lib/modules/fglrx/build_mod/kcl_acpi.c 14.9/common/lib/modules/fglrx/build_mod/kcl_acpi.c
---- 14.9/common/lib/modules/fglrx/build_mod/kcl_acpi.c 2014-09-09 16:10:17.000000000 +0200
-+++ 14.9/common/lib/modules/fglrx/build_mod/kcl_acpi.c 2014-09-26 18:57:27.000000000 +0200
-@@ -840,10 +840,12 @@
- if(tdev != NULL)
- {
- device = (acpi_device_adr(tdev) >> 16) & 0xffff;
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,17,0)
- if(PCI_SLOT(pdev->devfn) == device)
- {
- tdev->flags.no_hotplug = true;
- }
-+#endif
- }
- #endif
- return 0;
diff --git a/lano1106_fglrx-13.8_proc.patch b/lano1106_fglrx-13.8_proc.patch
deleted file mode 100644
index e2ec7c30d0d0..000000000000
--- a/lano1106_fglrx-13.8_proc.patch
+++ /dev/null
@@ -1,50 +0,0 @@
---- 13.8/common/lib/modules/fglrx/build_mod/firegl_public.c 2013-09-26 00:59:28.292596334 -0400
-+++ 13.8/common/lib/modules/fglrx/build_mod/firegl_public.c 2013-09-26 01:02:35.036252455 -0400
-@@ -821,7 +821,7 @@ static struct proc_dir_entry *firegl_pro
- KCL_DEBUG1(FN_FIREGL_PROC, "minor %d, proc_list 0x%08lx\n", minor, (unsigned long)proc_list);
- if (!minor)
- {
-- root = KCL_create_proc_dir(NULL, "ati", S_IRUGO|S_IXUGO);
-+ root = KCL_create_proc_dir(NULL, "ati", 0);
- }
-
- if (!root)
-@@ -835,7 +835,7 @@ static struct proc_dir_entry *firegl_pro
- // Global major debice number entry and Global debug entry
- while (globallist->rp || globallist->fops)
- {
-- ent = KCL_create_proc_entry(root, globallist->name, S_IFREG|S_IRUGO, globallist->fops, globallist->rp, globallist->wp, dev);
-+ ent = KCL_create_proc_entry(root, globallist->name, 0, globallist->fops, globallist->rp, globallist->wp, dev);
- if (!ent)
- {
- KCL_remove_proc_dir_entry(NULL, "ati");
-@@ -847,7 +847,7 @@ static struct proc_dir_entry *firegl_pro
- }
-
- sprintf(name, "%d", minor);
-- *dev_root = KCL_create_proc_dir(root, name, S_IRUGO|S_IXUGO);
-+ *dev_root = KCL_create_proc_dir(root, name, 0);
- if (!*dev_root) {
- KCL_remove_proc_dir_entry(root, "major");
- KCL_remove_proc_dir_entry(NULL, "ati");
-@@ -857,7 +857,7 @@ static struct proc_dir_entry *firegl_pro
-
- while (list->rp || list->fops)
- {
-- ent = KCL_create_proc_entry(*dev_root, list->name, S_IFREG|S_IRUGO, list->fops, list->rp, list->wp,
-+ ent = KCL_create_proc_entry(*dev_root, list->name, 0, list->fops, list->rp, list->wp,
- ((dev->pubdev.signature == FGL_DEVICE_SIGNATURE)? firegl_find_device(minor) : (dev)));
- if (!ent)
- {
-@@ -6358,9 +6358,9 @@ void * KCL_create_proc_dir(void *root_di
- dir = create_proc_entry(name, S_IFDIR | access, (struct proc_dir_entry *)root_dir);
- #else
- if (root_dir == NULL)
-- dir = proc_mkdir_mode(name, S_IFDIR | access, NULL);
-+ dir = proc_mkdir_mode(name, access, NULL);
- else
-- dir = proc_mkdir_mode(name, S_IFDIR | access, (struct proc_dir_entry *)root_dir);
-+ dir = proc_mkdir_mode(name, access, (struct proc_dir_entry *)root_dir);
- #endif
-
- return dir;
diff --git a/ubuntu_buildfix_kernel_4.2-build.copy_xregs_to_kernel.patch b/ubuntu_buildfix_kernel_4.2-build.copy_xregs_to_kernel.patch
new file mode 100644
index 000000000000..b92c64fd5b95
--- /dev/null
+++ b/ubuntu_buildfix_kernel_4.2-build.copy_xregs_to_kernel.patch
@@ -0,0 +1,60 @@
+--- 15.9/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-09-27 10:59:10.121499353 +0200
++++ 15.9b/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-09-27 10:59:31.869133789 +0200
+@@ -6446,6 +6446,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
+@@ -6465,7 +6507,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;