[arch-commits] Commit in nvidia/trunk (PKGBUILD kernel-4.16.patch)
Jan Steffens
heftig at archlinux.org
Sat Apr 14 20:34:10 UTC 2018
Date: Saturday, April 14, 2018 @ 20:34:09
Author: heftig
Revision: 321808
Add a patch for 4.16
Added:
nvidia/trunk/kernel-4.16.patch
Modified:
nvidia/trunk/PKGBUILD
-------------------+
PKGBUILD | 10 ++++++++--
kernel-4.16.patch | 33 +++++++++++++++++++++++++++++++++
2 files changed, 41 insertions(+), 2 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2018-04-14 20:31:35 UTC (rev 321807)
+++ PKGBUILD 2018-04-14 20:34:09 UTC (rev 321808)
@@ -14,8 +14,10 @@
makedepends=('nvidia-libgl' "nvidia-utils=${pkgver}" 'linux' 'linux-headers>=4.16' 'linux-headers<4.17')
license=('custom')
options=('!strip')
-source=("http://us.download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/NVIDIA-Linux-x86_64-${pkgver}-no-compat32.run")
-sha256sums=('2d4bf72801f101a85df6fd1464021380ad51f5a30df05dadaf1fb546a175a441')
+source=("http://us.download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/NVIDIA-Linux-x86_64-${pkgver}-no-compat32.run"
+ kernel-4.16.patch)
+sha256sums=('2d4bf72801f101a85df6fd1464021380ad51f5a30df05dadaf1fb546a175a441'
+ '622ac792ec200b2239cb663c0010392118b78c9904973d82cd261165c16d6385')
_pkg="NVIDIA-Linux-x86_64-${pkgver}-no-compat32"
@@ -23,6 +25,10 @@
sh "${_pkg}.run" --extract-only
cd "${_pkg}"
+ # Restore phys_to_dma support (still needed for 396.18)
+ # https://bugs.archlinux.org/task/58074
+ patch -Np1 -i ../kernel-4.16.patch
+
cp -a kernel kernel-dkms
cd kernel-dkms
sed -i "s/__VERSION_STRING/${pkgver}/" dkms.conf
Added: kernel-4.16.patch
===================================================================
--- kernel-4.16.patch (rev 0)
+++ kernel-4.16.patch 2018-04-14 20:34:09 UTC (rev 321808)
@@ -0,0 +1,33 @@
+diff --git a/kernel/common/inc/nv-linux.h b/kernel/common/inc/nv-linux.h
+index 10fc418..22ef968 100644
+--- a/kernel/common/inc/nv-linux.h
++++ b/kernel/common/inc/nv-linux.h
+@@ -175,7 +175,11 @@ static inline uid_t __kuid_val(kuid_t uid)
+
+ #if defined(NV_VM_INSERT_PAGE_PRESENT)
+ #include <linux/pagemap.h>
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0)
+ #include <linux/dma-mapping.h>
++#else
++#include <linux/dma-direct.h>
++#endif
+ #endif
+
+ #if defined(CONFIG_SWIOTLB) && defined(NVCPU_AARCH64)
+diff --git a/kernel/conftest.sh b/kernel/conftest.sh
+index b23dbb4..42dc576 100755
+--- a/kernel/conftest.sh
++++ b/kernel/conftest.sh
+@@ -1906,7 +1906,12 @@ compile_test() {
+ # Determine if the phys_to_dma function is present.
+ #
+ CODE="
++ #include <linux/version.h>
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 16, 0)
+ #include <linux/dma-mapping.h>
++#else
++ #include <linux/dma-direct.h>
++#endif
+ void conftest_phys_to_dma(void) {
+ phys_to_dma();
+ }"
More information about the arch-commits
mailing list