summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Lenard Spencer2021-08-14 19:33:38 +0200
committer Willy Sudiarto Raharjo2021-08-19 13:33:45 +0200
commit3bdbf701ff7b7b2d462bd1c500f9e0541c300a07 (patch)
treef835ca3b721804e25ea006fbbc2101d88e6c4b21
parent4b5fee8ec1c08e24082939f499a6a216ef365afe (diff)
downloadslackbuilds-3bdbf701ff7b7b2d462bd1c500f9e0541c300a07.tar.gz
system/nvidia-legacy390-kernel: Updated for version 390.144.
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--system/nvidia-legacy390-kernel/README4
-rw-r--r--system/nvidia-legacy390-kernel/kernel-5.12.patch47
-rw-r--r--system/nvidia-legacy390-kernel/kernel-5.13.patch103
-rw-r--r--system/nvidia-legacy390-kernel/kernel-5.14-uvm.patch30
-rw-r--r--system/nvidia-legacy390-kernel/kernel-5.14.patch70
-rw-r--r--system/nvidia-legacy390-kernel/nvidia-legacy390-kernel.SlackBuild12
-rw-r--r--system/nvidia-legacy390-kernel/nvidia-legacy390-kernel.info10
7 files changed, 114 insertions, 162 deletions
diff --git a/system/nvidia-legacy390-kernel/README b/system/nvidia-legacy390-kernel/README
index b00ac67355..7b571a64ca 100644
--- a/system/nvidia-legacy390-kernel/README
+++ b/system/nvidia-legacy390-kernel/README
@@ -1,6 +1,6 @@
This is the kernel-module needed by the proprietary binary nvidia
-driver. You also need the nvidia-legacy390-driver package from
-SlackBuilds.org.
+driver.
+You also need the nvidia-driver package from SlackBuilds.org.
To build the package for a kernel different from the running one,
start the script setting the KERNEL variable as in
diff --git a/system/nvidia-legacy390-kernel/kernel-5.12.patch b/system/nvidia-legacy390-kernel/kernel-5.12.patch
deleted file mode 100644
index 8413156bf4..0000000000
--- a/system/nvidia-legacy390-kernel/kernel-5.12.patch
+++ /dev/null
@@ -1,47 +0,0 @@
-Taken from https://build.opensuse.org/package/view_file/X11:Drivers:Video/nvidia-gfxG04/kernel-5.12.patch
-Credit to Larry Finger <Larry.Finger@lwfinger.net>
-390.143 refresh and version check by JF
-
-Index: NVIDIA-Linux-x86_64-390.143-no-compat32/kernel/nvidia-drm/nvidia-drm-drv.c
-===================================================================
---- NVIDIA-Linux-x86_64-390.143-no-compat32.orig/kernel/nvidia-drm/nvidia-drm-drv.c
-+++ NVIDIA-Linux-x86_64-390.143-no-compat32/kernel/nvidia-drm/nvidia-drm-drv.c
-@@ -20,6 +20,8 @@
- * DEALINGS IN THE SOFTWARE.
- */
-
-+#include <linux/version.h>
-+
- #include "nvidia-drm-conftest.h" /* NV_DRM_AVAILABLE and NV_DRM_DRM_GEM_H_PRESENT */
-
- #include "nvidia-drm-priv.h"
-@@ -737,6 +737,17 @@ static struct drm_driver nv_drm_driver =
- #endif
- };
-
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 12, 0)
-+/* Starting with kernel 5.12, drm_gem_dumb_destroy() is no longer exported.
-+ * For that reason, we need to supply a replacement version.
-+ */
-+int replace_dumb_destroy(struct drm_file *file,
-+ struct drm_device *dev,
-+ u32 handle)
-+{
-+ return drm_gem_handle_delete(file, handle);
-+}
-+#endif
-
- /*
- * Update the global nv_drm_driver for the intended features.
-@@ -760,7 +767,11 @@ static void nv_drm_update_drm_driver_fea
-
- nv_drm_driver.dumb_create = nv_drm_dumb_create;
- nv_drm_driver.dumb_map_offset = nv_drm_dumb_map_offset;
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0)
- nv_drm_driver.dumb_destroy = nv_drm_dumb_destroy;
-+#else
-+ nv_drm_driver.dumb_destroy = replace_dumb_destroy;
-+#endif
-
- #if defined(NV_DRM_DRIVER_HAS_GEM_PRIME_CALLBACKS)
- nv_drm_driver.gem_vm_ops = &nv_drm_gem_vma_ops;
diff --git a/system/nvidia-legacy390-kernel/kernel-5.13.patch b/system/nvidia-legacy390-kernel/kernel-5.13.patch
deleted file mode 100644
index 36c0c6874c..0000000000
--- a/system/nvidia-legacy390-kernel/kernel-5.13.patch
+++ /dev/null
@@ -1,103 +0,0 @@
-diff --git a/kernel/conftest.sh b/kernel/conftest.sh
-index 4b6a9ed..25a8afa 100755
---- a/kernel/conftest.sh
-+++ b/kernel/conftest.sh
-@@ -4408,6 +4408,38 @@ compile_test() {
- fi
- ;;
-
-+ drm_plane_atomic_update_has_atomic_state_arg)
-+ #
-+ # Determine if drm_plane_helper_funcs::atomic_update takes 'state'
-+ # argument of 'struct drm_atomic_state' type.
-+ #
-+ # The commit 977697e20b3d ("drm/atomic: Pass the full state to
-+ # planes atomic disable and update") passed the full atomic state to
-+ # drm_crtc_helper_funcs::atomic_update() and atomic_disable().
-+ #
-+ echo "$CONFTEST_PREAMBLE
-+ #include <drm/drm_modeset_helper_vtables.h>
-+ #include <drm/drm_crtc_helper.h>
-+ #include <drm/drm_plane_helper.h>
-+ #include <drm/drm_atomic.h>
-+ #include <drm/drm_atomic_helper.h>
-+ void conftest_drm_plane_helper_atomic_update_has_atomic_state_arg(
-+ struct drm_plane *plane, struct drm_atomic_state *state) {
-+ const struct drm_plane_helper_funcs *funcs = plane->helper_private;
-+ funcs->atomic_update(plane, state);
-+ }" > conftest$$.c
-+
-+ $CC $CFLAGS -Werror=incompatible-pointer-types -c conftest$$.c > /dev/null 2>&1
-+ rm -f conftest$$.c
-+
-+ if [ -f conftest$$.o ]; then
-+ rm -f conftest$$.o
-+ echo "#define NV_DRM_PLANE_ATOMIC_UPDATE_HAS_ATOMIC_STATE_ARG" | append_conftest "types"
-+ else
-+ echo "#undef NV_DRM_PLANE_ATOMIC_UPDATE_HAS_ATOMIC_STATE_ARG" | append_conftest "types"
-+ fi
-+ ;;
-+
- drm_gem_object_vmap_has_map_arg)
- #
- # Determine if drm_gem_object_funcs::vmap takes 'map'
-diff --git a/kernel/nvidia-drm/nvidia-drm-crtc.c b/kernel/nvidia-drm/nvidia-drm-crtc.c
-index 8abd1f3..d5e5cfd 100644
---- a/kernel/nvidia-drm/nvidia-drm-crtc.c
-+++ b/kernel/nvidia-drm/nvidia-drm-crtc.c
-@@ -131,13 +131,21 @@ plane_req_config_update(struct drm_plane_state *plane_state,
- }
-
- static int nv_drm_plane_atomic_check(struct drm_plane *plane,
-+#if defined(NV_DRM_PLANE_ATOMIC_UPDATE_HAS_ATOMIC_STATE_ARG)
-+ struct drm_atomic_state *state)
-+#else
- struct drm_plane_state *plane_state)
-+#endif
- {
- int i;
- struct drm_crtc *crtc;
- struct drm_crtc_state *crtc_state;
- NvKmsKapiPlaneType type;
-
-+#if defined(NV_DRM_PLANE_ATOMIC_UPDATE_HAS_ATOMIC_STATE_ARG)
-+ struct drm_plane_state *plane_state = drm_atomic_get_new_plane_state(state,
-+ plane);
-+#endif
- if (NV_DRM_WARN(!drm_plane_type_to_nvkms_plane_type(plane->type, &type))) {
- goto done;
- }
-@@ -166,12 +174,20 @@ done:
- }
-
- static void nv_drm_plane_atomic_update(struct drm_plane *plane,
-+#if defined(NV_DRM_PLANE_ATOMIC_UPDATE_HAS_ATOMIC_STATE_ARG)
-+ struct drm_atomic_state *old_state)
-+#else
- struct drm_plane_state *old_state)
-+#endif
- {
- }
-
- static void nv_drm_plane_atomic_disable(struct drm_plane *plane,
-+#if defined(NV_DRM_PLANE_ATOMIC_UPDATE_HAS_ATOMIC_STATE_ARG)
-+ struct drm_atomic_state *old_state)
-+#else
- struct drm_plane_state *old_state)
-+#endif
- {
- }
-
-diff --git a/kernel/nvidia-drm/nvidia-drm.Kbuild b/kernel/nvidia-drm/nvidia-drm.Kbuild
-index 885ab49..2cb0f9f 100644
---- a/kernel/nvidia-drm/nvidia-drm.Kbuild
-+++ b/kernel/nvidia-drm/nvidia-drm.Kbuild
-@@ -100,4 +100,5 @@ NV_CONFTEST_TYPE_COMPILE_TESTS += drm_driver_has_gem_free_object
- NV_CONFTEST_TYPE_COMPILE_TESTS += drm_prime_pages_to_sg_has_drm_device_arg
- NV_CONFTEST_TYPE_COMPILE_TESTS += drm_driver_has_gem_prime_callbacks
- NV_CONFTEST_TYPE_COMPILE_TESTS += drm_crtc_atomic_check_has_atomic_state_arg
-+NV_CONFTEST_TYPE_COMPILE_TESTS += drm_plane_atomic_update_has_atomic_state_arg
- NV_CONFTEST_TYPE_COMPILE_TESTS += drm_gem_object_vmap_has_map_arg
---
-2.30.2
-
diff --git a/system/nvidia-legacy390-kernel/kernel-5.14-uvm.patch b/system/nvidia-legacy390-kernel/kernel-5.14-uvm.patch
new file mode 100644
index 0000000000..0e8570f536
--- /dev/null
+++ b/system/nvidia-legacy390-kernel/kernel-5.14-uvm.patch
@@ -0,0 +1,30 @@
+diff -Nur kernel.orig/nvidia-uvm/uvm_linux.h kernel/nvidia-uvm/uvm_linux.h
+--- kernel.orig/nvidia-uvm/uvm_linux.h 2021-06-02 19:09:58.000000000 -0400
++++ kernel/nvidia-uvm/uvm_linux.h 2021-07-21 00:58:00.406951472 -0400
+@@ -29,6 +29,8 @@
+ //
+ //
+
++#include <linux/version.h>
++
+ #ifndef _UVM_LINUX_H
+ #define _UVM_LINUX_H
+
+@@ -475,10 +477,17 @@
+ #elif (NV_WAIT_ON_BIT_LOCK_ARGUMENT_COUNT == 4)
+ static __sched int uvm_bit_wait(void *word)
+ {
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0))
+ if (signal_pending_state(current->state, current))
+ return 1;
+ schedule();
+ return 0;
++#else
++ if (signal_pending_state(current->__state, current))
++ return 1;
++ schedule();
++ return 0;
++#endif
+ }
+ #define UVM_WAIT_ON_BIT_LOCK(word, bit, mode) \
+ wait_on_bit_lock(word, bit, uvm_bit_wait, mode)
diff --git a/system/nvidia-legacy390-kernel/kernel-5.14.patch b/system/nvidia-legacy390-kernel/kernel-5.14.patch
new file mode 100644
index 0000000000..bb8440d2cc
--- /dev/null
+++ b/system/nvidia-legacy390-kernel/kernel-5.14.patch
@@ -0,0 +1,70 @@
+diff -Nur kernel.orig/nvidia/nvlink_linux.c kernel/nvidia/nvlink_linux.c
+--- kernel.orig/nvidia/nvlink_linux.c 2021-06-02 19:10:01.000000000 -0400
++++ kernel/nvidia/nvlink_linux.c 2021-07-21 00:54:04.940862052 -0400
+@@ -21,6 +21,7 @@
+
+ *******************************************************************************/
+
++#include <linux/version.h>
+ #include "conftest.h"
+
+ #include "nvlink_common.h"
+@@ -597,7 +598,12 @@
+ // the requested timeout has expired, loop until less
+ // than a jiffie of the desired delay remains.
+ //
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0))
+ current->state = TASK_INTERRUPTIBLE;
++#else
++ // Rel. commit "sched: Change task_struct::state" (Peter Zijlstra, Jun 11 2021)
++ WRITE_ONCE(current->__state, TASK_INTERRUPTIBLE);
++#endif
+ do
+ {
+ schedule_timeout(jiffies);
+diff -Nur kernel.orig/nvidia/os-interface.c kernel/nvidia/os-interface.c
+--- kernel.orig/nvidia/os-interface.c 2021-06-02 19:09:57.000000000 -0400
++++ kernel/nvidia/os-interface.c 2021-07-21 00:54:31.512104423 -0400
+@@ -8,6 +8,7 @@
+ * _NVRM_COPYRIGHT_END_
+ */
+
++#include <linux/version.h>
+ #define __NO_VERSION__
+ #include "nv-misc.h"
+
+@@ -580,7 +581,12 @@
+ // the requested timeout has expired, loop until less
+ // than a jiffie of the desired delay remains.
+ //
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0))
+ current->state = TASK_INTERRUPTIBLE;
++#else
++ // Rel. commit "sched: Change task_struct::state" (Peter Zijlstra, Jun 11 2021)
++ WRITE_ONCE(current->__state, TASK_INTERRUPTIBLE);
++#endif
+ do
+ {
+ schedule_timeout(jiffies);
+diff -Nur kernel.orig/nvidia-drm/nvidia-drm-drv.c kernel/nvidia-drm/nvidia-drm-drv.c
+--- kernel.orig/nvidia-drm/nvidia-drm-drv.c 2021-06-02 19:10:01.000000000 -0400
++++ kernel/nvidia-drm/nvidia-drm-drv.c 2021-07-21 02:56:07.552121923 -0400
+@@ -20,6 +20,8 @@
+ * DEALINGS IN THE SOFTWARE.
+ */
+
++#include <linux/version.h>
++
+ #include "nvidia-drm-conftest.h" /* NV_DRM_AVAILABLE and NV_DRM_DRM_GEM_H_PRESENT */
+
+ #include "nvidia-drm-priv.h"
+@@ -811,7 +813,9 @@
+
+ dev->dev_private = nv_dev;
+ nv_dev->dev = dev;
++#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0))
+ dev->pdev = pdev;
++#endif
+
+ /* Register DRM device to DRM sub-system */
+
diff --git a/system/nvidia-legacy390-kernel/nvidia-legacy390-kernel.SlackBuild b/system/nvidia-legacy390-kernel/nvidia-legacy390-kernel.SlackBuild
index 84904a4cad..cae4b64562 100644
--- a/system/nvidia-legacy390-kernel/nvidia-legacy390-kernel.SlackBuild
+++ b/system/nvidia-legacy390-kernel/nvidia-legacy390-kernel.SlackBuild
@@ -25,12 +25,10 @@
# Thanks to Robby Workman for suggestions to improve this script.
-# see nvidia-driver/changelog.txt
-
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=nvidia-legacy390-kernel
-VERSION=${VERSION:-390.143}
+VERSION=${VERSION:-390.144}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -87,8 +85,12 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
-patch -p1 < $CWD/kernel-5.12.patch
-patch -p1 < $CWD/kernel-5.13.patch
+# Patch for 5.14 kernel:
+patch -p0 < $CWD/kernel-5.14.patch
+# 64-bit only:
+if [ "$ARCH" = "x86_64" ]; then
+ patch -p0 < $CWD/kernel-5.14-uvm.patch
+fi
(cd kernel || exit 1
make SYSSRC=$KERNELPATH module || exit 1
diff --git a/system/nvidia-legacy390-kernel/nvidia-legacy390-kernel.info b/system/nvidia-legacy390-kernel/nvidia-legacy390-kernel.info
index 6d4935fe72..4ed80773ab 100644
--- a/system/nvidia-legacy390-kernel/nvidia-legacy390-kernel.info
+++ b/system/nvidia-legacy390-kernel/nvidia-legacy390-kernel.info
@@ -1,10 +1,10 @@
PRGNAM="nvidia-legacy390-kernel"
-VERSION="390.143"
+VERSION="390.144"
HOMEPAGE="http://www.nvidia.com"
-DOWNLOAD="https://download.nvidia.com/XFree86/Linux-x86/390.143/NVIDIA-Linux-x86-390.143.run"
-MD5SUM="7b5704f3c89223d5ecb4f26ca9463c26"
-DOWNLOAD_x86_64="https://download.nvidia.com/XFree86/Linux-x86_64/390.143/NVIDIA-Linux-x86_64-390.143.run"
-MD5SUM_x86_64="1b526fa9567a09eb1e18545f675c8f82"
+DOWNLOAD="https://download.nvidia.com/XFree86/Linux-x86/390.144/NVIDIA-Linux-x86-390.144.run"
+MD5SUM="6ee8cd784135bd79f5e416b6815f443d"
+DOWNLOAD_x86_64="https://download.nvidia.com/XFree86/Linux-x86_64/390.144/NVIDIA-Linux-x86_64-390.144.run"
+MD5SUM_x86_64="dc6a203e3c32456e16e6fae5c8a7c728"
REQUIRES=""
MAINTAINER="Lenard Spencer"
EMAIL="lenardrspencer@gmai.com"