system/nvidia-legacy390-kernel: Updated for version 390.151.

Signed-off-by: Dave Woodfall <dave@slackbuilds.org>

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
Lenard Spencer 2022-05-25 04:16:15 +01:00 committed by Willy Sudiarto Raharjo
parent da274cacd5
commit b491cf7ddb
No known key found for this signature in database
GPG Key ID: 3F617144D7238786
6 changed files with 10 additions and 144 deletions

View File

@ -15,3 +15,7 @@ xorg.conf.
The xf86-video-nouveau-blacklist package from /extra is required.
The Nvidia 390.xx series will be supported through December 2022.
BIG FAT NOTE! If you are installing this on -current, please note
that while the Nvidia legacy390 kernel module has been updated for
the 5.17 kernel, it WILL NOT BUILD on 5.18.

View File

@ -1,30 +0,0 @@
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)

View File

@ -1,70 +0,0 @@
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 */

View File

@ -1,36 +0,0 @@
From 026a2a54a234cdb7bf78c17be7ea29d8dcf9f390 Mon Sep 17 00:00:00 2001
From: Joan Bruguera <joanbrugueram@gmail.com>
Date: Sun, 23 Jan 2022 16:28:18 +0100
Subject: [PATCH] Tentative fix for NVIDIA 470.94 driver for Linux 5.17-rc1
See also: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=359745d78351c6f5442435f81549f0207ece28aa
(edit by LRS: modified for NVIDIA 390.xx drivers)
---
common/inc/nv-procfs-utils.h | 3 +++
1 file changed, 3 insertions(+)
diff --git a/common/inc/nv-procfs.h b/common/inc/nv-procfs.h
index 7c3e1a3..462eac1 100644
--- a/common/inc/nv-procfs.h
+++ b/common/inc/nv-procfs.h
@@ -10,6 +10,7 @@
#ifndef _NV_PROCFS_H
#define _NV_PROCFS_H
+#include <linux/version.h>
#include "conftest.h"
#ifdef CONFIG_PROC_FS
@@ -114,6 +115,8 @@ typedef struct file_operations nv_proc_ops_t;
#if defined(NV_PDE_DATA_PRESENT)
# define NV_PDE_DATA(inode) PDE_DATA(inode)
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 17, 0))
+# define NV_PDE_DATA(inode) pde_data(inode)
#else
# define NV_PDE_DATA(inode) PDE(inode)->data
#endif
--
2.34.1

View File

@ -28,7 +28,7 @@
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=nvidia-legacy390-kernel
VERSION=${VERSION:-390.147}
VERSION=${VERSION:-390.151}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@ -86,8 +86,6 @@ find -L . \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
(cd kernel || exit 1
# patch for kernels 5.17 and newer:
patch -p1 < $CWD/nvidia-390xx-fix-linux-5.17.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.

View File

@ -1,10 +1,10 @@
PRGNAM="nvidia-legacy390-kernel"
VERSION="390.147"
VERSION="390.151"
HOMEPAGE="http://www.nvidia.com"
DOWNLOAD="https://download.nvidia.com/XFree86/Linux-x86/390.147/NVIDIA-Linux-x86-390.147.run"
MD5SUM="7af8932a2ae9326cfe8638fe77d62441"
DOWNLOAD_x86_64="https://download.nvidia.com/XFree86/Linux-x86_64/390.147/NVIDIA-Linux-x86_64-390.147.run"
MD5SUM_x86_64="59fafd7991f7d86e05dfcbc8a5ceaf8f"
DOWNLOAD="https://download.nvidia.com/XFree86/Linux-x86/390.151/NVIDIA-Linux-x86-390.151.run"
MD5SUM="fe68121d6846dc23ceec22ff005cc478"
DOWNLOAD_x86_64="https://download.nvidia.com/XFree86/Linux-x86_64/390.151/NVIDIA-Linux-x86_64-390.151.run"
MD5SUM_x86_64="4f545ea0f8da13b387f3c16d0a57b446"
REQUIRES=""
MAINTAINER="Lenard Spencer"
EMAIL="lenardrspencer@gmai.com"