diff --git a/PKGBUILD b/PKGBUILD index 7bd7d91..7f659cd 100644 --- a/PKGBUILD +++ b/PKGBUILD @@ -155,7 +155,7 @@ fi pkgname=("${_pkgname_array[@]}") pkgver=$_driver_version -pkgrel=134 +pkgrel=135 arch=('x86_64') url="http://www.nvidia.com/" license=('custom:NVIDIA') @@ -203,6 +203,7 @@ source=($_source_name '5.8-legacy.diff' # 5.8 additional vmalloc workaround (<450.57) 'kernel-5.9.patch' # 5.9 workaround '5.9-gpl.diff' # 5.9 cuda/nvenc workaround + 'kernel-5.10.patch' # 5.10 workaround ) msg2 "Selected driver integrity check behavior (md5sum or SKIP): $_md5sum" # If the driver is "known", return md5sum. If it isn't, return SKIP @@ -231,7 +232,8 @@ md5sums=("$_md5sum" '589dfc0c801605018b7ccd690f06141a' 'd67bf0a9aa5c19f07edbaf6bd157d661' '888d12b9aea711e6a025835b8ad063e2' - '0758046ed7c50463fd0ec378e9e34f95') + '0758046ed7c50463fd0ec378e9e34f95' + 'bcdd512edad1bad8331a8872259d2581') if [ "$_autoaddpatch" = "true" ]; then # Auto-add *.patch files from $startdir to source=() @@ -467,6 +469,10 @@ DEST_MODULE_LOCATION[3]="/kernel/drivers/video"' dkms.conf if (( $(vercmp "$_kernel" "5.9") >= 0 )); then _kernel59="1" _whitelist59=( 450.5* 450.6* ) + fi + + # 5.9 - 5.10 quirk + if (( $(vercmp "$_kernel" "5.9") >= 0 )) || (( $(vercmp "$_kernel" "5.10") >= 0 )); then if [[ $pkgver = 450* ]] || [[ $pkgver = 455* ]]; then cd "$srcdir"/"$_pkg"/kernel-$_kernel msg2 "Applying 5.9-gpl.diff for $_kernel..." @@ -475,6 +481,12 @@ DEST_MODULE_LOCATION[3]="/kernel/drivers/video"' dkms.conf fi fi + # 5.10 + if (( $(vercmp "$_kernel" "5.10") >= 0 )); then + _kernel510="1" + _whitelist510=( 450* 455* ) + fi + # Loop patches (linux-4.15.patch, lol.patch, ...) for _p in $(printf -- '%s\n' ${source[@]} | grep .patch); do # https://stackoverflow.com/a/21058239/1821548 # Patch version (4.15, "", ...) @@ -519,6 +531,9 @@ DEST_MODULE_LOCATION[3]="/kernel/drivers/video"' dkms.conf if [ "$_patch" = "5.9" ]; then _whitelist=(${_whitelist59[@]}) fi + if [ "$_patch" = "5.10" ]; then + _whitelist=(${_whitelist510[@]}) + fi patchy=0 if (( $(vercmp "$_kernel" "$_patch") >= 0 )); then @@ -740,6 +755,24 @@ DEST_MODULE_LOCATION[3]="/kernel/drivers/video"' dkms.conf else msg2 "Skipping kernel-5.9.patch as it doesn't apply to this driver version..." fi + fi + + # 5.10 + if [ "$_kernel510" = "1" ]; then + patchy=0 + for yup in "${_whitelist510[@]}"; do + [[ $pkgver = $yup ]] && patchy=1 + done + if [ "$patchy" = "1" ]; then + msg2 "Applying kernel-5.10.patch for dkms..." + patch -Np1 -i "$srcdir"/kernel-5.10.patch + else + msg2 "Skipping kernel-5.10.patch as it doesn't apply to this driver version..." + fi + fi + + # 5.9 - 5.10 quirk + if [ "$_kernel59" = "1" ] || [ "$_kernel510" = "1" ]; then if [[ $pkgver = 450* ]] || [[ $pkgver = 455* ]]; then msg2 "Applying 5.9-gpl.diff for dkms..." patch -Np1 -i "$srcdir"/5.9-gpl.diff diff --git a/patches/kernel-5.10.patch b/patches/kernel-5.10.patch new file mode 100644 index 0000000..5a8dfbd --- /dev/null +++ b/patches/kernel-5.10.patch @@ -0,0 +1,64 @@ +From 0c3e4c40305e78fd6d9899e43af6f0544a02fa6e Mon Sep 17 00:00:00 2001 +From: Joan Bruguera +Date: Mon, 26 Oct 2020 04:44:33 +0100 +Subject: [PATCH] Tentative fix for NVIDIA 455.28 driver for Linux 5.10-rc1 + +NOTE: This does not fix the licensing problem with nvidia-uvm which also affects Linux 5.9 +--- + common/inc/nv-linux.h | 6 ++++++ + nvidia-drm/nvidia-drm-gem-user-memory.c | 7 +++++++ + 2 files changed, 13 insertions(+) + +diff --git a/kernel-dkms/common/inc/nv-linux.h b/kernel-dkms/common/inc/nv-linux.h +index 09d1e50..630f80b 100644 +--- a/kernel-dkms/common/inc/nv-linux.h ++++ b/kernel-dkms/common/inc/nv-linux.h +@@ -11,6 +11,7 @@ + #ifndef _NV_LINUX_H_ + #define _NV_LINUX_H_ + ++#include + #include "nvstatus.h" + #include "nv-misc.h" + #include "nv.h" +@@ -169,6 +170,11 @@ static inline uid_t __kuid_val(uid_t uid) + + #include + #include ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)) ++// dma-mapping.h has been split on commit 0a0f0d8be76dcd4390ff538e7060fda34db79717,, ++// so this needs to be incldued now for the build to work ++#include ++#endif + + #if defined(CONFIG_SWIOTLB) && defined(NVCPU_AARCH64) + #include +diff --git a/kernel-dkms/nvidia-drm/nvidia-drm-gem-user-memory.c b/kernel-dkms/nvidia-drm/nvidia-drm-gem-user-memory.c +index 737d84c..082fc11 100644 +--- a/kernel-dkms/nvidia-drm/nvidia-drm-gem-user-memory.c ++++ b/kernel-dkms/nvidia-drm/nvidia-drm-gem-user-memory.c +@@ -20,6 +20,7 @@ + * DEALINGS IN THE SOFTWARE. + */ + ++#include + #include "nvidia-drm-conftest.h" + + #if defined(NV_DRM_AVAILABLE) +@@ -60,8 +61,14 @@ static struct sg_table *__nv_drm_gem_user_memory_prime_get_sg_table( + { + struct nv_drm_gem_user_memory *nv_user_memory = to_nv_user_memory(nv_gem); + ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)) ++ // New parameter to drm_prime_pages_to_sg (commit 707d561f77b5e2a6f90c9786bee44ee7a8dedc7e) ++ return drm_prime_pages_to_sg(nv_gem->nv_dev->dev, nv_user_memory->pages, ++ nv_user_memory->pages_count); ++#else + return drm_prime_pages_to_sg(nv_user_memory->pages, + nv_user_memory->pages_count); ++#endif + } + + static void *__nv_drm_gem_user_memory_prime_vmap( +-- +2.29.1