nvidia: update v4.17

This commit is contained in:
nyyu 2018-05-24 09:37:32 +02:00
parent eac315c8f1
commit 6c7f49dac3
2 changed files with 46 additions and 8 deletions

View File

@ -5,24 +5,29 @@
pkgbase=nvidia
pkgname=(nvidia)
pkgver=390.48
_extramodules=extramodules-4.16-ARCH
pkgver=396.24
_extramodules=extramodules-4.17-ARCH
pkgrel=99
pkgdesc="NVIDIA drivers for linux"
arch=('x86_64')
url="http://www.nvidia.com/"
makedepends=('nvidia-libgl' "nvidia-utils=${pkgver}" 'linux' 'linux-headers>=4.15' 'linux-headers<4.17')
makedepends=("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')
_pkg="NVIDIA-Linux-x86_64-${pkgver}-no-compat32"
_pkg="NVIDIA-Linux-x86_64-${pkgver}"
source=("http://us.download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/${_pkg}.run"
kernel-4.16.patch)
sha256sums=('59bb112b17ca72cd15fed4e521d4b52b0e9f5b8b13a95b36521f8eda978b568e'
'622ac792ec200b2239cb663c0010392118b78c9904973d82cd261165c16d6385')
prepare() {
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
# Change to GPL license
find . -name '*.c' -type f -print0 | xargs -0 sed -i -E 's/MODULE_LICENSE\("(.*)"\)/MODULE_LICENSE\("GPL"\)/g'
}
@ -35,7 +40,7 @@ build() {
package_nvidia() {
pkgdesc="NVIDIA drivers for linux"
depends=('linux>=4.15' 'linux<4.17' "nvidia-utils=${pkgver}" 'libgl')
depends=('linux>=4.16' 'linux<4.17' "nvidia-utils=${pkgver}" 'libgl')
install -Dt "${pkgdir}/usr/lib/modules/${_extramodules}" -m644 \
"${srcdir}/${_pkg}/kernel"/nvidia{,-modeset,-drm,-uvm}.ko

33
nvidia/kernel-4.16.patch Normal file
View File

@ -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();
}"