summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorVi0L02017-08-15 22:07:17 +0200
committerVi0L02017-08-15 22:07:17 +0200
commitc5337c8edac3ebe4b710c82643611a8420316d41 (patch)
treede3754a70ab5e7e43e8178db5005047cb010682d
parentc35afa513b36819f78debab5e95c4ff07b4d8a8f (diff)
downloadaur-c5337c8edac3ebe4b710c82643611a8420316d41.tar.gz
15.9-20: 4.12 kernel support
-rw-r--r--.SRCINFO9
-rw-r--r--4.12-arch-remove_clts.patch21
-rw-r--r--4.12-npfeiler-PUD_OFFSET.patch171
-rw-r--r--PKGBUILD18
4 files changed, 210 insertions, 9 deletions
diff --git a/.SRCINFO b/.SRCINFO
index b06413c4e8f..81aada78765 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,15 +1,14 @@
pkgbase = catalyst-total
pkgdesc = AMD/ATI Catalyst drivers for linux. catalyst-dkms + catalyst-utils + lib32-catalyst-utils + experimental powerXpress suppport. Radeons HD 2 3 4 xxx ARE NOT SUPPORTED
pkgver = 15.9
- pkgrel = 19
+ pkgrel = 20
url = http://www.amd.com
install = catalyst-total.install
- arch = i686
arch = x86_64
license = custom
depends = dkms
depends = linux>=3.0
- depends = linux<4.12
+ depends = linux<4.13
depends = linux-headers
depends = xorg-server>=1.7.0
depends = xorg-server<1.18.0
@@ -91,6 +90,8 @@ pkgbase = catalyst-total
source = 4.9_over_4.6-arch-get_user_pages_remote.patch
source = 4.10-arch-sling00-virtual_address-acpi_get_table_with_size.patch
source = 4.11-npfeiler-signal_vmf.patch
+ source = 4.12-npfeiler-PUD_OFFSET.patch
+ source = 4.12-arch-remove_clts.patch
md5sums = d2de2df6946b452c266a3c892e6e46ff
md5sums = af7fb8ee4fc96fd54c5b483e33dc71c4
md5sums = bdafe749e046bfddee2d1c5e90eabd83
@@ -121,6 +122,8 @@ pkgbase = catalyst-total
md5sums = 194cb44e9e2ab0e65b6267aca66d0400
md5sums = 05f6364db877d9c4bdf1592deda905b7
md5sums = 8e53ba65a0aad42eb2ff771c1ace6609
+ md5sums = f090e47160403e4ba65d1e0de69973c9
+ md5sums = 782769206ed12ded10c347be3e476729
pkgname = catalyst-total
diff --git a/4.12-arch-remove_clts.patch b/4.12-arch-remove_clts.patch
new file mode 100644
index 00000000000..e34034da861
--- /dev/null
+++ b/4.12-arch-remove_clts.patch
@@ -0,0 +1,21 @@
+--- archive_files/common/lib/modules/fglrx/build_mod/firegl_public.c 2015-12-18 19:47:41.000000000 +0100
++++ archive_filesb/common/lib/modules/fglrx/build_mod/firegl_public.c 2017-08-15 21:14:37.288814512 +0200
+@@ -6508,8 +6508,6 @@
+ #else
+ __save_init_fpu(cur_task);
+ #endif
+- else
+- clts();
+
+ #else
+ /* TS_USEDFPU is removed in kernel 3.3+ and 3.2.8+ with the commit below:
+@@ -6534,8 +6532,7 @@
+ #else
+ __save_init_fpu(cur_task);
+ #endif
+- else
+- clts();
++
+ #endif
+ #endif
+ }
diff --git a/4.12-npfeiler-PUD_OFFSET.patch b/4.12-npfeiler-PUD_OFFSET.patch
new file mode 100644
index 00000000000..c2b2bd5e15e
--- /dev/null
+++ b/4.12-npfeiler-PUD_OFFSET.patch
@@ -0,0 +1,171 @@
+diff --git archive_files/common/lib/modules/fglrx/build_mod/firegl_public.c archive_files/common/lib/modules/fglrx/build_mod/firegl_public.c
+index b2c9e7c..2e9a112 100755
+--- archive_files/common/lib/modules/fglrx/build_mod/firegl_public.c
++++ archive_files/common/lib/modules/fglrx/build_mod/firegl_public.c
+@@ -208,6 +208,10 @@
+ #include <linux/sched/signal.h>
+ #endif
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
++#include <asm/set_memory.h>
++#endif
++
+ #include "firegl_public.h"
+ #include "kcl_osconfig.h"
+ #include "kcl_io.h"
+@@ -2752,6 +2756,9 @@ int ATI_API_CALL KCL_MEM_VerifyWriteAccess(void* addr, kcl_size_t size)
+ unsigned long ATI_API_CALL KCL_GetInitKerPte(unsigned long address)
+ {
+ pgd_t *pgd_p;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
++ p4d_t *p4d_p;
++#endif
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11)
+ pud_t *pud_p;
+ #endif
+@@ -2766,7 +2773,13 @@ unsigned long ATI_API_CALL KCL_GetInitKerPte(unsigned long address)
+ #endif
+ PGD_PRESENT(pgd_p);
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
++ P4D_OFFSET(p4d_p, pgd_p, address);
++ P4D_PRESENT(p4d_p);
++ PUD_OFFSET(pud_p, p4d_p, address);
++#else
+ PUD_OFFSET(pud_p, pgd_p, address);
++#endif
+ PUD_PRESENT(pud_p);
+ PMD_OFFSET(pmd_p, pud_p, address);
+ #else
+@@ -2823,6 +2836,9 @@ unsigned long ATI_API_CALL KCL_GetPageTableByVirtAddr(
+ unsigned long * page_addr)
+ {
+ pgd_t* pgd_p;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
++ p4d_t *p4d_p;
++#endif
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11)
+ pud_t* pud_p;
+ #endif
+@@ -2835,7 +2851,13 @@ unsigned long ATI_API_CALL KCL_GetPageTableByVirtAddr(
+ KCL_DEBUG2(FN_FIREGL_KCL,"pgd_p=0x%08lx\n", (unsigned long)pgd_p);
+
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
++ P4D_OFFSET(p4d_p, pgd_p, virtual_addr);
++ P4D_PRESENT(p4d_p);
++ PUD_OFFSET(pud_p, p4d_p, virtual_addr);
++#else
+ PUD_OFFSET(pud_p, pgd_p, virtual_addr);
++#endif
+ PUD_PRESENT(pud_p);
+ KCL_DEBUG2(FN_FIREGL_KCL,"pud_p=0x%08lx\n", (unsigned long)pud_p);
+ PMD_OFFSET(pmd_p, pud_p, virtual_addr);
+@@ -2892,6 +2914,9 @@ unsigned int ATI_API_CALL KCL_GetPageSizeByVirtAddr(
+ unsigned int * page_size)
+ {
+ pgd_t* pgd_p;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
++ p4d_t *p4d_p;
++#endif
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11)
+ pud_t* pud_p;
+ #endif
+@@ -2904,7 +2929,13 @@ unsigned int ATI_API_CALL KCL_GetPageSizeByVirtAddr(
+ KCL_DEBUG2(FN_FIREGL_KCL,"pgd_p=0x%08lx\n", (unsigned long)pgd_p);
+
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
++ P4D_OFFSET(p4d_p, pgd_p, virtual_addr);
++ P4D_PRESENT(p4d_p);
++ PUD_OFFSET(pud_p, p4d_p, virtual_addr);
++#else
+ PUD_OFFSET(pud_p, pgd_p, virtual_addr);
++#endif
+ PUD_PRESENT(pud_p);
+ KCL_DEBUG2(FN_FIREGL_KCL,"pud_p=0x%08lx\n", (unsigned long)pud_p);
+ PMD_OFFSET(pmd_p, pud_p, virtual_addr);
+@@ -3083,6 +3114,9 @@ int ATI_API_CALL KCL_TestAndClearPageDirtyFlag(unsigned long virtual_addr, unsig
+ {
+ int ret = -1; // init with page not present
+ pgd_t* pgd_p;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
++ p4d_t *p4d_p;
++#endif
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11)
+ pud_t* pud_p;
+ #endif
+@@ -3135,7 +3169,16 @@ int ATI_API_CALL KCL_TestAndClearPageDirtyFlag(unsigned long virtual_addr, unsig
+ KCL_DEBUG1(FN_FIREGL_KCL,"pgd_p=0x%08lx\n", (unsigned long)pgd_p);
+
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11)
+- PUD_OFFSET(pud_p, pgd_p, page_addr);
++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
++ P4D_OFFSET(p4d_p, pgd_p, page_addr);
++ if (!p4d_present(*p4d_p)) {
++ KCL_DEBUG1(FN_FIREGL_KCL,"ERROR: !p4d_present\n");
++ continue;
++ }
++ PUD_OFFSET(pud_p, p4d_p, page_addr);
++ #else
++ PUD_OFFSET(pud_p, pgd_p, page_addr);
++ #endif
+ if (!pud_present(*pud_p))
+ {
+ KCL_DEBUG1(FN_FIREGL_KCL,"ERROR: !pud_present\n");
+@@ -4077,6 +4120,9 @@ char* ATI_API_CALL KCL_MEM_VM_GetRegionPhysAddrStr(struct vm_area_struct* vma,
+ kcl_dma_addr_t* phys_address)
+ {
+ pgd_t* pgd_p;
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
++ p4d_t *p4d_p;
++#endif
+ pmd_t* pmd_p;
+ pte_t pte;
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11)
+@@ -4090,7 +4136,17 @@ char* ATI_API_CALL KCL_MEM_VM_GetRegionPhysAddrStr(struct vm_area_struct* vma,
+ return buf;
+ }
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11)
++ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
++ p4d_p = p4d_offset(pgd_p, virtual_addr);
++ if (!p4d_present(*p4d_p))
++ {
++ *buf = 0;
++ return buf;
++ }
++ pud_p = pud_offset(p4d_p, virtual_addr);
++ #else
+ pud_p = pud_offset(pgd_p, virtual_addr);
++ #endif
+ if (!pud_present(*pud_p))
+ {
+ *buf = 0;
+diff --git archive_files/common/lib/modules/fglrx/build_mod/firegl_public.h archive_files/common/lib/modules/fglrx/build_mod/firegl_public.h
+index 14e25f9..aca2940 100755
+--- archive_files/common/lib/modules/fglrx/build_mod/firegl_public.h
++++ archive_files/common/lib/modules/fglrx/build_mod/firegl_public.h
+@@ -91,6 +91,23 @@ do { \
+ } \
+ } while(0)
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
++#define P4D_OFFSET(p4d_p, pgd_p, pte_linear) \
++do { \
++ p4d_p = p4d_offset(pgd_p, pte_linear); \
++} while(0)
++
++#define P4D_PRESENT(p4d_p) \
++do { \
++ if (!p4d_present(*(p4d_p))) \
++ { \
++ return PAGING_FAULT_SIGBUS_INT; /* Something bad happened; generate SIGBUS */ \
++ /* alternatively we could generate a NOPAGE_OOM "out of memory" */ \
++ } \
++} while(0)
++
++#endif // LINUX_VERSION_CODE >= KERNEL_VERSION(4,12,0)
++
+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,11)
+ #define PUD_PRESENT(pud_p) \
+ do { \ \ No newline at end of file
diff --git a/PKGBUILD b/PKGBUILD
index 9e6a0897702..9974d30e8c3 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -22,20 +22,20 @@
# Contributor: gentoo (part of 4.3 kernel patches)
# Contributor: Philip Muller @ Manjaro (4.4 kernel patch)
# Contributor: aslmaswd (acpi main script)
-# Contributor: npfeiler (libcl/opencl-icd-loader cleaning and 4.11 kernel patch)
+# Contributor: npfeiler (libcl/opencl-icd-loader cleaning, 4.11 and 4.12 kernel patch)
# Contributor: sling00 (4.10 kernel patch)
pkgname=catalyst-total
pkgver=15.9
-pkgrel=19
+pkgrel=20
_amdver=15.201.1151
pkgdesc="AMD/ATI Catalyst drivers for linux. catalyst-dkms + catalyst-utils + lib32-catalyst-utils + experimental powerXpress suppport. Radeons HD 2 3 4 xxx ARE NOT SUPPORTED"
-arch=('i686' 'x86_64')
+arch=('x86_64')
url="http://www.amd.com"
license=('custom')
options=('staticlibs' 'libtool' '!strip' '!upx')
-depends=('dkms' 'linux>=3.0' 'linux<4.12' '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-noglvnd')
+depends=('dkms' 'linux>=3.0' 'linux<4.13' '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-noglvnd')
optdepends=('qt4: to run ATi Catalyst Control Center (amdcccle)'
'libxxf86vm: to run ATi Catalyst Control Center (amdcccle)'
'opencl-headers: headers necessary for OpenCL development'
@@ -99,7 +99,9 @@ source=(
4.7-arch-cpu_has_pge-v2.patch
4.9_over_4.6-arch-get_user_pages_remote.patch
4.10-arch-sling00-virtual_address-acpi_get_table_with_size.patch
- 4.11-npfeiler-signal_vmf.patch)
+ 4.11-npfeiler-signal_vmf.patch
+ 4.12-npfeiler-PUD_OFFSET.patch
+ 4.12-arch-remove_clts.patch)
md5sums=('d2de2df6946b452c266a3c892e6e46ff'
'af7fb8ee4fc96fd54c5b483e33dc71c4'
@@ -130,7 +132,9 @@ md5sums=('d2de2df6946b452c266a3c892e6e46ff'
'37eef5103a11d8136979463e7bc31091'
'194cb44e9e2ab0e65b6267aca66d0400'
'05f6364db877d9c4bdf1592deda905b7'
- '8e53ba65a0aad42eb2ff771c1ace6609')
+ '8e53ba65a0aad42eb2ff771c1ace6609'
+ 'f090e47160403e4ba65d1e0de69973c9'
+ '782769206ed12ded10c347be3e476729')
build() {
@@ -324,6 +328,8 @@ package() {
patch -Np1 -i ../4.9_over_4.6-arch-get_user_pages_remote.patch
patch -Np1 -i ../4.10-arch-sling00-virtual_address-acpi_get_table_with_size.patch
patch -Np1 -i ../4.11-npfeiler-signal_vmf.patch
+ patch -Np1 -i ../4.12-npfeiler-PUD_OFFSET.patch
+ patch -Np1 -i ../4.12-arch-remove_clts.patch
# Prepare modules source files
install -dm755 ${pkgdir}/usr/src/fglrx-${pkgver}/2.6.x