aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--system/nvidia-legacy390-kernel/nvidia-fix-linux-5.19.patch29
-rw-r--r--system/nvidia-legacy390-kernel/nvidia-legacy390-kernel.SlackBuild4
2 files changed, 32 insertions, 1 deletions
diff --git a/system/nvidia-legacy390-kernel/nvidia-fix-linux-5.19.patch b/system/nvidia-legacy390-kernel/nvidia-fix-linux-5.19.patch
new file mode 100644
index 0000000000000..50f46efc2a7ad
--- /dev/null
+++ b/system/nvidia-legacy390-kernel/nvidia-fix-linux-5.19.patch
@@ -0,0 +1,29 @@
+From cc4acfadcd71ee07c8d1b29411620a79451780b9 Mon Sep 17 00:00:00 2001
+From: Joan Bruguera <joanbrugueram@gmail.com>
+Date: Wed, 13 Apr 2022 21:21:13 +0200
+Subject: [PATCH] Buildfix NVIDIA 470.129.06 for Linux 5.19-rc1
+
+---
+ nvidia-drm/nvidia-dma-resv-helper.h | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/nvidia-drm/nvidia-dma-resv-helper.h b/nvidia-drm/nvidia-dma-resv-helper.h
+index ad8800d..65ea1f8 100644
+--- a/nvidia-drm/nvidia-dma-resv-helper.h
++++ b/nvidia-drm/nvidia-dma-resv-helper.h
+@@ -39,6 +39,15 @@
+ #include <linux/reservation.h>
+ #endif
+
++#include <linux/version.h>
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 0))
++// Rel. commit "dma-buf: specify usage while adding fences to dma_resv obj v7" (Christian König, 9 Nov 2021)
++static inline void dma_resv_add_excl_fence(struct dma_resv *obj, struct dma_fence *fence)
++{
++ dma_resv_add_fence(obj, fence, DMA_RESV_USAGE_WRITE);
++}
++#endif
++
+ #include <nvidia-dma-fence-helper.h>
+
+ #if defined(NV_LINUX_DMA_RESV_H_PRESENT)
diff --git a/system/nvidia-legacy390-kernel/nvidia-legacy390-kernel.SlackBuild b/system/nvidia-legacy390-kernel/nvidia-legacy390-kernel.SlackBuild
index 9da89ce3e2216..adc90a758176b 100644
--- a/system/nvidia-legacy390-kernel/nvidia-legacy390-kernel.SlackBuild
+++ b/system/nvidia-legacy390-kernel/nvidia-legacy390-kernel.SlackBuild
@@ -29,7 +29,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=nvidia-legacy390-kernel
VERSION=${VERSION:-390.151}
-BUILD=${BUILD:-2}
+BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -89,6 +89,8 @@ patch -p1 < $CWD/nvidia-legacy390-kernel-5.18.patch
(
unset ARCH
cd kernel || exit 1
+# Patch for 5.19 kernel
+ patch -p1 < $CWD/nvidia-fix-linux-5.19.patch
# CC=${CC:-gcc} suppresses an otherwise harmless "compiler mismatch"
# message. If you custom-build your kernel with clang,
# then pass CC=clang to this script.