Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] nvidia340: remove
@ 2020-12-19 22:50 abenson
  2021-01-09  4:15 ` [PR PATCH] [Updated] " abenson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: abenson @ 2020-12-19 22:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 307 bytes --]

There is a new pull request by abenson against master on the void-packages repository

https://github.com/abenson/void-packages rm_nvidia340
https://github.com/void-linux/void-packages/pull/27287

nvidia340: remove


A patch file from https://github.com/void-linux/void-packages/pull/27287.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-rm_nvidia340-27287.patch --]
[-- Type: text/x-diff, Size: 46855 bytes --]

From 93cd50a007c946f2b4ce947d95bc30bea43a4c71 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Sat, 19 Dec 2020 16:49:32 -0600
Subject: [PATCH] nvidia340: remove

---
 common/shlibs                            |   3 -
 srcpkgs/nvidia340-dkms                   |   1 -
 srcpkgs/nvidia340-libs                   |   1 -
 srcpkgs/nvidia340-opencl                 |   1 -
 srcpkgs/nvidia340/INSTALL                |   7 -
 srcpkgs/nvidia340/INSTALL.msg            |  15 -
 srcpkgs/nvidia340/REMOVE                 |   7 -
 srcpkgs/nvidia340/files/kernel-5.8.patch |  92 ---
 srcpkgs/nvidia340/files/kernel-5.9.patch | 107 ----
 srcpkgs/nvidia340/files/kernel-5.x.patch | 781 -----------------------
 srcpkgs/nvidia340/files/nvidia-glx.conf  |   4 -
 srcpkgs/nvidia340/template               | 223 -------
 srcpkgs/nvidia340/update                 |   2 -
 13 files changed, 1244 deletions(-)
 delete mode 120000 srcpkgs/nvidia340-dkms
 delete mode 120000 srcpkgs/nvidia340-libs
 delete mode 120000 srcpkgs/nvidia340-opencl
 delete mode 100644 srcpkgs/nvidia340/INSTALL
 delete mode 100644 srcpkgs/nvidia340/INSTALL.msg
 delete mode 100644 srcpkgs/nvidia340/REMOVE
 delete mode 100644 srcpkgs/nvidia340/files/kernel-5.8.patch
 delete mode 100644 srcpkgs/nvidia340/files/kernel-5.9.patch
 delete mode 100644 srcpkgs/nvidia340/files/kernel-5.x.patch
 delete mode 100644 srcpkgs/nvidia340/files/nvidia-glx.conf
 delete mode 100644 srcpkgs/nvidia340/template
 delete mode 100644 srcpkgs/nvidia340/update

diff --git a/common/shlibs b/common/shlibs
index f94a891d6fd..4ca25d9d9df 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -131,16 +131,13 @@ libbrcmOpenVG.so rpi-userland-20180103_2
 libwayland-egl.so.1 wayland-1.15.0_4
 libnvidia-ml.so.1 nvidia-libs-346.47_1 ignore
 libnvidia-ml.so.1 nvidia304-libs-304.00_1 ignore
-libnvidia-ml.so.1 nvidia340-libs-340.46_1 ignore
 libnvidia-ml.so.1 nvidia390-libs-390.87_1 ignore
 libnvidia-tls.so.346.47 nvidia-libs-346.47_1 ignore
 libnvidia-glcore.so.346.47 nvidia-libs-346.47_1 ignore
 libnvidia-gtk2.so.346.47 nvidia-gtklibs-346.47_1 ignore
 libnvidia-gtk3.so.346.47 nvidia-gtklibs-346.47_1 ignore
-libnvidia-glcore.so.346.47 nvidia340-libs-340.46_1 ignore
 libnvidia-glcore.so.390.87 nvidia390-libs-390.87_1 ignore
 libnvidia-glsi.so.346.72 nvidia-libs-346.72_1 ignore
-libnvidia-glsi.so.340.107 nvidia340-libs-340.107_7 ignore
 libnvidia-fatbinaryloader.so.390.138 nvidia390-libs-390.138_1 ignore
 libnvidia-fatbinaryloader.so.430.40 nvidia-libs-430.40_1 ignore
 libglapi.so.0 libglapi-7.11_1
diff --git a/srcpkgs/nvidia340-dkms b/srcpkgs/nvidia340-dkms
deleted file mode 120000
index 383d067a70f..00000000000
--- a/srcpkgs/nvidia340-dkms
+++ /dev/null
@@ -1 +0,0 @@
-nvidia340
\ No newline at end of file
diff --git a/srcpkgs/nvidia340-libs b/srcpkgs/nvidia340-libs
deleted file mode 120000
index 383d067a70f..00000000000
--- a/srcpkgs/nvidia340-libs
+++ /dev/null
@@ -1 +0,0 @@
-nvidia340
\ No newline at end of file
diff --git a/srcpkgs/nvidia340-opencl b/srcpkgs/nvidia340-opencl
deleted file mode 120000
index 383d067a70f..00000000000
--- a/srcpkgs/nvidia340-opencl
+++ /dev/null
@@ -1 +0,0 @@
-nvidia340
\ No newline at end of file
diff --git a/srcpkgs/nvidia340/INSTALL b/srcpkgs/nvidia340/INSTALL
deleted file mode 100644
index 6b065bedb4a..00000000000
--- a/srcpkgs/nvidia340/INSTALL
+++ /dev/null
@@ -1,7 +0,0 @@
-# Regenerate initramfs.
-case ${ACTION} in
-post)
-	echo "Regenerating initramfs, please wait..."
-	dracut -f -q --regenerate-all
-	;;
-esac
diff --git a/srcpkgs/nvidia340/INSTALL.msg b/srcpkgs/nvidia340/INSTALL.msg
deleted file mode 100644
index 6301c36edbe..00000000000
--- a/srcpkgs/nvidia340/INSTALL.msg
+++ /dev/null
@@ -1,15 +0,0 @@
-> Remove from your /etc/X11/xorg.conf blocks like this:
-
-Section "Files"
-...
-EndSection
-
-This is known to happen when the configuration is generated by nvidia-xconfig.
-Such a section interferes with the "Files" Section provided by the package.
-
--------------------------------------------------------------------------------
-
-> If you wish to go back to nouveau:
-
-# xbps-remove nvidia340 nvidia340-dkms
-# xbps-install libglvnd
diff --git a/srcpkgs/nvidia340/REMOVE b/srcpkgs/nvidia340/REMOVE
deleted file mode 100644
index e4d494ca015..00000000000
--- a/srcpkgs/nvidia340/REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-# Regenerate initramfs.
-case ${ACTION} in
-purge)
-	echo "Regenerating initramfs, please wait..."
-	dracut -f -q --regenerate-all
-	;;
-esac
diff --git a/srcpkgs/nvidia340/files/kernel-5.8.patch b/srcpkgs/nvidia340/files/kernel-5.8.patch
deleted file mode 100644
index 1d8b1a40e1e..00000000000
--- a/srcpkgs/nvidia340/files/kernel-5.8.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-From 2cc3342b4b3c96bcc4062513011d35c079b009a2 Mon Sep 17 00:00:00 2001
-From: graysky <graysky@archlinux.us>
-Date: Thu, 22 Oct 2020 06:59:59 -0400
-Subject: [PATCH 2/3] kernel-5.8
-
-credit: https://launchpad.net/~kelebek333/+archive/ubuntu/nvidia-legacy/+packages
-extracted from: https://launchpadlibrarian.net/492468557/nvidia-graphics-drivers-340_340.108-1lmtrfocal3_340.108-2lmtrfocal.diff.gz
----
- kernel/nv-linux.h                | 8 ++++++++
- kernel/nvidia-modules-common.mk  | 1 +
- kernel/os-mlock.c                | 8 ++++++++
- kernel/uvm/nvidia_uvm_lite_api.c | 4 ++++
- 4 files changed, 21 insertions(+)
-
-diff --git a/kernel/nv-linux.h b/kernel/nv-linux.h
-index 83e6433..d055552 100644
---- a/kernel/nv-linux.h
-+++ b/kernel/nv-linux.h
-@@ -669,11 +669,19 @@ extern nv_spinlock_t km_lock;
- #  define KM_FREE_RECORD(a,b,c)
- #endif
- 
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
-+#define NV_VMALLOC(ptr, size)                     \
-+    {                                             \
-+        (ptr) = __vmalloc(size, GFP_KERNEL);      \
-+        VM_ALLOC_RECORD(ptr, size, "vm_vmalloc"); \
-+    }
-+#else
- #define NV_VMALLOC(ptr, size)                               \
-     {                                                       \
-         (ptr) = __vmalloc(size, GFP_KERNEL, PAGE_KERNEL);   \
-         VM_ALLOC_RECORD(ptr, size, "vm_vmalloc");           \
-     }
-+#endif
- 
- #define NV_VFREE(ptr, size)                         \
-     {                                               \
-diff --git a/kernel/nvidia-modules-common.mk b/kernel/nvidia-modules-common.mk
-index b94591b..0e4c228 100644
---- a/kernel/nvidia-modules-common.mk
-+++ b/kernel/nvidia-modules-common.mk
-@@ -222,6 +222,7 @@ build-sanity-checks:
- define BUILD_MODULE_RULE
-  $(1): build-sanity-checks $(3)
- 	@echo "NVIDIA: calling KBUILD..."; \
-+	touch .nv-kernel.o.cmd; \
- 	$$(MAKE) "CC=$$(CC)" NV_MODULE_SUFFIX=$$(strip $(2)) $$(KBUILD_PARAMS) modules; \
- 	echo "NVIDIA: left KBUILD."; \
- 	if ! [ -f $(1) ]; then \
-diff --git a/kernel/os-mlock.c b/kernel/os-mlock.c
-index 8a1fa2f..fc50543 100644
---- a/kernel/os-mlock.c
-+++ b/kernel/os-mlock.c
-@@ -44,11 +44,19 @@ RM_STATUS NV_API_CALL os_lock_user_pages(
-         return rmStatus;
-     }
- 
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
-+    down_read(&mm->mmap_lock);
-+    ret = NV_GET_USER_PAGES((unsigned long)address,
-+                            page_count, write, force, user_pages, NULL);
-+    up_read(&mm->mmap_lock);
-+    pinned = ret;
-+#else
-     down_read(&mm->mmap_sem);
-     ret = NV_GET_USER_PAGES((unsigned long)address,
-                             page_count, write, force, user_pages, NULL);
-     up_read(&mm->mmap_sem);
-     pinned = ret;
-+#endif
- 
-     if (ret < 0)
-     {
-diff --git a/kernel/uvm/nvidia_uvm_lite_api.c b/kernel/uvm/nvidia_uvm_lite_api.c
-index 8448eb6..97a4818 100644
---- a/kernel/uvm/nvidia_uvm_lite_api.c
-+++ b/kernel/uvm/nvidia_uvm_lite_api.c
-@@ -30,6 +30,10 @@
- #include "uvm_gpu_ops_tests.h"
- #endif
- 
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
-+#define mmap_sem mmap_lock
-+#endif
-+
- //
- // nvidia_uvm_lite_api.c
- //
--- 
-2.29.0
-
diff --git a/srcpkgs/nvidia340/files/kernel-5.9.patch b/srcpkgs/nvidia340/files/kernel-5.9.patch
deleted file mode 100644
index d8584314f24..00000000000
--- a/srcpkgs/nvidia340/files/kernel-5.9.patch
+++ /dev/null
@@ -1,107 +0,0 @@
-From fea401df7500bfbead5a42b1e74560dbddf2f5a3 Mon Sep 17 00:00:00 2001
-From: graysky <graysky@archlinux.us>
-Date: Thu, 22 Oct 2020 07:00:35 -0400
-Subject: [PATCH 3/3] kernel-5.9
-
-credit: https://github.com/warpme/minimyth2/blob/master/script/nvidia/nvidia-340.108/files/nvidia-340.108-fix-5.9-kernel-compile.patch
----
- kernel/nv-drm.c               | 8 ++++++++
- kernel/nv-linux.h             | 9 +++++++--
- kernel/nv.c                   | 4 ++++
- kernel/uvm/nvidia_uvm_linux.h | 2 ++
- 4 files changed, 21 insertions(+), 2 deletions(-)
-
-diff --git a/kernel/nv-drm.c b/kernel/nv-drm.c
-index 85db07e..f0c1299 100644
---- a/kernel/nv-drm.c
-+++ b/kernel/nv-drm.c
-@@ -415,7 +415,11 @@ static struct drm_driver nv_drm_driver = {
-     .set_busid = drm_pci_set_busid,
- #endif
- 
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
-+    .gem_free_object_unlocked = nv_gem_free,
-+#else
-     .gem_free_object = nv_gem_free,
-+#endif
- 
-     .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
-     .gem_prime_export = drm_gem_prime_export,
-@@ -511,8 +515,12 @@ RM_STATUS NV_API_CALL nv_alloc_os_descriptor_handle(
- 
- #if defined(NV_DRM_GEM_OBJECT_PUT_UNLOCKED_PRESENT)
-     drm_gem_object_put_unlocked(&nv_obj->base);
-+#else
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
-+    drm_gem_object_put_locked(&nv_obj->base);
- #else
-     drm_gem_object_unreference_unlocked(&nv_obj->base);
-+#endif
- #endif
- 
-     status = RM_OK;
-diff --git a/kernel/nv-linux.h b/kernel/nv-linux.h
-index d055552..524a8fe 100644
---- a/kernel/nv-linux.h
-+++ b/kernel/nv-linux.h
-@@ -136,8 +136,10 @@
- 
- #if defined(NVCPU_X86_64) && !defined(HAVE_COMPAT_IOCTL)
- #include <linux/syscalls.h>         /* sys_ioctl()                      */
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 9, 0)
- #include <linux/ioctl32.h>          /* register_ioctl32_conversion()    */
- #endif
-+#endif
- 
- #if !defined(NV_FILE_OPERATIONS_HAS_IOCTL) && \
-   !defined(NV_FILE_OPERATIONS_HAS_UNLOCKED_IOCTL)
-@@ -2249,10 +2251,13 @@ static inline NvU64 nv_node_end_pfn(int nid)
-                                             pages, vmas, NULL);
- 
-         #else
--
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
-+               return get_user_pages_remote(mm, start, nr_pages, flags,
-+                                            pages, vmas, NULL);
-+#else
-                return get_user_pages_remote(tsk, mm, start, nr_pages, flags,
-                                             pages, vmas);
--
-+#endif
-         #endif
- 
-         }
-diff --git a/kernel/nv.c b/kernel/nv.c
-index a218f83..be4e0f8 100644
---- a/kernel/nv.c
-+++ b/kernel/nv.c
-@@ -2785,7 +2785,11 @@ nvidia_probe
- 
- #if defined(CONFIG_VGA_ARB)
- #if defined(VGA_DEFAULT_DEVICE)
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
-+    vga_get(VGA_DEFAULT_DEVICE, VGA_RSRC_LEGACY_MASK, 0);
-+#else
-     vga_tryget(VGA_DEFAULT_DEVICE, VGA_RSRC_LEGACY_MASK);
-+#endif
- #endif
-     vga_set_legacy_decoding(dev, VGA_RSRC_NONE);
- #endif
-diff --git a/kernel/uvm/nvidia_uvm_linux.h b/kernel/uvm/nvidia_uvm_linux.h
-index 1625209..efc181f 100644
---- a/kernel/uvm/nvidia_uvm_linux.h
-+++ b/kernel/uvm/nvidia_uvm_linux.h
-@@ -158,8 +158,10 @@
- 
- #if defined(NVCPU_X86_64) && !defined(HAVE_COMPAT_IOCTL)
- #include <linux/syscalls.h>         /* sys_ioctl()                      */
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 9, 0)
- #include <linux/ioctl32.h>          /* register_ioctl32_conversion()    */
- #endif
-+#endif
- 
- #if !defined(NV_FILE_OPERATIONS_HAS_IOCTL) && \
-   !defined(NV_FILE_OPERATIONS_HAS_UNLOCKED_IOCTL)
--- 
-2.29.0
-
diff --git a/srcpkgs/nvidia340/files/kernel-5.x.patch b/srcpkgs/nvidia340/files/kernel-5.x.patch
deleted file mode 100644
index d7f763bbe39..00000000000
--- a/srcpkgs/nvidia340/files/kernel-5.x.patch
+++ /dev/null
@@ -1,781 +0,0 @@
-From 2154cc447a2377cfd60a7b7c5b619e689ebf71b1 Mon Sep 17 00:00:00 2001
-From: graysky <graysky@archlinux.us>
-Date: Thu, 22 Oct 2020 06:58:53 -0400
-Subject: [PATCH 1/3] kernel-5.7
-
-Contains a bunch of stuff required for things up to 5.7.
-credit: https://gitlab.manjaro.org/packages?utf8=%E2%9C%93&filter=nvidia-340xx
----
- kernel/Makefile              |   5 +
- kernel/conftest.sh           |  81 +++++++++++++
- kernel/dkms.conf             |   8 +-
- kernel/nv-drm.c              | 229 ++++++++++++++++++++++++++++++++++-
- kernel/nv-linux.h            |  49 ++++++++
- kernel/nv-procfs.c           |  20 +++
- kernel/nv-time.h             |   9 +-
- kernel/nv.c                  |   2 +-
- kernel/os-interface.c        |   8 +-
- kernel/uvm/Makefile          |   1 +
- kernel/uvm/conftest.sh       |   4 +
- kernel/uvm/nvidia_uvm_lite.c |  29 ++++-
- 12 files changed, 431 insertions(+), 14 deletions(-)
-
-diff --git a/kernel/Makefile b/kernel/Makefile
-index 125a690..2597080 100644
---- a/kernel/Makefile
-+++ b/kernel/Makefile
-@@ -108,12 +108,14 @@ COMPILE_TESTS = \
- 	acquire_console_sem \
- 	console_lock \
- 	kmem_cache_create \
-+	kmem_cache_create_usercopy \
- 	outer_flush_all \
- 	on_each_cpu \
- 	smp_call_function \
- 	nvmap_support \
- 	acpi_evaluate_integer \
- 	ioremap_cache \
-+	ioremap_nocache \
- 	ioremap_wc \
- 	proc_dir_entry \
- 	INIT_WORK \
-@@ -122,6 +124,7 @@ COMPILE_TESTS = \
- 	pci_domain_nr \
- 	pci_dma_mapping_error \
- 	file_operations \
-+	proc_ops \
- 	sg_alloc_table \
- 	sg_init_table \
- 	pci_get_domain_bus_and_slot \
-@@ -147,6 +150,8 @@ COMPILE_TESTS = \
- 	vm_fault_present \
- 	vm_fault_has_address \
- 	drm_driver_unload_has_int_return_type \
-+	drm_get_pci_dev \
-+	drm_pci_init \
- 	drm_legacy_pci_init \
- 	timer_setup \
- 	do_gettimeofday \
-diff --git a/kernel/conftest.sh b/kernel/conftest.sh
-index b7a85f0..a5225e5 100755
---- a/kernel/conftest.sh
-+++ b/kernel/conftest.sh
-@@ -176,6 +176,7 @@ test_headers() {
-     FILES="$FILES linux/ktime.h"
-     FILES="$FILES linux/file.h"
- 
-+    FILES_ARCH="$FILES_ARCH asm/pgtable.h"
-     FILES_ARCH="$FILES_ARCH asm/set_memory.h"
- 
-     translate_and_find_header_files $HEADERS      $FILES
-@@ -440,6 +441,9 @@ compile_test() {
-             # Determine if the set_memory_array_uc() function is present.
-             #
-             CODE="
-+            #if defined(NV_ASM_PGTABLE_H_PRESENT)
-+            #include <asm/pgtable.h>
-+            #endif
-             #if defined(NV_ASM_SET_MEMORY_H_PRESENT)
-             #include <asm/set_memory.h>
-             #else
-@@ -914,6 +918,21 @@ compile_test() {
-             fi
-         ;;
- 
-+        kmem_cache_create_usercopy)
-+            #
-+            # Determine if the kmem_cache_create_usercopy function exists.
-+            #
-+            # This function was added by:
-+            #   2017-06-10  8eb8284b412906181357c2b0110d879d5af95e52
-+            CODE="
-+            #include <linux/slab.h>
-+            void kmem_cache_create_usercopy(void) {
-+                kmem_cache_create_usercopy();
-+            }"
-+
-+            compile_check_conftest "$CODE" "NV_KMEM_CACHE_CREATE_USERCOPY_PRESENT" "" "functions"
-+        ;;
-+
-         smp_call_function)
-             #
-             # Determine if the smp_call_function() function is
-@@ -1188,6 +1207,22 @@ compile_test() {
-             compile_check_conftest "$CODE" "NV_IOREMAP_CACHE_PRESENT" "" "functions"
-         ;;
- 
-+        ioremap_nocache)
-+            #
-+            # Determine if the ioremap_nocache() function is present.
-+            #
-+            # Removed by commit 4bdc0d676a64 ("remove ioremap_nocache and
-+            # devm_ioremap_nocache") in v5.6 (2020-01-06)
-+            #
-+            CODE="
-+            #include <asm/io.h>
-+            void conftest_ioremap_nocache(void) {
-+                ioremap_nocache();
-+            }"
-+
-+            compile_check_conftest "$CODE" "NV_IOREMAP_NOCACHE_PRESENT" "" "functions"
-+        ;;
-+
-         ioremap_wc)
-             #
-             # Determine if the ioremap_wc() function is present.
-@@ -1371,6 +1406,16 @@ compile_test() {
-             compile_check_conftest "$CODE" "NV_FILE_OPERATIONS_HAS_COMPAT_IOCTL" "" "types"
-         ;;
- 
-+        proc_ops)
-+            CODE="
-+            #include <linux/proc_fs.h>
-+            int conftest_proc_ops(void) {
-+                return offsetof(struct proc_ops, proc_open);
-+            }"
-+
-+            compile_check_conftest "$CODE" "NV_HAVE_PROC_OPS" "" "types"
-+        ;;
-+
-         sg_init_table)
-             #
-             # Determine if the sg_init_table() function is present.
-@@ -2044,6 +2089,42 @@ compile_test() {
-             compile_check_conftest "$CODE" "NV_DRM_DRIVER_UNLOAD_HAS_INT_RETURN_TYPE" "" "types"
-         ;;
- 
-+        drm_get_pci_dev)
-+            #
-+            # Determine if drm_get_pci_dev() is present.
-+            #
-+            CODE="
-+            #if defined(NV_DRM_DRMP_H_PRESENT)
-+            #include <drm/drmP.h>
-+            #endif
-+
-+            #if defined(NV_DRM_DRM_PCI_H_PRESENT)
-+            #include <drm/drm_pci.h>
-+            #endif
-+
-+            void conftest_drm_legacy_pci_init(void) {
-+                drm_get_pci_dev();
-+            }"
-+
-+            compile_check_conftest "$CODE" "NV_DRM_GET_PCI_DEV_PRESENT" "" "functions"
-+        ;;
-+
-+        drm_pci_init)
-+            #
-+            # Determine if drm_pci_init() is present.
-+            #
-+            CODE="
-+            #if defined(NV_DRM_DRMP_H_PRESENT)
-+            #include <drm/drmP.h>
-+            #endif
-+
-+            void conftest_drm_legacy_pci_init(void) {
-+                drm_pci_init();
-+            }"
-+
-+            compile_check_conftest "$CODE" "NV_DRM_PCI_INIT_PRESENT" "" "functions"
-+        ;;
-+
-         drm_legacy_pci_init)
-             #
-             # Determine if drm_legacy_pci_init() is present. drm_pci_init() was
-diff --git a/kernel/dkms.conf b/kernel/dkms.conf
-index 79a02ae..3140f03 100644
---- a/kernel/dkms.conf
-+++ b/kernel/dkms.conf
-@@ -1,7 +1,13 @@
-+if [ -x /usr/bin/nproc ]; then
-+  num_cpu_cores=$(nproc)
-+else
-+  num_cpu_cores=1
-+fi
-+
- PACKAGE_NAME="nvidia"
- PACKAGE_VERSION="340.108"
- BUILT_MODULE_NAME[0]="$PACKAGE_NAME"
- DEST_MODULE_LOCATION[0]="/kernel/drivers/video"
--MAKE[0]="make module KERNEL_UNAME=${kernelver}"
-+MAKE[0]="make -j$num_cpu_cores module KERNEL_UNAME=${kernelver}"
- CLEAN="make clean"
- AUTOINSTALL="yes"
-diff --git a/kernel/nv-drm.c b/kernel/nv-drm.c
-index 0d1cdbf..85db07e 100644
---- a/kernel/nv-drm.c
-+++ b/kernel/nv-drm.c
-@@ -50,9 +50,236 @@
- #if defined(NV_DRM_LEGACY_PCI_INIT_PRESENT)
- #define nv_drm_pci_init drm_legacy_pci_init
- #define nv_drm_pci_exit drm_legacy_pci_exit
--#else
-+#elif defined(NV_DRM_PCI_INIT_PRESENT)
- #define nv_drm_pci_init drm_pci_init
- #define nv_drm_pci_exit drm_pci_exit
-+#else
-+#if defined(NV_DRM_GET_PCI_DEV_PRESENT)
-+#define nv_drm_get_pci_dev drm_get_pci_dev
-+#else
-+#include <drm/drm_agpsupport.h>
-+
-+struct nv_drm_agp_head {
-+    struct agp_kern_info agp_info;
-+    struct list_head memory;
-+    unsigned long mode;
-+    struct agp_bridge_data *bridge;
-+    int enabled;
-+    int acquired;
-+    unsigned long base;
-+    int agp_mtrr;
-+    int cant_use_aperture;
-+    unsigned long page_mask;
-+};
-+
-+struct nv_drm_agp_mem {
-+    unsigned long handle;
-+    struct agp_memory *memory;
-+    unsigned long bound;
-+    int pages;
-+    struct list_head head;
-+};
-+
-+/*
-+ * Code from drm_agp_init/nv_drm_{free,unbind}_agp
-+ * Extracted from commit: 5b8b9d0c6d0e0f1993c6c56deaf9646942c49d94, file: drivers/gpu/drm/drm_agpsupport.c
-+ */
-+struct drm_agp_head *nv_drm_agp_init(struct drm_device *dev)
-+{
-+    struct nv_drm_agp_head *head = NULL;
-+
-+    head = kzalloc(sizeof(*head), GFP_KERNEL);
-+    if (!head)
-+        return NULL;
-+    head->bridge = agp_find_bridge(dev->pdev);
-+    if (!head->bridge) {
-+        head->bridge = agp_backend_acquire(dev->pdev);
-+        if (!head->bridge) {
-+            kfree(head);
-+            return NULL;
-+        }
-+        agp_copy_info(head->bridge, &head->agp_info);
-+        agp_backend_release(head->bridge);
-+    } else {
-+        agp_copy_info(head->bridge, &head->agp_info);
-+    }
-+    if (head->agp_info.chipset == NOT_SUPPORTED) {
-+        kfree(head);
-+        return NULL;
-+    }
-+    INIT_LIST_HEAD(&head->memory);
-+    head->cant_use_aperture = head->agp_info.cant_use_aperture;
-+    head->page_mask = head->agp_info.page_mask;
-+    head->base = head->agp_info.aper_base;
-+    return (struct drm_agp_head *)head;
-+}
-+
-+void nv_drm_free_agp(struct agp_memory *handle, int pages)
-+{
-+    agp_free_memory(handle);
-+}
-+
-+int nv_drm_unbind_agp(struct agp_memory *handle)
-+{
-+    return agp_unbind_memory(handle);
-+}
-+
-+/*
-+ * Code from drm_pci_agp_{clear,destroy,init}/drm_get_pci_dev
-+ * Extracted from commit: 5b8b9d0c6d0e0f1993c6c56deaf9646942c49d94, file: drivers/gpu/drm/drm_pci.c
-+ */
-+static void nv_drm_pci_agp_init(struct drm_device *dev)
-+{
-+    if (drm_core_check_feature(dev, DRIVER_USE_AGP)) {
-+        if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP))
-+            dev->agp = nv_drm_agp_init(dev);
-+        if (dev->agp) {
-+            dev->agp->agp_mtrr = arch_phys_wc_add(
-+                dev->agp->agp_info.aper_base,
-+                dev->agp->agp_info.aper_size *
-+                1024 * 1024);
-+        }
-+    }
-+}
-+
-+void nv_drm_legacy_agp_clear(struct drm_device *dev)
-+{
-+    struct nv_drm_agp_mem *entry, *tempe;
-+
-+    if (!dev->agp)
-+        return;
-+    if (!drm_core_check_feature(dev, DRIVER_LEGACY))
-+        return;
-+
-+    list_for_each_entry_safe(entry, tempe, &dev->agp->memory, head) {
-+        if (entry->bound)
-+            nv_drm_unbind_agp(entry->memory);
-+        nv_drm_free_agp(entry->memory, entry->pages);
-+        kfree(entry);
-+    }
-+    INIT_LIST_HEAD(&dev->agp->memory);
-+
-+    if (dev->agp->acquired)
-+        drm_agp_release(dev);
-+
-+    dev->agp->acquired = 0;
-+    dev->agp->enabled = 0;
-+}
-+
-+void nv_drm_pci_agp_destroy(struct drm_device *dev)
-+{
-+    if (dev->agp) {
-+        arch_phys_wc_del(dev->agp->agp_mtrr);
-+        nv_drm_legacy_agp_clear(dev);
-+        kfree(dev->agp);
-+        dev->agp = NULL;
-+    }
-+}
-+
-+static int nv_drm_get_pci_dev(struct pci_dev *pdev,
-+               const struct pci_device_id *ent,
-+               struct drm_driver *driver)
-+{
-+    struct drm_device *dev;
-+    int ret;
-+
-+    DRM_DEBUG("\n");
-+
-+    dev = drm_dev_alloc(driver, &pdev->dev);
-+    if (IS_ERR(dev))
-+        return PTR_ERR(dev);
-+
-+    ret = pci_enable_device(pdev);
-+    if (ret)
-+        goto err_free;
-+
-+    dev->pdev = pdev;
-+#ifdef __alpha__
-+    dev->hose = pdev->sysdata;
-+#endif
-+
-+    if (drm_core_check_feature(dev, DRIVER_MODESET))
-+        pci_set_drvdata(pdev, dev);
-+
-+    nv_drm_pci_agp_init(dev);
-+
-+    ret = drm_dev_register(dev, ent->driver_data);
-+    if (ret)
-+        goto err_agp;
-+
-+    /* No locking needed since shadow-attach is single-threaded since it may
-+     * only be called from the per-driver module init hook. */
-+    if (drm_core_check_feature(dev, DRIVER_LEGACY))
-+        list_add_tail(&dev->legacy_dev_list, &driver->legacy_dev_list);
-+
-+    return 0;
-+
-+err_agp:
-+    nv_drm_pci_agp_destroy(dev);
-+    pci_disable_device(pdev);
-+err_free:
-+    drm_dev_put(dev);
-+    return ret;
-+}
-+#endif
-+
-+/*
-+ * Code from drm_legacy_pci_{init,exit}
-+ * Extracted from tag: v5.6.3, file: drivers/gpu/drm/drm_pci.c
-+ */
-+int nv_drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver)
-+{
-+    struct pci_dev *pdev = NULL;
-+    const struct pci_device_id *pid;
-+    int i;
-+
-+    DRM_DEBUG("\n");
-+
-+    if (WARN_ON(!(driver->driver_features & DRIVER_LEGACY)))
-+        return -EINVAL;
-+
-+    /* If not using KMS, fall back to stealth mode manual scanning. */
-+    INIT_LIST_HEAD(&driver->legacy_dev_list);
-+    for (i = 0; pdriver->id_table[i].vendor != 0; i++) {
-+        pid = &pdriver->id_table[i];
-+
-+        /* Loop around setting up a DRM device for each PCI device
-+         * matching our ID and device class.  If we had the internal
-+         * function that pci_get_subsys and pci_get_class used, we'd
-+         * be able to just pass pid in instead of doing a two-stage
-+         * thing.
-+         */
-+        pdev = NULL;
-+        while ((pdev =
-+            pci_get_subsys(pid->vendor, pid->device, pid->subvendor,
-+                       pid->subdevice, pdev)) != NULL) {
-+            if ((pdev->class & pid->class_mask) != pid->class)
-+                continue;
-+
-+            /* stealth mode requires a manual probe */
-+            pci_dev_get(pdev);
-+            nv_drm_get_pci_dev(pdev, pid, driver);
-+        }
-+    }
-+    return 0;
-+}
-+
-+void nv_drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver)
-+{
-+    struct drm_device *dev, *tmp;
-+    DRM_DEBUG("\n");
-+
-+    if (!(driver->driver_features & DRIVER_LEGACY)) {
-+        WARN_ON(1);
-+    } else {
-+        list_for_each_entry_safe(dev, tmp, &driver->legacy_dev_list,
-+                     legacy_dev_list) {
-+            list_del(&dev->legacy_dev_list);
-+            drm_put_dev(dev);
-+        }
-+    }
-+    DRM_INFO("Module unloaded\n");
-+}
- #endif
- 
- extern nv_linux_state_t *nv_linux_devices;
-diff --git a/kernel/nv-linux.h b/kernel/nv-linux.h
-index a1d2c68..83e6433 100644
---- a/kernel/nv-linux.h
-+++ b/kernel/nv-linux.h
-@@ -688,11 +688,16 @@ extern nv_spinlock_t km_lock;
-         VM_ALLOC_RECORD(ptr, size, "vm_ioremap"); \
-     }
- 
-+#if defined(NV_IOREMAP_NOCACHE_PRESENT)
- #define NV_IOREMAP_NOCACHE(ptr, physaddr, size) \
-     { \
-         (ptr) = ioremap_nocache(physaddr, size); \
-         VM_ALLOC_RECORD(ptr, size, "vm_ioremap_nocache"); \
-     }
-+#else
-+#define NV_IOREMAP_NOCACHE(ptr, physaddr, size) \
-+    NV_IOREMAP(ptr, physaddr, size)
-+#endif
- 
- #if defined(NV_IOREMAP_CACHE_PRESENT)
- #define NV_IOREMAP_CACHE(ptr, physaddr, size)            \
-@@ -774,6 +779,17 @@ extern nv_spinlock_t km_lock;
- #error "NV_KMEM_CACHE_CREATE() undefined (kmem_cache_create() unavailable)!"
- #endif
- 
-+#if defined(NV_KMEM_CACHE_CREATE_USERCOPY_PRESENT)
-+#define NV_KMEM_CACHE_CREATE_USERCOPY(kmem_cache, name, type)       \
-+    {                                                               \
-+        kmem_cache = kmem_cache_create_usercopy(name, sizeof(type), \
-+                        0, 0, 0, sizeof(type), NULL);               \
-+    }
-+#else
-+#define NV_KMEM_CACHE_CREATE_USERCOPY(kmem_cache, name, type)       \
-+        NV_KMEM_CACHE_CREATE(kmem_cache, name, type)
-+#endif
-+
- #define NV_KMEM_CACHE_ALLOC(ptr, kmem_cache, type)              \
-     {                                                           \
-         (ptr) = kmem_cache_alloc(kmem_cache, GFP_KERNEL);       \
-@@ -1971,6 +1987,19 @@ extern NvU32 nv_assign_gpu_count;
-     })
- #endif
- 
-+#if defined(NV_HAVE_PROC_OPS)
-+#define NV_CREATE_PROC_FILE(filename,parent,__name,__data)               \
-+   ({                                                                    \
-+        struct proc_dir_entry *__entry;                                  \
-+        int mode = (S_IFREG | S_IRUGO);                                  \
-+        const struct proc_ops *fops = &nv_procfs_##__name##_fops;        \
-+        if (fops->proc_write != 0)                                       \
-+            mode |= S_IWUSR;                                             \
-+        __entry = NV_CREATE_PROC_ENTRY(filename, mode, parent, fops,     \
-+            __data);                                                     \
-+        __entry;                                                         \
-+    })
-+#else
- #define NV_CREATE_PROC_FILE(filename,parent,__name,__data)               \
-    ({                                                                    \
-         struct proc_dir_entry *__entry;                                  \
-@@ -1982,6 +2011,7 @@ extern NvU32 nv_assign_gpu_count;
-             __data);                                                     \
-         __entry;                                                         \
-     })
-+#endif
- 
- /*
-  * proc_mkdir_mode exists in Linux 2.6.9, but isn't exported until Linux 3.0.
-@@ -2023,6 +2053,24 @@ extern NvU32 nv_assign_gpu_count;
-     remove_proc_entry(entry->name, entry->parent);
- #endif
- 
-+#if defined(NV_HAVE_PROC_OPS)
-+#define NV_DEFINE_PROCFS_SINGLE_FILE(__name)                                  \
-+    static int nv_procfs_open_##__name(                                       \
-+        struct inode *inode,                                                  \
-+        struct file *filep                                                    \
-+    )                                                                         \
-+    {                                                                         \
-+        return single_open(filep, nv_procfs_read_##__name,                    \
-+            NV_PDE_DATA(inode));                                              \
-+    }                                                                         \
-+                                                                              \
-+    static const struct proc_ops nv_procfs_##__name##_fops = {                \
-+        .proc_open       = nv_procfs_open_##__name,                           \
-+        .proc_read       = seq_read,                                          \
-+        .proc_lseek      = seq_lseek,                                         \
-+        .proc_release    = single_release,                                    \
-+    };
-+#else
- #define NV_DEFINE_PROCFS_SINGLE_FILE(__name)                                  \
-     static int nv_procfs_open_##__name(                                       \
-         struct inode *inode,                                                  \
-@@ -2040,6 +2088,7 @@ extern NvU32 nv_assign_gpu_count;
-         .llseek     = seq_lseek,                                              \
-         .release    = single_release,                                         \
-     };
-+#endif
- 
- #endif  /* CONFIG_PROC_FS */
- 
-diff --git a/kernel/nv-procfs.c b/kernel/nv-procfs.c
-index ebca3e8..9365c3c 100644
---- a/kernel/nv-procfs.c
-+++ b/kernel/nv-procfs.c
-@@ -409,6 +409,15 @@ done:
-     return ((status < 0) ? status : (int)count);
- }
- 
-+#if defined(NV_HAVE_PROC_OPS)
-+static struct proc_ops nv_procfs_registry_fops = {
-+    .proc_open    = nv_procfs_open_registry,
-+    .proc_read    = seq_read,
-+    .proc_write   = nv_procfs_write_file,
-+    .proc_lseek   = seq_lseek,
-+    .proc_release = nv_procfs_close_registry,
-+};
-+#else
- static struct file_operations nv_procfs_registry_fops = {
-     .owner   = THIS_MODULE,
-     .open    = nv_procfs_open_registry,
-@@ -417,6 +426,7 @@ static struct file_operations nv_procfs_registry_fops = {
-     .llseek  = seq_lseek,
-     .release = nv_procfs_close_registry,
- };
-+#endif
- 
- static int
- nv_procfs_read_unbind_lock(
-@@ -538,6 +548,15 @@ done:
-     return rc;
- }
- 
-+#if defined(NV_HAVE_PROC_OPS)
-+static struct proc_ops nv_procfs_unbind_lock_fops = {
-+    .proc_open    = nv_procfs_open_unbind_lock,
-+    .proc_read    = seq_read,
-+    .proc_write   = nv_procfs_write_file,
-+    .proc_lseek   = seq_lseek,
-+    .proc_release = nv_procfs_close_unbind_lock,
-+};
-+#else
- static struct file_operations nv_procfs_unbind_lock_fops = {
-     .owner   = THIS_MODULE,
-     .open    = nv_procfs_open_unbind_lock,
-@@ -546,6 +565,7 @@ static struct file_operations nv_procfs_unbind_lock_fops = {
-     .llseek  = seq_lseek,
-     .release = nv_procfs_close_unbind_lock,
- };
-+#endif
- 
- static int
- nv_procfs_read_text_file(
-diff --git a/kernel/nv-time.h b/kernel/nv-time.h
-index a34ceb2..780f8bc 100644
---- a/kernel/nv-time.h
-+++ b/kernel/nv-time.h
-@@ -28,7 +28,12 @@
- #include <linux/ktime.h>
- #endif
- 
--static inline void nv_gettimeofday(struct timeval *tv)
-+struct nv_timeval {
-+    __kernel_long_t      tv_sec;
-+    __kernel_suseconds_t tv_usec;
-+};
-+
-+static inline void nv_gettimeofday(struct nv_timeval *tv)
- {
- #ifdef NV_DO_GETTIMEOFDAY_PRESENT
-     do_gettimeofday(tv);
-@@ -37,7 +42,7 @@ static inline void nv_gettimeofday(struct timeval *tv)
- 
-     ktime_get_real_ts64(&now);
- 
--    *tv = (struct timeval) {
-+    *tv = (struct nv_timeval) {
-         .tv_sec = now.tv_sec,
-         .tv_usec = now.tv_nsec/1000,
-     };
-diff --git a/kernel/nv.c b/kernel/nv.c
-index a167be9..a218f83 100644
---- a/kernel/nv.c
-+++ b/kernel/nv.c
-@@ -752,7 +752,7 @@ int __init nvidia_init_module(void)
-     NV_SPIN_LOCK_INIT(&km_lock);
- #endif
- 
--    NV_KMEM_CACHE_CREATE(nv_stack_t_cache, NV_STACK_CACHE_STR, nv_stack_t);
-+    NV_KMEM_CACHE_CREATE_USERCOPY(nv_stack_t_cache, NV_STACK_CACHE_STR, nv_stack_t);
-     if (nv_stack_t_cache == NULL)
-     {
-         nv_printf(NV_DBG_ERRORS, "NVRM: stack cache allocation failed!\n");
-diff --git a/kernel/os-interface.c b/kernel/os-interface.c
-index 7190b26..0c0dc05 100644
---- a/kernel/os-interface.c
-+++ b/kernel/os-interface.c
-@@ -439,7 +439,7 @@ RM_STATUS NV_API_CALL os_get_current_time(
-     NvU32 *useconds
- )
- {
--    struct timeval tm;
-+    struct nv_timeval tm;
- 
-     nv_gettimeofday(&tm);
- 
-@@ -474,7 +474,7 @@ RM_STATUS NV_API_CALL os_delay_us(NvU32 MicroSeconds)
-     unsigned long usec;
- 
- #ifdef NV_CHECK_DELAY_ACCURACY
--    struct timeval tm1, tm2;
-+    struct nv_timeval tm1, tm2;
- 
-     nv_gettimeofday(&tm1);
- #endif
-@@ -514,9 +514,9 @@ RM_STATUS NV_API_CALL os_delay(NvU32 MilliSeconds)
-     unsigned long MicroSeconds;
-     unsigned long jiffies;
-     unsigned long mdelay_safe_msec;
--    struct timeval tm_end, tm_aux;
-+    struct nv_timeval tm_end, tm_aux;
- #ifdef NV_CHECK_DELAY_ACCURACY
--    struct timeval tm_start;
-+    struct nv_timeval tm_start;
- #endif
- 
-     nv_gettimeofday(&tm_aux);
-diff --git a/kernel/uvm/Makefile b/kernel/uvm/Makefile
-index 0cad8ff..043a08d 100644
---- a/kernel/uvm/Makefile
-+++ b/kernel/uvm/Makefile
-@@ -207,6 +207,7 @@ ccflags-y += $(EXTRA_CFLAGS)
- 
- RM_MODULE_SYMVERS:= $(RM_OUT_DIR)/Module.symvers
- UVM_MODULE_SYMVERS:= $(obj)/Module.symvers
-+KBUILD_EXTRA_SYMBOLS:= $(UVM_MODULE_SYMVERS)
- 
- module $(MODULE_NAME).ko: $(UVM_MODULE_SYMVERS) debug_diagnostics_printing
- 
-diff --git a/kernel/uvm/conftest.sh b/kernel/uvm/conftest.sh
-index b7a85f0..33e2a63 100755
---- a/kernel/uvm/conftest.sh
-+++ b/kernel/uvm/conftest.sh
-@@ -176,6 +176,7 @@ test_headers() {
-     FILES="$FILES linux/ktime.h"
-     FILES="$FILES linux/file.h"
- 
-+    FILES_ARCH="$FILES_ARCH asm/pgtable.h"
-     FILES_ARCH="$FILES_ARCH asm/set_memory.h"
- 
-     translate_and_find_header_files $HEADERS      $FILES
-@@ -440,6 +441,9 @@ compile_test() {
-             # Determine if the set_memory_array_uc() function is present.
-             #
-             CODE="
-+            #if defined(NV_ASM_PGTABLE_H_PRESENT)
-+            #include <asm/pgtable.h>
-+            #endif
-             #if defined(NV_ASM_SET_MEMORY_H_PRESENT)
-             #include <asm/set_memory.h>
-             #else
-diff --git a/kernel/uvm/nvidia_uvm_lite.c b/kernel/uvm/nvidia_uvm_lite.c
-index 6943e7c..9a7e3b6 100644
---- a/kernel/uvm/nvidia_uvm_lite.c
-+++ b/kernel/uvm/nvidia_uvm_lite.c
-@@ -131,8 +131,8 @@ static
- RM_STATUS _preexisting_error_on_channel(UvmGpuMigrationTracking *pMigTracker,
-                                          UvmCommitRecord *pRecord);
- 
--static void _set_timeout_in_usec(struct timeval *src,
--                                 struct timeval *result,
-+static void _set_timeout_in_usec(struct nv_timeval *src,
-+                                 struct nv_timeval *result,
-                                  unsigned long timeoutInUsec)
- {
-     if (!src || !result)
-@@ -820,7 +820,13 @@ done:
- }
- 
- #if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
-+vm_fault_t _fault(struct vm_fault *vmf)
-+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
-+int _fault(struct vm_fault *vmf)
-+#else
- int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)
-+#endif
- {
- #if defined(NV_VM_FAULT_HAS_ADDRESS)
-     unsigned long vaddr = vmf->address;
-@@ -828,8 +834,15 @@ int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)
-     unsigned long vaddr = (unsigned long)vmf->virtual_address;
- #endif
-     struct page *page = NULL;
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
-+    vm_fault_t retval;
-+#else
-     int retval;
- 
-+#endif
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
-+   struct vm_area_struct *vma = vmf->vma;
-+#endif
-     retval = _fault_common(vma, vaddr, &page, vmf->flags);
- 
-     vmf->page = page;
-@@ -868,7 +881,13 @@ static struct vm_operations_struct uvmlite_vma_ops =
- // it's dealing with anonymous mapping (see handle_pte_fault).
- //
- #if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
-+vm_fault_t _sigbus_fault(struct vm_fault *vmf)
-+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
-+int _sigbus_fault(struct vm_fault *vmf)
-+#else
- int _sigbus_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
-+#endif
- {
-     vmf->page = NULL;
-     return VM_FAULT_SIGBUS;
-@@ -1992,9 +2011,9 @@ void umvlite_destroy_per_process_gpu_resources(UvmGpuUuid *gpuUuidStruct)
- static RM_STATUS _check_ecc_errors(UvmGpuMigrationTracking *pMigTracker,
-                                     NvBool *pIsEccErrorSet)
- {
--    struct timeval eccErrorStartTime = {0};
--    struct timeval eccErrorCurrentTime = {0};
--    struct timeval eccTimeout = {0};
-+    struct nv_timeval eccErrorStartTime = {0};
-+    struct nv_timeval eccErrorCurrentTime = {0};
-+    struct nv_timeval eccTimeout = {0};
-     NvBool bEccErrorTimeout = NV_FALSE;
-     NvBool bEccIncomingError = NV_FALSE;
-     unsigned rmInterruptSet = 0;
--- 
-2.29.0
-
diff --git a/srcpkgs/nvidia340/files/nvidia-glx.conf b/srcpkgs/nvidia340/files/nvidia-glx.conf
deleted file mode 100644
index 7c76883abb3..00000000000
--- a/srcpkgs/nvidia340/files/nvidia-glx.conf
+++ /dev/null
@@ -1,4 +0,0 @@
-Section "Files"
-    ModulePath "/usr/lib/nvidia/xorg"
-    ModulePath "/usr/lib/xorg/modules"
-EndSection
diff --git a/srcpkgs/nvidia340/template b/srcpkgs/nvidia340/template
deleted file mode 100644
index 166f35756bc..00000000000
--- a/srcpkgs/nvidia340/template
+++ /dev/null
@@ -1,223 +0,0 @@
-# Template file for 'nvidia340'
-
-_desc="NVIDIA drivers (GeForce 8, 9, 9M, 100, 100M, 200, 300 series)"
-
-pkgname=nvidia340
-version=340.108
-revision=4
-maintainer="Orphaned <orphan@voidlinux.org>"
-license="custom:NVIDIA proprietary"
-homepage="http://www.nvidia.com"
-
-archs="i686 x86_64"
-nopie=yes
-repository=nonfree
-create_wrksrc=yes
-short_desc="${_desc} - Libraries and Utilities"
-hostmakedepends="tar"
-depends="${pkgname}-dkms-${version}_${revision} pkg-config"
-conflicts="catalyst>=0 xserver-abi-video>24_1"
-
-provides="nvidia-${version}_${revision}"
-replaces="nvidia>=0 nvidia-stable>=0"
-subpackages="${pkgname}-dkms ${pkgname}-opencl ${pkgname}-libs"
-
-if [ "$XBPS_TARGET_MACHINE" = "i686" ]; then
-	_pkg="NVIDIA-Linux-x86-${version}"
-	distfiles="http://us.download.nvidia.com/XFree86/Linux-x86/${version}/${_pkg}.run"
-	checksum=2032aad612d9f3af1aecf979cfdfe423d79aa76929ef8bf8d3a403076f507cca
-else
-	_pkg="NVIDIA-Linux-x86_64-${version}-no-compat32"
-	distfiles="http://us.download.nvidia.com/XFree86/Linux-x86_64/${version}/${_pkg}.run"
-	checksum=995d44fef587ff5284497a47a95d71adbee0c13020d615e940ac928f180f5b77
-fi
-
-do_extract() {
-	install -m755 ${XBPS_SRCDISTDIR}/${pkgname}-${version}/${_pkg}.run ${wrksrc}
-	cd ${wrksrc}
-	./${_pkg}.run --extract-only
-	rm -f ${_pkg}.run
-}
-
-do_patch() {
-	cd ${_pkg}
-	patch -p1 < ${FILESDIR}/kernel-5.x.patch
-	patch -p1 < ${FILESDIR}/kernel-5.8.patch
-	patch -p1 < ${FILESDIR}/kernel-5.9.patch
-}
-
-do_install() {
-	cd ${_pkg}
-
-	# X driver
-	vinstall nvidia_drv.so 755 usr/lib/xorg/modules/drivers
-
-	# GLX extension module for X
-	vinstall libglx.so.${version} 755 usr/lib/nvidia/xorg
-	ln -sf libglx.so.${version} ${DESTDIR}/usr/lib/nvidia/xorg/libglx.so.1
-	ln -sf libglx.so.${version} ${DESTDIR}/usr/lib/nvidia/xorg/libglx.so
-	# Override default ModulePath to load nvidia's glx instead of xorg's
-	vinstall ${FILESDIR}/nvidia-glx.conf 644 /usr/share/X11/xorg.conf.d 10-nvidia-glx.conf
-
-	# OpenGL libraries (GL, EGL and GLES)
-	vinstall libGL.so.${version} 755 usr/lib
-	ln -sf libGL.so.${version} ${DESTDIR}/usr/lib/libGL.so.1
-	vinstall libEGL.so.${version} 755 usr/lib
-	ln -sf libEGL.so.${version} ${DESTDIR}/usr/lib/libEGL.so.1
-	vinstall libGLESv1_CM.so.${version} 755 usr/lib
-	ln -sf libGLESv1_CM.so.${version} ${DESTDIR}/usr/lib/libGLESv1_CM.so.1
-	vinstall libGLESv2.so.${version} 755 usr/lib
-	ln -sf libGLESv2.so.${version} ${DESTDIR}/usr/lib/libGLESv2.so.2
-	# Some programs link to these libglvnd links
-	ln -sf libGL.so.1 ${DESTDIR}/usr/lib/libOpenGL.so.0
-	ln -sf libGL.so.1 ${DESTDIR}/usr/lib/libGLX.so.0
-
-	# OpenGL core library
-	vinstall libnvidia-glcore.so.${version} 755 usr/lib
-	ln -sf libnvidia-glcore.so.${version} ${DESTDIR}/usr/lib/libnvidia-glcore.so
-
-	# VDPAU
-	vinstall libvdpau_nvidia.so.${version} 755 usr/lib/vdpau
-	ln -sf libvdpau_nvidia.so.${version} ${DESTDIR}/usr/lib/vdpau/libvdpau_nvidia.so
-	ln -sf libvdpau_nvidia.so.${version} ${DESTDIR}/usr/lib/vdpau/libvdpau_nvidia.so.1
-
-	# misc libraries
-	vinstall tls/libnvidia-tls.so.${version} 755 usr/lib
-	ln -sf libnvidia-tls.so.${version} ${DESTDIR}/usr/lib/libnvidia-tls.so
-
-	vinstall libnvidia-cfg.so.${version} 755 usr/lib
-	ln -sf libnvidia-cfg.so.${version} ${DESTDIR}/usr/lib/libnvidia-cfg.so
-	ln -sf libnvidia-cfg.so.${version} ${DESTDIR}/usr/lib/libnvidia-cfg.so.1
-
-	vinstall libnvidia-ml.so.${version} 755 usr/lib
-	ln -sf libnvidia-ml.so.${version} ${DESTDIR}/usr/lib/libnvidia-ml.so
-	ln -sf libnvidia-ml.so.${version} ${DESTDIR}/usr/lib/libnvidia-ml.so.1
-
-	vinstall libnvidia-encode.so.${version} 755 usr/lib
-	ln -sf libnvidia-encode.so.${version} ${DESTDIR}/usr/lib/libnvidia-encode.so
-	ln -sf libnvidia-encode.so.${version} ${DESTDIR}/usr/lib/libnvidia-encode.so.1
-
-	vinstall libnvidia-ifr.so.${version} 755 usr/lib
-	ln -sf libnvidia-ifr.so.${version} ${DESTDIR}/usr/lib/libnvidia-ifr.so
-	ln -sf libnvidia-ifr.so.${version} ${DESTDIR}/usr/lib/libnvidia-ifr.so.1
-
-	vinstall libnvidia-fbc.so.${version} 755 usr/lib
-	ln -sf libnvidia-fbc.so.${version} ${DESTDIR}/usr/lib/libnvidia-fbc.so
-	ln -sf libnvidia-fbc.so.${version} ${DESTDIR}/usr/lib/libnvidia-fbc.so.1
-
-	vinstall libnvidia-glsi.so.${version} 755 usr/lib
-
-	# CUDA
-	vbin nvidia-cuda-mps-control
-	vbin nvidia-cuda-mps-server
-	vman nvidia-cuda-mps-control.1.gz
-
-	vinstall libcuda.so.${version} 755 usr/lib
-	ln -sf libcuda.so.${version} ${DESTDIR}/usr/lib/libcuda.so
-	ln -sf libcuda.so.${version} ${DESTDIR}/usr/lib/libcuda.so.1
-
-	vinstall libnvcuvid.so.${version} 755 usr/lib
-	ln -sf libnvcuvid.so.${version} ${DESTDIR}/usr/lib/libnvcuvid.so
-	ln -sf libnvcuvid.so.${version} ${DESTDIR}/usr/lib/libnvcuvid.so.1
-
-	# nvidia-xconfig
-	vbin nvidia-xconfig
-	vman nvidia-xconfig.1.gz
-
-	# nvidia-settings
-	vbin nvidia-settings
-	vman nvidia-settings.1.gz
-	vinstall nvidia-settings.desktop 644 usr/share/applications
-	vinstall nvidia-settings.png 644 usr/share/pixmaps
-	sed -e 's:__UTILS_PATH__:/usr/bin:' \
-		-e 's:__PIXMAP_PATH__:/usr/share/pixmaps:' \
-		-i ${DESTDIR}/usr/share/applications/nvidia-settings.desktop
-
-	# nvidia-bug-report
-	vbin nvidia-bug-report.sh nvidia-bug-report
-	vbin nvidia-debugdump
-
-	# nvidia-smi
-	vbin nvidia-smi
-	vman nvidia-smi.1.gz
-
-	# License and documentation.
-	vlicense LICENSE
-	vdoc README.txt README
-	vdoc NVIDIA_Changelog
-
-	# opencl pkg
-	vinstall nvidia.icd 644 etc/OpenCL/vendors
-
-	vinstall libnvidia-compiler.so.${version} 755 usr/lib
-	ln -sf libnvidia-compiler.so.${version} \
-		${DESTDIR}/usr/lib/libnvidia-compiler.so
-	ln -sf libnvidia-compiler.so.${version} \
-		${DESTDIR}/usr/lib/libnvidia-compiler.so.1
-
-	vinstall libnvidia-opencl.so.${version} 755 usr/lib
-	ln -sf libnvidia-opencl.so.${version} \
-		${DESTDIR}/usr/lib/libnvidia-opencl.so
-	ln -sf libnvidia-opencl.so.${version} \
-		${DESTDIR}/usr/lib/libnvidia-opencl.so.1
-
-	# dkms pkg
-	vmkdir usr/src/nvidia-${version}
-	# add nvidia-uvm dkms submodule too.
-	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
-		cat kernel/uvm/dkms.conf.fragment >> kernel/dkms.conf
-	fi
-	vcopy "kernel/*" usr/src/nvidia-${version}
-
-	# systemd modules-load.d(5) file.
-	vmkdir usr/lib/modules-load.d
-	echo "nvidia" > ${DESTDIR}/usr/lib/modules-load.d/nvidia.conf
-	chmod 644 ${DESTDIR}/usr/lib/modules-load.d/nvidia.conf
-	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
-		echo "nvidia-uvm" > ${DESTDIR}/usr/lib/modules-load.d/nvidia-uvm.conf
-		chmod 644 ${DESTDIR}/usr/lib/modules-load.d/nvidia-uvm.conf
-	fi
-
-	# Blacklist nouveau.
-	vmkdir usr/lib/modprobe.d
-	echo "blacklist nouveau" > ${DESTDIR}/usr/lib/modprobe.d/nvidia.conf
-	chmod 644 ${DESTDIR}/usr/lib/modprobe.d/nvidia.conf
-
-	# Omit drm dracut module too.
-	vmkdir usr/lib/dracut/dracut.conf.d
-	echo "omit_dracutmodules+=\" drm \"" > ${DESTDIR}/usr/lib/dracut/dracut.conf.d/99-nvidia.conf
-}
-
-nvidia340-dkms_package() {
-	short_desc="${_desc} - DKMS kernel module"
-	dkms_modules="nvidia ${version}"
-	depends="dkms"
-	provides="nvidia-dkms-${version}_${revision}"
-	replaces="nvidia-dkms>=0 nvidia-stable-dkms>=0"
-	pkg_install() {
-		vmove usr/src
-		vmove usr/lib/modules-load.d
-		vmove usr/lib/modprobe.d
-		vmove usr/lib/dracut
-	}
-}
-nvidia340-opencl_package() {
-	short_desc="${_desc} - OpenCL implementation"
-	provides="nvidia-opencl-${version}_${revision}"
-	replaces="nvidia-opencl>=0 nvidia-stable-opencl>=0"
-	depends="libOpenCL"
-	pkg_install() {
-		vmove "usr/lib/libnvidia-compiler*"
-		vmove "usr/lib/libnvidia-opencl*"
-		vmove etc/OpenCL
-	}
-}
-nvidia340-libs_package() {
-	short_desc="${_desc} - libraries"
-	provides="libGL-7.11_1 libEGL-7.11_1 libGLES-7.11_1 libglvnd-1.3.0_1"
-	shlib_provides="libGLX.so.0 libOpenGL.so.0"
-	replaces="libGL>=0 libEGL>=0 libGLES>=0 libglvnd>=0"
-	pkg_install() {
-		vmove usr/lib
-	}
-}
diff --git a/srcpkgs/nvidia340/update b/srcpkgs/nvidia340/update
deleted file mode 100644
index 43bad67f7e8..00000000000
--- a/srcpkgs/nvidia340/update
+++ /dev/null
@@ -1,2 +0,0 @@
-site="http://www.nvidia.com/object/unix.html"
-pattern='340.+>\K[\d.]+(?=</A>)'

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PR PATCH] [Updated] nvidia340: remove
  2020-12-19 22:50 [PR PATCH] nvidia340: remove abenson
@ 2021-01-09  4:15 ` abenson
  2021-01-09 18:50 ` abenson
  2021-01-09 22:57 ` [PR PATCH] [Merged]: " abenson
  2 siblings, 0 replies; 4+ messages in thread
From: abenson @ 2021-01-09  4:15 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

There is an updated pull request by abenson against master on the void-packages repository

https://github.com/abenson/void-packages rm_nvidia340
https://github.com/void-linux/void-packages/pull/27287

nvidia340: remove


A patch file from https://github.com/void-linux/void-packages/pull/27287.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-rm_nvidia340-27287.patch --]
[-- Type: text/x-diff, Size: 47388 bytes --]

From 9c5da0bec0357e377d8cc22a9da021b1beca3c77 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Sat, 19 Dec 2020 16:49:32 -0600
Subject: [PATCH] nvidia340: remove

---
 common/shlibs                            |   3 -
 srcpkgs/nvidia340-dkms                   |   1 -
 srcpkgs/nvidia340-libs                   |   1 -
 srcpkgs/nvidia340-opencl                 |   1 -
 srcpkgs/nvidia340/INSTALL                |   7 -
 srcpkgs/nvidia340/INSTALL.msg            |  15 -
 srcpkgs/nvidia340/REMOVE                 |   7 -
 srcpkgs/nvidia340/files/kernel-5.8.patch |  92 ---
 srcpkgs/nvidia340/files/kernel-5.9.patch | 107 ----
 srcpkgs/nvidia340/files/kernel-5.x.patch | 781 -----------------------
 srcpkgs/nvidia340/files/nvidia-glx.conf  |   4 -
 srcpkgs/nvidia340/template               | 223 -------
 srcpkgs/nvidia340/update                 |   2 -
 srcpkgs/removed-packages/template        |   4 +
 14 files changed, 4 insertions(+), 1244 deletions(-)
 delete mode 120000 srcpkgs/nvidia340-dkms
 delete mode 120000 srcpkgs/nvidia340-libs
 delete mode 120000 srcpkgs/nvidia340-opencl
 delete mode 100644 srcpkgs/nvidia340/INSTALL
 delete mode 100644 srcpkgs/nvidia340/INSTALL.msg
 delete mode 100644 srcpkgs/nvidia340/REMOVE
 delete mode 100644 srcpkgs/nvidia340/files/kernel-5.8.patch
 delete mode 100644 srcpkgs/nvidia340/files/kernel-5.9.patch
 delete mode 100644 srcpkgs/nvidia340/files/kernel-5.x.patch
 delete mode 100644 srcpkgs/nvidia340/files/nvidia-glx.conf
 delete mode 100644 srcpkgs/nvidia340/template
 delete mode 100644 srcpkgs/nvidia340/update

diff --git a/common/shlibs b/common/shlibs
index de5cb65426e..760041a6657 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -131,16 +131,13 @@ libbrcmOpenVG.so rpi-userland-20180103_2
 libwayland-egl.so.1 wayland-1.15.0_4
 libnvidia-ml.so.1 nvidia-libs-346.47_1 ignore
 libnvidia-ml.so.1 nvidia304-libs-304.00_1 ignore
-libnvidia-ml.so.1 nvidia340-libs-340.46_1 ignore
 libnvidia-ml.so.1 nvidia390-libs-390.87_1 ignore
 libnvidia-tls.so.346.47 nvidia-libs-346.47_1 ignore
 libnvidia-glcore.so.346.47 nvidia-libs-346.47_1 ignore
 libnvidia-gtk2.so.346.47 nvidia-gtklibs-346.47_1 ignore
 libnvidia-gtk3.so.346.47 nvidia-gtklibs-346.47_1 ignore
-libnvidia-glcore.so.346.47 nvidia340-libs-340.46_1 ignore
 libnvidia-glcore.so.390.87 nvidia390-libs-390.87_1 ignore
 libnvidia-glsi.so.346.72 nvidia-libs-346.72_1 ignore
-libnvidia-glsi.so.340.107 nvidia340-libs-340.107_7 ignore
 libnvidia-fatbinaryloader.so.390.138 nvidia390-libs-390.138_1 ignore
 libnvidia-fatbinaryloader.so.430.40 nvidia-libs-430.40_1 ignore
 libglapi.so.0 libglapi-7.11_1
diff --git a/srcpkgs/nvidia340-dkms b/srcpkgs/nvidia340-dkms
deleted file mode 120000
index 383d067a70f..00000000000
--- a/srcpkgs/nvidia340-dkms
+++ /dev/null
@@ -1 +0,0 @@
-nvidia340
\ No newline at end of file
diff --git a/srcpkgs/nvidia340-libs b/srcpkgs/nvidia340-libs
deleted file mode 120000
index 383d067a70f..00000000000
--- a/srcpkgs/nvidia340-libs
+++ /dev/null
@@ -1 +0,0 @@
-nvidia340
\ No newline at end of file
diff --git a/srcpkgs/nvidia340-opencl b/srcpkgs/nvidia340-opencl
deleted file mode 120000
index 383d067a70f..00000000000
--- a/srcpkgs/nvidia340-opencl
+++ /dev/null
@@ -1 +0,0 @@
-nvidia340
\ No newline at end of file
diff --git a/srcpkgs/nvidia340/INSTALL b/srcpkgs/nvidia340/INSTALL
deleted file mode 100644
index 6b065bedb4a..00000000000
--- a/srcpkgs/nvidia340/INSTALL
+++ /dev/null
@@ -1,7 +0,0 @@
-# Regenerate initramfs.
-case ${ACTION} in
-post)
-	echo "Regenerating initramfs, please wait..."
-	dracut -f -q --regenerate-all
-	;;
-esac
diff --git a/srcpkgs/nvidia340/INSTALL.msg b/srcpkgs/nvidia340/INSTALL.msg
deleted file mode 100644
index 6301c36edbe..00000000000
--- a/srcpkgs/nvidia340/INSTALL.msg
+++ /dev/null
@@ -1,15 +0,0 @@
-> Remove from your /etc/X11/xorg.conf blocks like this:
-
-Section "Files"
-...
-EndSection
-
-This is known to happen when the configuration is generated by nvidia-xconfig.
-Such a section interferes with the "Files" Section provided by the package.
-
--------------------------------------------------------------------------------
-
-> If you wish to go back to nouveau:
-
-# xbps-remove nvidia340 nvidia340-dkms
-# xbps-install libglvnd
diff --git a/srcpkgs/nvidia340/REMOVE b/srcpkgs/nvidia340/REMOVE
deleted file mode 100644
index e4d494ca015..00000000000
--- a/srcpkgs/nvidia340/REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-# Regenerate initramfs.
-case ${ACTION} in
-purge)
-	echo "Regenerating initramfs, please wait..."
-	dracut -f -q --regenerate-all
-	;;
-esac
diff --git a/srcpkgs/nvidia340/files/kernel-5.8.patch b/srcpkgs/nvidia340/files/kernel-5.8.patch
deleted file mode 100644
index 1d8b1a40e1e..00000000000
--- a/srcpkgs/nvidia340/files/kernel-5.8.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-From 2cc3342b4b3c96bcc4062513011d35c079b009a2 Mon Sep 17 00:00:00 2001
-From: graysky <graysky@archlinux.us>
-Date: Thu, 22 Oct 2020 06:59:59 -0400
-Subject: [PATCH 2/3] kernel-5.8
-
-credit: https://launchpad.net/~kelebek333/+archive/ubuntu/nvidia-legacy/+packages
-extracted from: https://launchpadlibrarian.net/492468557/nvidia-graphics-drivers-340_340.108-1lmtrfocal3_340.108-2lmtrfocal.diff.gz
----
- kernel/nv-linux.h                | 8 ++++++++
- kernel/nvidia-modules-common.mk  | 1 +
- kernel/os-mlock.c                | 8 ++++++++
- kernel/uvm/nvidia_uvm_lite_api.c | 4 ++++
- 4 files changed, 21 insertions(+)
-
-diff --git a/kernel/nv-linux.h b/kernel/nv-linux.h
-index 83e6433..d055552 100644
---- a/kernel/nv-linux.h
-+++ b/kernel/nv-linux.h
-@@ -669,11 +669,19 @@ extern nv_spinlock_t km_lock;
- #  define KM_FREE_RECORD(a,b,c)
- #endif
- 
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
-+#define NV_VMALLOC(ptr, size)                     \
-+    {                                             \
-+        (ptr) = __vmalloc(size, GFP_KERNEL);      \
-+        VM_ALLOC_RECORD(ptr, size, "vm_vmalloc"); \
-+    }
-+#else
- #define NV_VMALLOC(ptr, size)                               \
-     {                                                       \
-         (ptr) = __vmalloc(size, GFP_KERNEL, PAGE_KERNEL);   \
-         VM_ALLOC_RECORD(ptr, size, "vm_vmalloc");           \
-     }
-+#endif
- 
- #define NV_VFREE(ptr, size)                         \
-     {                                               \
-diff --git a/kernel/nvidia-modules-common.mk b/kernel/nvidia-modules-common.mk
-index b94591b..0e4c228 100644
---- a/kernel/nvidia-modules-common.mk
-+++ b/kernel/nvidia-modules-common.mk
-@@ -222,6 +222,7 @@ build-sanity-checks:
- define BUILD_MODULE_RULE
-  $(1): build-sanity-checks $(3)
- 	@echo "NVIDIA: calling KBUILD..."; \
-+	touch .nv-kernel.o.cmd; \
- 	$$(MAKE) "CC=$$(CC)" NV_MODULE_SUFFIX=$$(strip $(2)) $$(KBUILD_PARAMS) modules; \
- 	echo "NVIDIA: left KBUILD."; \
- 	if ! [ -f $(1) ]; then \
-diff --git a/kernel/os-mlock.c b/kernel/os-mlock.c
-index 8a1fa2f..fc50543 100644
---- a/kernel/os-mlock.c
-+++ b/kernel/os-mlock.c
-@@ -44,11 +44,19 @@ RM_STATUS NV_API_CALL os_lock_user_pages(
-         return rmStatus;
-     }
- 
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
-+    down_read(&mm->mmap_lock);
-+    ret = NV_GET_USER_PAGES((unsigned long)address,
-+                            page_count, write, force, user_pages, NULL);
-+    up_read(&mm->mmap_lock);
-+    pinned = ret;
-+#else
-     down_read(&mm->mmap_sem);
-     ret = NV_GET_USER_PAGES((unsigned long)address,
-                             page_count, write, force, user_pages, NULL);
-     up_read(&mm->mmap_sem);
-     pinned = ret;
-+#endif
- 
-     if (ret < 0)
-     {
-diff --git a/kernel/uvm/nvidia_uvm_lite_api.c b/kernel/uvm/nvidia_uvm_lite_api.c
-index 8448eb6..97a4818 100644
---- a/kernel/uvm/nvidia_uvm_lite_api.c
-+++ b/kernel/uvm/nvidia_uvm_lite_api.c
-@@ -30,6 +30,10 @@
- #include "uvm_gpu_ops_tests.h"
- #endif
- 
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
-+#define mmap_sem mmap_lock
-+#endif
-+
- //
- // nvidia_uvm_lite_api.c
- //
--- 
-2.29.0
-
diff --git a/srcpkgs/nvidia340/files/kernel-5.9.patch b/srcpkgs/nvidia340/files/kernel-5.9.patch
deleted file mode 100644
index d8584314f24..00000000000
--- a/srcpkgs/nvidia340/files/kernel-5.9.patch
+++ /dev/null
@@ -1,107 +0,0 @@
-From fea401df7500bfbead5a42b1e74560dbddf2f5a3 Mon Sep 17 00:00:00 2001
-From: graysky <graysky@archlinux.us>
-Date: Thu, 22 Oct 2020 07:00:35 -0400
-Subject: [PATCH 3/3] kernel-5.9
-
-credit: https://github.com/warpme/minimyth2/blob/master/script/nvidia/nvidia-340.108/files/nvidia-340.108-fix-5.9-kernel-compile.patch
----
- kernel/nv-drm.c               | 8 ++++++++
- kernel/nv-linux.h             | 9 +++++++--
- kernel/nv.c                   | 4 ++++
- kernel/uvm/nvidia_uvm_linux.h | 2 ++
- 4 files changed, 21 insertions(+), 2 deletions(-)
-
-diff --git a/kernel/nv-drm.c b/kernel/nv-drm.c
-index 85db07e..f0c1299 100644
---- a/kernel/nv-drm.c
-+++ b/kernel/nv-drm.c
-@@ -415,7 +415,11 @@ static struct drm_driver nv_drm_driver = {
-     .set_busid = drm_pci_set_busid,
- #endif
- 
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
-+    .gem_free_object_unlocked = nv_gem_free,
-+#else
-     .gem_free_object = nv_gem_free,
-+#endif
- 
-     .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
-     .gem_prime_export = drm_gem_prime_export,
-@@ -511,8 +515,12 @@ RM_STATUS NV_API_CALL nv_alloc_os_descriptor_handle(
- 
- #if defined(NV_DRM_GEM_OBJECT_PUT_UNLOCKED_PRESENT)
-     drm_gem_object_put_unlocked(&nv_obj->base);
-+#else
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
-+    drm_gem_object_put_locked(&nv_obj->base);
- #else
-     drm_gem_object_unreference_unlocked(&nv_obj->base);
-+#endif
- #endif
- 
-     status = RM_OK;
-diff --git a/kernel/nv-linux.h b/kernel/nv-linux.h
-index d055552..524a8fe 100644
---- a/kernel/nv-linux.h
-+++ b/kernel/nv-linux.h
-@@ -136,8 +136,10 @@
- 
- #if defined(NVCPU_X86_64) && !defined(HAVE_COMPAT_IOCTL)
- #include <linux/syscalls.h>         /* sys_ioctl()                      */
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 9, 0)
- #include <linux/ioctl32.h>          /* register_ioctl32_conversion()    */
- #endif
-+#endif
- 
- #if !defined(NV_FILE_OPERATIONS_HAS_IOCTL) && \
-   !defined(NV_FILE_OPERATIONS_HAS_UNLOCKED_IOCTL)
-@@ -2249,10 +2251,13 @@ static inline NvU64 nv_node_end_pfn(int nid)
-                                             pages, vmas, NULL);
- 
-         #else
--
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
-+               return get_user_pages_remote(mm, start, nr_pages, flags,
-+                                            pages, vmas, NULL);
-+#else
-                return get_user_pages_remote(tsk, mm, start, nr_pages, flags,
-                                             pages, vmas);
--
-+#endif
-         #endif
- 
-         }
-diff --git a/kernel/nv.c b/kernel/nv.c
-index a218f83..be4e0f8 100644
---- a/kernel/nv.c
-+++ b/kernel/nv.c
-@@ -2785,7 +2785,11 @@ nvidia_probe
- 
- #if defined(CONFIG_VGA_ARB)
- #if defined(VGA_DEFAULT_DEVICE)
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
-+    vga_get(VGA_DEFAULT_DEVICE, VGA_RSRC_LEGACY_MASK, 0);
-+#else
-     vga_tryget(VGA_DEFAULT_DEVICE, VGA_RSRC_LEGACY_MASK);
-+#endif
- #endif
-     vga_set_legacy_decoding(dev, VGA_RSRC_NONE);
- #endif
-diff --git a/kernel/uvm/nvidia_uvm_linux.h b/kernel/uvm/nvidia_uvm_linux.h
-index 1625209..efc181f 100644
---- a/kernel/uvm/nvidia_uvm_linux.h
-+++ b/kernel/uvm/nvidia_uvm_linux.h
-@@ -158,8 +158,10 @@
- 
- #if defined(NVCPU_X86_64) && !defined(HAVE_COMPAT_IOCTL)
- #include <linux/syscalls.h>         /* sys_ioctl()                      */
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 9, 0)
- #include <linux/ioctl32.h>          /* register_ioctl32_conversion()    */
- #endif
-+#endif
- 
- #if !defined(NV_FILE_OPERATIONS_HAS_IOCTL) && \
-   !defined(NV_FILE_OPERATIONS_HAS_UNLOCKED_IOCTL)
--- 
-2.29.0
-
diff --git a/srcpkgs/nvidia340/files/kernel-5.x.patch b/srcpkgs/nvidia340/files/kernel-5.x.patch
deleted file mode 100644
index d7f763bbe39..00000000000
--- a/srcpkgs/nvidia340/files/kernel-5.x.patch
+++ /dev/null
@@ -1,781 +0,0 @@
-From 2154cc447a2377cfd60a7b7c5b619e689ebf71b1 Mon Sep 17 00:00:00 2001
-From: graysky <graysky@archlinux.us>
-Date: Thu, 22 Oct 2020 06:58:53 -0400
-Subject: [PATCH 1/3] kernel-5.7
-
-Contains a bunch of stuff required for things up to 5.7.
-credit: https://gitlab.manjaro.org/packages?utf8=%E2%9C%93&filter=nvidia-340xx
----
- kernel/Makefile              |   5 +
- kernel/conftest.sh           |  81 +++++++++++++
- kernel/dkms.conf             |   8 +-
- kernel/nv-drm.c              | 229 ++++++++++++++++++++++++++++++++++-
- kernel/nv-linux.h            |  49 ++++++++
- kernel/nv-procfs.c           |  20 +++
- kernel/nv-time.h             |   9 +-
- kernel/nv.c                  |   2 +-
- kernel/os-interface.c        |   8 +-
- kernel/uvm/Makefile          |   1 +
- kernel/uvm/conftest.sh       |   4 +
- kernel/uvm/nvidia_uvm_lite.c |  29 ++++-
- 12 files changed, 431 insertions(+), 14 deletions(-)
-
-diff --git a/kernel/Makefile b/kernel/Makefile
-index 125a690..2597080 100644
---- a/kernel/Makefile
-+++ b/kernel/Makefile
-@@ -108,12 +108,14 @@ COMPILE_TESTS = \
- 	acquire_console_sem \
- 	console_lock \
- 	kmem_cache_create \
-+	kmem_cache_create_usercopy \
- 	outer_flush_all \
- 	on_each_cpu \
- 	smp_call_function \
- 	nvmap_support \
- 	acpi_evaluate_integer \
- 	ioremap_cache \
-+	ioremap_nocache \
- 	ioremap_wc \
- 	proc_dir_entry \
- 	INIT_WORK \
-@@ -122,6 +124,7 @@ COMPILE_TESTS = \
- 	pci_domain_nr \
- 	pci_dma_mapping_error \
- 	file_operations \
-+	proc_ops \
- 	sg_alloc_table \
- 	sg_init_table \
- 	pci_get_domain_bus_and_slot \
-@@ -147,6 +150,8 @@ COMPILE_TESTS = \
- 	vm_fault_present \
- 	vm_fault_has_address \
- 	drm_driver_unload_has_int_return_type \
-+	drm_get_pci_dev \
-+	drm_pci_init \
- 	drm_legacy_pci_init \
- 	timer_setup \
- 	do_gettimeofday \
-diff --git a/kernel/conftest.sh b/kernel/conftest.sh
-index b7a85f0..a5225e5 100755
---- a/kernel/conftest.sh
-+++ b/kernel/conftest.sh
-@@ -176,6 +176,7 @@ test_headers() {
-     FILES="$FILES linux/ktime.h"
-     FILES="$FILES linux/file.h"
- 
-+    FILES_ARCH="$FILES_ARCH asm/pgtable.h"
-     FILES_ARCH="$FILES_ARCH asm/set_memory.h"
- 
-     translate_and_find_header_files $HEADERS      $FILES
-@@ -440,6 +441,9 @@ compile_test() {
-             # Determine if the set_memory_array_uc() function is present.
-             #
-             CODE="
-+            #if defined(NV_ASM_PGTABLE_H_PRESENT)
-+            #include <asm/pgtable.h>
-+            #endif
-             #if defined(NV_ASM_SET_MEMORY_H_PRESENT)
-             #include <asm/set_memory.h>
-             #else
-@@ -914,6 +918,21 @@ compile_test() {
-             fi
-         ;;
- 
-+        kmem_cache_create_usercopy)
-+            #
-+            # Determine if the kmem_cache_create_usercopy function exists.
-+            #
-+            # This function was added by:
-+            #   2017-06-10  8eb8284b412906181357c2b0110d879d5af95e52
-+            CODE="
-+            #include <linux/slab.h>
-+            void kmem_cache_create_usercopy(void) {
-+                kmem_cache_create_usercopy();
-+            }"
-+
-+            compile_check_conftest "$CODE" "NV_KMEM_CACHE_CREATE_USERCOPY_PRESENT" "" "functions"
-+        ;;
-+
-         smp_call_function)
-             #
-             # Determine if the smp_call_function() function is
-@@ -1188,6 +1207,22 @@ compile_test() {
-             compile_check_conftest "$CODE" "NV_IOREMAP_CACHE_PRESENT" "" "functions"
-         ;;
- 
-+        ioremap_nocache)
-+            #
-+            # Determine if the ioremap_nocache() function is present.
-+            #
-+            # Removed by commit 4bdc0d676a64 ("remove ioremap_nocache and
-+            # devm_ioremap_nocache") in v5.6 (2020-01-06)
-+            #
-+            CODE="
-+            #include <asm/io.h>
-+            void conftest_ioremap_nocache(void) {
-+                ioremap_nocache();
-+            }"
-+
-+            compile_check_conftest "$CODE" "NV_IOREMAP_NOCACHE_PRESENT" "" "functions"
-+        ;;
-+
-         ioremap_wc)
-             #
-             # Determine if the ioremap_wc() function is present.
-@@ -1371,6 +1406,16 @@ compile_test() {
-             compile_check_conftest "$CODE" "NV_FILE_OPERATIONS_HAS_COMPAT_IOCTL" "" "types"
-         ;;
- 
-+        proc_ops)
-+            CODE="
-+            #include <linux/proc_fs.h>
-+            int conftest_proc_ops(void) {
-+                return offsetof(struct proc_ops, proc_open);
-+            }"
-+
-+            compile_check_conftest "$CODE" "NV_HAVE_PROC_OPS" "" "types"
-+        ;;
-+
-         sg_init_table)
-             #
-             # Determine if the sg_init_table() function is present.
-@@ -2044,6 +2089,42 @@ compile_test() {
-             compile_check_conftest "$CODE" "NV_DRM_DRIVER_UNLOAD_HAS_INT_RETURN_TYPE" "" "types"
-         ;;
- 
-+        drm_get_pci_dev)
-+            #
-+            # Determine if drm_get_pci_dev() is present.
-+            #
-+            CODE="
-+            #if defined(NV_DRM_DRMP_H_PRESENT)
-+            #include <drm/drmP.h>
-+            #endif
-+
-+            #if defined(NV_DRM_DRM_PCI_H_PRESENT)
-+            #include <drm/drm_pci.h>
-+            #endif
-+
-+            void conftest_drm_legacy_pci_init(void) {
-+                drm_get_pci_dev();
-+            }"
-+
-+            compile_check_conftest "$CODE" "NV_DRM_GET_PCI_DEV_PRESENT" "" "functions"
-+        ;;
-+
-+        drm_pci_init)
-+            #
-+            # Determine if drm_pci_init() is present.
-+            #
-+            CODE="
-+            #if defined(NV_DRM_DRMP_H_PRESENT)
-+            #include <drm/drmP.h>
-+            #endif
-+
-+            void conftest_drm_legacy_pci_init(void) {
-+                drm_pci_init();
-+            }"
-+
-+            compile_check_conftest "$CODE" "NV_DRM_PCI_INIT_PRESENT" "" "functions"
-+        ;;
-+
-         drm_legacy_pci_init)
-             #
-             # Determine if drm_legacy_pci_init() is present. drm_pci_init() was
-diff --git a/kernel/dkms.conf b/kernel/dkms.conf
-index 79a02ae..3140f03 100644
---- a/kernel/dkms.conf
-+++ b/kernel/dkms.conf
-@@ -1,7 +1,13 @@
-+if [ -x /usr/bin/nproc ]; then
-+  num_cpu_cores=$(nproc)
-+else
-+  num_cpu_cores=1
-+fi
-+
- PACKAGE_NAME="nvidia"
- PACKAGE_VERSION="340.108"
- BUILT_MODULE_NAME[0]="$PACKAGE_NAME"
- DEST_MODULE_LOCATION[0]="/kernel/drivers/video"
--MAKE[0]="make module KERNEL_UNAME=${kernelver}"
-+MAKE[0]="make -j$num_cpu_cores module KERNEL_UNAME=${kernelver}"
- CLEAN="make clean"
- AUTOINSTALL="yes"
-diff --git a/kernel/nv-drm.c b/kernel/nv-drm.c
-index 0d1cdbf..85db07e 100644
---- a/kernel/nv-drm.c
-+++ b/kernel/nv-drm.c
-@@ -50,9 +50,236 @@
- #if defined(NV_DRM_LEGACY_PCI_INIT_PRESENT)
- #define nv_drm_pci_init drm_legacy_pci_init
- #define nv_drm_pci_exit drm_legacy_pci_exit
--#else
-+#elif defined(NV_DRM_PCI_INIT_PRESENT)
- #define nv_drm_pci_init drm_pci_init
- #define nv_drm_pci_exit drm_pci_exit
-+#else
-+#if defined(NV_DRM_GET_PCI_DEV_PRESENT)
-+#define nv_drm_get_pci_dev drm_get_pci_dev
-+#else
-+#include <drm/drm_agpsupport.h>
-+
-+struct nv_drm_agp_head {
-+    struct agp_kern_info agp_info;
-+    struct list_head memory;
-+    unsigned long mode;
-+    struct agp_bridge_data *bridge;
-+    int enabled;
-+    int acquired;
-+    unsigned long base;
-+    int agp_mtrr;
-+    int cant_use_aperture;
-+    unsigned long page_mask;
-+};
-+
-+struct nv_drm_agp_mem {
-+    unsigned long handle;
-+    struct agp_memory *memory;
-+    unsigned long bound;
-+    int pages;
-+    struct list_head head;
-+};
-+
-+/*
-+ * Code from drm_agp_init/nv_drm_{free,unbind}_agp
-+ * Extracted from commit: 5b8b9d0c6d0e0f1993c6c56deaf9646942c49d94, file: drivers/gpu/drm/drm_agpsupport.c
-+ */
-+struct drm_agp_head *nv_drm_agp_init(struct drm_device *dev)
-+{
-+    struct nv_drm_agp_head *head = NULL;
-+
-+    head = kzalloc(sizeof(*head), GFP_KERNEL);
-+    if (!head)
-+        return NULL;
-+    head->bridge = agp_find_bridge(dev->pdev);
-+    if (!head->bridge) {
-+        head->bridge = agp_backend_acquire(dev->pdev);
-+        if (!head->bridge) {
-+            kfree(head);
-+            return NULL;
-+        }
-+        agp_copy_info(head->bridge, &head->agp_info);
-+        agp_backend_release(head->bridge);
-+    } else {
-+        agp_copy_info(head->bridge, &head->agp_info);
-+    }
-+    if (head->agp_info.chipset == NOT_SUPPORTED) {
-+        kfree(head);
-+        return NULL;
-+    }
-+    INIT_LIST_HEAD(&head->memory);
-+    head->cant_use_aperture = head->agp_info.cant_use_aperture;
-+    head->page_mask = head->agp_info.page_mask;
-+    head->base = head->agp_info.aper_base;
-+    return (struct drm_agp_head *)head;
-+}
-+
-+void nv_drm_free_agp(struct agp_memory *handle, int pages)
-+{
-+    agp_free_memory(handle);
-+}
-+
-+int nv_drm_unbind_agp(struct agp_memory *handle)
-+{
-+    return agp_unbind_memory(handle);
-+}
-+
-+/*
-+ * Code from drm_pci_agp_{clear,destroy,init}/drm_get_pci_dev
-+ * Extracted from commit: 5b8b9d0c6d0e0f1993c6c56deaf9646942c49d94, file: drivers/gpu/drm/drm_pci.c
-+ */
-+static void nv_drm_pci_agp_init(struct drm_device *dev)
-+{
-+    if (drm_core_check_feature(dev, DRIVER_USE_AGP)) {
-+        if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP))
-+            dev->agp = nv_drm_agp_init(dev);
-+        if (dev->agp) {
-+            dev->agp->agp_mtrr = arch_phys_wc_add(
-+                dev->agp->agp_info.aper_base,
-+                dev->agp->agp_info.aper_size *
-+                1024 * 1024);
-+        }
-+    }
-+}
-+
-+void nv_drm_legacy_agp_clear(struct drm_device *dev)
-+{
-+    struct nv_drm_agp_mem *entry, *tempe;
-+
-+    if (!dev->agp)
-+        return;
-+    if (!drm_core_check_feature(dev, DRIVER_LEGACY))
-+        return;
-+
-+    list_for_each_entry_safe(entry, tempe, &dev->agp->memory, head) {
-+        if (entry->bound)
-+            nv_drm_unbind_agp(entry->memory);
-+        nv_drm_free_agp(entry->memory, entry->pages);
-+        kfree(entry);
-+    }
-+    INIT_LIST_HEAD(&dev->agp->memory);
-+
-+    if (dev->agp->acquired)
-+        drm_agp_release(dev);
-+
-+    dev->agp->acquired = 0;
-+    dev->agp->enabled = 0;
-+}
-+
-+void nv_drm_pci_agp_destroy(struct drm_device *dev)
-+{
-+    if (dev->agp) {
-+        arch_phys_wc_del(dev->agp->agp_mtrr);
-+        nv_drm_legacy_agp_clear(dev);
-+        kfree(dev->agp);
-+        dev->agp = NULL;
-+    }
-+}
-+
-+static int nv_drm_get_pci_dev(struct pci_dev *pdev,
-+               const struct pci_device_id *ent,
-+               struct drm_driver *driver)
-+{
-+    struct drm_device *dev;
-+    int ret;
-+
-+    DRM_DEBUG("\n");
-+
-+    dev = drm_dev_alloc(driver, &pdev->dev);
-+    if (IS_ERR(dev))
-+        return PTR_ERR(dev);
-+
-+    ret = pci_enable_device(pdev);
-+    if (ret)
-+        goto err_free;
-+
-+    dev->pdev = pdev;
-+#ifdef __alpha__
-+    dev->hose = pdev->sysdata;
-+#endif
-+
-+    if (drm_core_check_feature(dev, DRIVER_MODESET))
-+        pci_set_drvdata(pdev, dev);
-+
-+    nv_drm_pci_agp_init(dev);
-+
-+    ret = drm_dev_register(dev, ent->driver_data);
-+    if (ret)
-+        goto err_agp;
-+
-+    /* No locking needed since shadow-attach is single-threaded since it may
-+     * only be called from the per-driver module init hook. */
-+    if (drm_core_check_feature(dev, DRIVER_LEGACY))
-+        list_add_tail(&dev->legacy_dev_list, &driver->legacy_dev_list);
-+
-+    return 0;
-+
-+err_agp:
-+    nv_drm_pci_agp_destroy(dev);
-+    pci_disable_device(pdev);
-+err_free:
-+    drm_dev_put(dev);
-+    return ret;
-+}
-+#endif
-+
-+/*
-+ * Code from drm_legacy_pci_{init,exit}
-+ * Extracted from tag: v5.6.3, file: drivers/gpu/drm/drm_pci.c
-+ */
-+int nv_drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver)
-+{
-+    struct pci_dev *pdev = NULL;
-+    const struct pci_device_id *pid;
-+    int i;
-+
-+    DRM_DEBUG("\n");
-+
-+    if (WARN_ON(!(driver->driver_features & DRIVER_LEGACY)))
-+        return -EINVAL;
-+
-+    /* If not using KMS, fall back to stealth mode manual scanning. */
-+    INIT_LIST_HEAD(&driver->legacy_dev_list);
-+    for (i = 0; pdriver->id_table[i].vendor != 0; i++) {
-+        pid = &pdriver->id_table[i];
-+
-+        /* Loop around setting up a DRM device for each PCI device
-+         * matching our ID and device class.  If we had the internal
-+         * function that pci_get_subsys and pci_get_class used, we'd
-+         * be able to just pass pid in instead of doing a two-stage
-+         * thing.
-+         */
-+        pdev = NULL;
-+        while ((pdev =
-+            pci_get_subsys(pid->vendor, pid->device, pid->subvendor,
-+                       pid->subdevice, pdev)) != NULL) {
-+            if ((pdev->class & pid->class_mask) != pid->class)
-+                continue;
-+
-+            /* stealth mode requires a manual probe */
-+            pci_dev_get(pdev);
-+            nv_drm_get_pci_dev(pdev, pid, driver);
-+        }
-+    }
-+    return 0;
-+}
-+
-+void nv_drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver)
-+{
-+    struct drm_device *dev, *tmp;
-+    DRM_DEBUG("\n");
-+
-+    if (!(driver->driver_features & DRIVER_LEGACY)) {
-+        WARN_ON(1);
-+    } else {
-+        list_for_each_entry_safe(dev, tmp, &driver->legacy_dev_list,
-+                     legacy_dev_list) {
-+            list_del(&dev->legacy_dev_list);
-+            drm_put_dev(dev);
-+        }
-+    }
-+    DRM_INFO("Module unloaded\n");
-+}
- #endif
- 
- extern nv_linux_state_t *nv_linux_devices;
-diff --git a/kernel/nv-linux.h b/kernel/nv-linux.h
-index a1d2c68..83e6433 100644
---- a/kernel/nv-linux.h
-+++ b/kernel/nv-linux.h
-@@ -688,11 +688,16 @@ extern nv_spinlock_t km_lock;
-         VM_ALLOC_RECORD(ptr, size, "vm_ioremap"); \
-     }
- 
-+#if defined(NV_IOREMAP_NOCACHE_PRESENT)
- #define NV_IOREMAP_NOCACHE(ptr, physaddr, size) \
-     { \
-         (ptr) = ioremap_nocache(physaddr, size); \
-         VM_ALLOC_RECORD(ptr, size, "vm_ioremap_nocache"); \
-     }
-+#else
-+#define NV_IOREMAP_NOCACHE(ptr, physaddr, size) \
-+    NV_IOREMAP(ptr, physaddr, size)
-+#endif
- 
- #if defined(NV_IOREMAP_CACHE_PRESENT)
- #define NV_IOREMAP_CACHE(ptr, physaddr, size)            \
-@@ -774,6 +779,17 @@ extern nv_spinlock_t km_lock;
- #error "NV_KMEM_CACHE_CREATE() undefined (kmem_cache_create() unavailable)!"
- #endif
- 
-+#if defined(NV_KMEM_CACHE_CREATE_USERCOPY_PRESENT)
-+#define NV_KMEM_CACHE_CREATE_USERCOPY(kmem_cache, name, type)       \
-+    {                                                               \
-+        kmem_cache = kmem_cache_create_usercopy(name, sizeof(type), \
-+                        0, 0, 0, sizeof(type), NULL);               \
-+    }
-+#else
-+#define NV_KMEM_CACHE_CREATE_USERCOPY(kmem_cache, name, type)       \
-+        NV_KMEM_CACHE_CREATE(kmem_cache, name, type)
-+#endif
-+
- #define NV_KMEM_CACHE_ALLOC(ptr, kmem_cache, type)              \
-     {                                                           \
-         (ptr) = kmem_cache_alloc(kmem_cache, GFP_KERNEL);       \
-@@ -1971,6 +1987,19 @@ extern NvU32 nv_assign_gpu_count;
-     })
- #endif
- 
-+#if defined(NV_HAVE_PROC_OPS)
-+#define NV_CREATE_PROC_FILE(filename,parent,__name,__data)               \
-+   ({                                                                    \
-+        struct proc_dir_entry *__entry;                                  \
-+        int mode = (S_IFREG | S_IRUGO);                                  \
-+        const struct proc_ops *fops = &nv_procfs_##__name##_fops;        \
-+        if (fops->proc_write != 0)                                       \
-+            mode |= S_IWUSR;                                             \
-+        __entry = NV_CREATE_PROC_ENTRY(filename, mode, parent, fops,     \
-+            __data);                                                     \
-+        __entry;                                                         \
-+    })
-+#else
- #define NV_CREATE_PROC_FILE(filename,parent,__name,__data)               \
-    ({                                                                    \
-         struct proc_dir_entry *__entry;                                  \
-@@ -1982,6 +2011,7 @@ extern NvU32 nv_assign_gpu_count;
-             __data);                                                     \
-         __entry;                                                         \
-     })
-+#endif
- 
- /*
-  * proc_mkdir_mode exists in Linux 2.6.9, but isn't exported until Linux 3.0.
-@@ -2023,6 +2053,24 @@ extern NvU32 nv_assign_gpu_count;
-     remove_proc_entry(entry->name, entry->parent);
- #endif
- 
-+#if defined(NV_HAVE_PROC_OPS)
-+#define NV_DEFINE_PROCFS_SINGLE_FILE(__name)                                  \
-+    static int nv_procfs_open_##__name(                                       \
-+        struct inode *inode,                                                  \
-+        struct file *filep                                                    \
-+    )                                                                         \
-+    {                                                                         \
-+        return single_open(filep, nv_procfs_read_##__name,                    \
-+            NV_PDE_DATA(inode));                                              \
-+    }                                                                         \
-+                                                                              \
-+    static const struct proc_ops nv_procfs_##__name##_fops = {                \
-+        .proc_open       = nv_procfs_open_##__name,                           \
-+        .proc_read       = seq_read,                                          \
-+        .proc_lseek      = seq_lseek,                                         \
-+        .proc_release    = single_release,                                    \
-+    };
-+#else
- #define NV_DEFINE_PROCFS_SINGLE_FILE(__name)                                  \
-     static int nv_procfs_open_##__name(                                       \
-         struct inode *inode,                                                  \
-@@ -2040,6 +2088,7 @@ extern NvU32 nv_assign_gpu_count;
-         .llseek     = seq_lseek,                                              \
-         .release    = single_release,                                         \
-     };
-+#endif
- 
- #endif  /* CONFIG_PROC_FS */
- 
-diff --git a/kernel/nv-procfs.c b/kernel/nv-procfs.c
-index ebca3e8..9365c3c 100644
---- a/kernel/nv-procfs.c
-+++ b/kernel/nv-procfs.c
-@@ -409,6 +409,15 @@ done:
-     return ((status < 0) ? status : (int)count);
- }
- 
-+#if defined(NV_HAVE_PROC_OPS)
-+static struct proc_ops nv_procfs_registry_fops = {
-+    .proc_open    = nv_procfs_open_registry,
-+    .proc_read    = seq_read,
-+    .proc_write   = nv_procfs_write_file,
-+    .proc_lseek   = seq_lseek,
-+    .proc_release = nv_procfs_close_registry,
-+};
-+#else
- static struct file_operations nv_procfs_registry_fops = {
-     .owner   = THIS_MODULE,
-     .open    = nv_procfs_open_registry,
-@@ -417,6 +426,7 @@ static struct file_operations nv_procfs_registry_fops = {
-     .llseek  = seq_lseek,
-     .release = nv_procfs_close_registry,
- };
-+#endif
- 
- static int
- nv_procfs_read_unbind_lock(
-@@ -538,6 +548,15 @@ done:
-     return rc;
- }
- 
-+#if defined(NV_HAVE_PROC_OPS)
-+static struct proc_ops nv_procfs_unbind_lock_fops = {
-+    .proc_open    = nv_procfs_open_unbind_lock,
-+    .proc_read    = seq_read,
-+    .proc_write   = nv_procfs_write_file,
-+    .proc_lseek   = seq_lseek,
-+    .proc_release = nv_procfs_close_unbind_lock,
-+};
-+#else
- static struct file_operations nv_procfs_unbind_lock_fops = {
-     .owner   = THIS_MODULE,
-     .open    = nv_procfs_open_unbind_lock,
-@@ -546,6 +565,7 @@ static struct file_operations nv_procfs_unbind_lock_fops = {
-     .llseek  = seq_lseek,
-     .release = nv_procfs_close_unbind_lock,
- };
-+#endif
- 
- static int
- nv_procfs_read_text_file(
-diff --git a/kernel/nv-time.h b/kernel/nv-time.h
-index a34ceb2..780f8bc 100644
---- a/kernel/nv-time.h
-+++ b/kernel/nv-time.h
-@@ -28,7 +28,12 @@
- #include <linux/ktime.h>
- #endif
- 
--static inline void nv_gettimeofday(struct timeval *tv)
-+struct nv_timeval {
-+    __kernel_long_t      tv_sec;
-+    __kernel_suseconds_t tv_usec;
-+};
-+
-+static inline void nv_gettimeofday(struct nv_timeval *tv)
- {
- #ifdef NV_DO_GETTIMEOFDAY_PRESENT
-     do_gettimeofday(tv);
-@@ -37,7 +42,7 @@ static inline void nv_gettimeofday(struct timeval *tv)
- 
-     ktime_get_real_ts64(&now);
- 
--    *tv = (struct timeval) {
-+    *tv = (struct nv_timeval) {
-         .tv_sec = now.tv_sec,
-         .tv_usec = now.tv_nsec/1000,
-     };
-diff --git a/kernel/nv.c b/kernel/nv.c
-index a167be9..a218f83 100644
---- a/kernel/nv.c
-+++ b/kernel/nv.c
-@@ -752,7 +752,7 @@ int __init nvidia_init_module(void)
-     NV_SPIN_LOCK_INIT(&km_lock);
- #endif
- 
--    NV_KMEM_CACHE_CREATE(nv_stack_t_cache, NV_STACK_CACHE_STR, nv_stack_t);
-+    NV_KMEM_CACHE_CREATE_USERCOPY(nv_stack_t_cache, NV_STACK_CACHE_STR, nv_stack_t);
-     if (nv_stack_t_cache == NULL)
-     {
-         nv_printf(NV_DBG_ERRORS, "NVRM: stack cache allocation failed!\n");
-diff --git a/kernel/os-interface.c b/kernel/os-interface.c
-index 7190b26..0c0dc05 100644
---- a/kernel/os-interface.c
-+++ b/kernel/os-interface.c
-@@ -439,7 +439,7 @@ RM_STATUS NV_API_CALL os_get_current_time(
-     NvU32 *useconds
- )
- {
--    struct timeval tm;
-+    struct nv_timeval tm;
- 
-     nv_gettimeofday(&tm);
- 
-@@ -474,7 +474,7 @@ RM_STATUS NV_API_CALL os_delay_us(NvU32 MicroSeconds)
-     unsigned long usec;
- 
- #ifdef NV_CHECK_DELAY_ACCURACY
--    struct timeval tm1, tm2;
-+    struct nv_timeval tm1, tm2;
- 
-     nv_gettimeofday(&tm1);
- #endif
-@@ -514,9 +514,9 @@ RM_STATUS NV_API_CALL os_delay(NvU32 MilliSeconds)
-     unsigned long MicroSeconds;
-     unsigned long jiffies;
-     unsigned long mdelay_safe_msec;
--    struct timeval tm_end, tm_aux;
-+    struct nv_timeval tm_end, tm_aux;
- #ifdef NV_CHECK_DELAY_ACCURACY
--    struct timeval tm_start;
-+    struct nv_timeval tm_start;
- #endif
- 
-     nv_gettimeofday(&tm_aux);
-diff --git a/kernel/uvm/Makefile b/kernel/uvm/Makefile
-index 0cad8ff..043a08d 100644
---- a/kernel/uvm/Makefile
-+++ b/kernel/uvm/Makefile
-@@ -207,6 +207,7 @@ ccflags-y += $(EXTRA_CFLAGS)
- 
- RM_MODULE_SYMVERS:= $(RM_OUT_DIR)/Module.symvers
- UVM_MODULE_SYMVERS:= $(obj)/Module.symvers
-+KBUILD_EXTRA_SYMBOLS:= $(UVM_MODULE_SYMVERS)
- 
- module $(MODULE_NAME).ko: $(UVM_MODULE_SYMVERS) debug_diagnostics_printing
- 
-diff --git a/kernel/uvm/conftest.sh b/kernel/uvm/conftest.sh
-index b7a85f0..33e2a63 100755
---- a/kernel/uvm/conftest.sh
-+++ b/kernel/uvm/conftest.sh
-@@ -176,6 +176,7 @@ test_headers() {
-     FILES="$FILES linux/ktime.h"
-     FILES="$FILES linux/file.h"
- 
-+    FILES_ARCH="$FILES_ARCH asm/pgtable.h"
-     FILES_ARCH="$FILES_ARCH asm/set_memory.h"
- 
-     translate_and_find_header_files $HEADERS      $FILES
-@@ -440,6 +441,9 @@ compile_test() {
-             # Determine if the set_memory_array_uc() function is present.
-             #
-             CODE="
-+            #if defined(NV_ASM_PGTABLE_H_PRESENT)
-+            #include <asm/pgtable.h>
-+            #endif
-             #if defined(NV_ASM_SET_MEMORY_H_PRESENT)
-             #include <asm/set_memory.h>
-             #else
-diff --git a/kernel/uvm/nvidia_uvm_lite.c b/kernel/uvm/nvidia_uvm_lite.c
-index 6943e7c..9a7e3b6 100644
---- a/kernel/uvm/nvidia_uvm_lite.c
-+++ b/kernel/uvm/nvidia_uvm_lite.c
-@@ -131,8 +131,8 @@ static
- RM_STATUS _preexisting_error_on_channel(UvmGpuMigrationTracking *pMigTracker,
-                                          UvmCommitRecord *pRecord);
- 
--static void _set_timeout_in_usec(struct timeval *src,
--                                 struct timeval *result,
-+static void _set_timeout_in_usec(struct nv_timeval *src,
-+                                 struct nv_timeval *result,
-                                  unsigned long timeoutInUsec)
- {
-     if (!src || !result)
-@@ -820,7 +820,13 @@ done:
- }
- 
- #if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
-+vm_fault_t _fault(struct vm_fault *vmf)
-+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
-+int _fault(struct vm_fault *vmf)
-+#else
- int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)
-+#endif
- {
- #if defined(NV_VM_FAULT_HAS_ADDRESS)
-     unsigned long vaddr = vmf->address;
-@@ -828,8 +834,15 @@ int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)
-     unsigned long vaddr = (unsigned long)vmf->virtual_address;
- #endif
-     struct page *page = NULL;
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
-+    vm_fault_t retval;
-+#else
-     int retval;
- 
-+#endif
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
-+   struct vm_area_struct *vma = vmf->vma;
-+#endif
-     retval = _fault_common(vma, vaddr, &page, vmf->flags);
- 
-     vmf->page = page;
-@@ -868,7 +881,13 @@ static struct vm_operations_struct uvmlite_vma_ops =
- // it's dealing with anonymous mapping (see handle_pte_fault).
- //
- #if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
-+vm_fault_t _sigbus_fault(struct vm_fault *vmf)
-+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
-+int _sigbus_fault(struct vm_fault *vmf)
-+#else
- int _sigbus_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
-+#endif
- {
-     vmf->page = NULL;
-     return VM_FAULT_SIGBUS;
-@@ -1992,9 +2011,9 @@ void umvlite_destroy_per_process_gpu_resources(UvmGpuUuid *gpuUuidStruct)
- static RM_STATUS _check_ecc_errors(UvmGpuMigrationTracking *pMigTracker,
-                                     NvBool *pIsEccErrorSet)
- {
--    struct timeval eccErrorStartTime = {0};
--    struct timeval eccErrorCurrentTime = {0};
--    struct timeval eccTimeout = {0};
-+    struct nv_timeval eccErrorStartTime = {0};
-+    struct nv_timeval eccErrorCurrentTime = {0};
-+    struct nv_timeval eccTimeout = {0};
-     NvBool bEccErrorTimeout = NV_FALSE;
-     NvBool bEccIncomingError = NV_FALSE;
-     unsigned rmInterruptSet = 0;
--- 
-2.29.0
-
diff --git a/srcpkgs/nvidia340/files/nvidia-glx.conf b/srcpkgs/nvidia340/files/nvidia-glx.conf
deleted file mode 100644
index 7c76883abb3..00000000000
--- a/srcpkgs/nvidia340/files/nvidia-glx.conf
+++ /dev/null
@@ -1,4 +0,0 @@
-Section "Files"
-    ModulePath "/usr/lib/nvidia/xorg"
-    ModulePath "/usr/lib/xorg/modules"
-EndSection
diff --git a/srcpkgs/nvidia340/template b/srcpkgs/nvidia340/template
deleted file mode 100644
index 166f35756bc..00000000000
--- a/srcpkgs/nvidia340/template
+++ /dev/null
@@ -1,223 +0,0 @@
-# Template file for 'nvidia340'
-
-_desc="NVIDIA drivers (GeForce 8, 9, 9M, 100, 100M, 200, 300 series)"
-
-pkgname=nvidia340
-version=340.108
-revision=4
-maintainer="Orphaned <orphan@voidlinux.org>"
-license="custom:NVIDIA proprietary"
-homepage="http://www.nvidia.com"
-
-archs="i686 x86_64"
-nopie=yes
-repository=nonfree
-create_wrksrc=yes
-short_desc="${_desc} - Libraries and Utilities"
-hostmakedepends="tar"
-depends="${pkgname}-dkms-${version}_${revision} pkg-config"
-conflicts="catalyst>=0 xserver-abi-video>24_1"
-
-provides="nvidia-${version}_${revision}"
-replaces="nvidia>=0 nvidia-stable>=0"
-subpackages="${pkgname}-dkms ${pkgname}-opencl ${pkgname}-libs"
-
-if [ "$XBPS_TARGET_MACHINE" = "i686" ]; then
-	_pkg="NVIDIA-Linux-x86-${version}"
-	distfiles="http://us.download.nvidia.com/XFree86/Linux-x86/${version}/${_pkg}.run"
-	checksum=2032aad612d9f3af1aecf979cfdfe423d79aa76929ef8bf8d3a403076f507cca
-else
-	_pkg="NVIDIA-Linux-x86_64-${version}-no-compat32"
-	distfiles="http://us.download.nvidia.com/XFree86/Linux-x86_64/${version}/${_pkg}.run"
-	checksum=995d44fef587ff5284497a47a95d71adbee0c13020d615e940ac928f180f5b77
-fi
-
-do_extract() {
-	install -m755 ${XBPS_SRCDISTDIR}/${pkgname}-${version}/${_pkg}.run ${wrksrc}
-	cd ${wrksrc}
-	./${_pkg}.run --extract-only
-	rm -f ${_pkg}.run
-}
-
-do_patch() {
-	cd ${_pkg}
-	patch -p1 < ${FILESDIR}/kernel-5.x.patch
-	patch -p1 < ${FILESDIR}/kernel-5.8.patch
-	patch -p1 < ${FILESDIR}/kernel-5.9.patch
-}
-
-do_install() {
-	cd ${_pkg}
-
-	# X driver
-	vinstall nvidia_drv.so 755 usr/lib/xorg/modules/drivers
-
-	# GLX extension module for X
-	vinstall libglx.so.${version} 755 usr/lib/nvidia/xorg
-	ln -sf libglx.so.${version} ${DESTDIR}/usr/lib/nvidia/xorg/libglx.so.1
-	ln -sf libglx.so.${version} ${DESTDIR}/usr/lib/nvidia/xorg/libglx.so
-	# Override default ModulePath to load nvidia's glx instead of xorg's
-	vinstall ${FILESDIR}/nvidia-glx.conf 644 /usr/share/X11/xorg.conf.d 10-nvidia-glx.conf
-
-	# OpenGL libraries (GL, EGL and GLES)
-	vinstall libGL.so.${version} 755 usr/lib
-	ln -sf libGL.so.${version} ${DESTDIR}/usr/lib/libGL.so.1
-	vinstall libEGL.so.${version} 755 usr/lib
-	ln -sf libEGL.so.${version} ${DESTDIR}/usr/lib/libEGL.so.1
-	vinstall libGLESv1_CM.so.${version} 755 usr/lib
-	ln -sf libGLESv1_CM.so.${version} ${DESTDIR}/usr/lib/libGLESv1_CM.so.1
-	vinstall libGLESv2.so.${version} 755 usr/lib
-	ln -sf libGLESv2.so.${version} ${DESTDIR}/usr/lib/libGLESv2.so.2
-	# Some programs link to these libglvnd links
-	ln -sf libGL.so.1 ${DESTDIR}/usr/lib/libOpenGL.so.0
-	ln -sf libGL.so.1 ${DESTDIR}/usr/lib/libGLX.so.0
-
-	# OpenGL core library
-	vinstall libnvidia-glcore.so.${version} 755 usr/lib
-	ln -sf libnvidia-glcore.so.${version} ${DESTDIR}/usr/lib/libnvidia-glcore.so
-
-	# VDPAU
-	vinstall libvdpau_nvidia.so.${version} 755 usr/lib/vdpau
-	ln -sf libvdpau_nvidia.so.${version} ${DESTDIR}/usr/lib/vdpau/libvdpau_nvidia.so
-	ln -sf libvdpau_nvidia.so.${version} ${DESTDIR}/usr/lib/vdpau/libvdpau_nvidia.so.1
-
-	# misc libraries
-	vinstall tls/libnvidia-tls.so.${version} 755 usr/lib
-	ln -sf libnvidia-tls.so.${version} ${DESTDIR}/usr/lib/libnvidia-tls.so
-
-	vinstall libnvidia-cfg.so.${version} 755 usr/lib
-	ln -sf libnvidia-cfg.so.${version} ${DESTDIR}/usr/lib/libnvidia-cfg.so
-	ln -sf libnvidia-cfg.so.${version} ${DESTDIR}/usr/lib/libnvidia-cfg.so.1
-
-	vinstall libnvidia-ml.so.${version} 755 usr/lib
-	ln -sf libnvidia-ml.so.${version} ${DESTDIR}/usr/lib/libnvidia-ml.so
-	ln -sf libnvidia-ml.so.${version} ${DESTDIR}/usr/lib/libnvidia-ml.so.1
-
-	vinstall libnvidia-encode.so.${version} 755 usr/lib
-	ln -sf libnvidia-encode.so.${version} ${DESTDIR}/usr/lib/libnvidia-encode.so
-	ln -sf libnvidia-encode.so.${version} ${DESTDIR}/usr/lib/libnvidia-encode.so.1
-
-	vinstall libnvidia-ifr.so.${version} 755 usr/lib
-	ln -sf libnvidia-ifr.so.${version} ${DESTDIR}/usr/lib/libnvidia-ifr.so
-	ln -sf libnvidia-ifr.so.${version} ${DESTDIR}/usr/lib/libnvidia-ifr.so.1
-
-	vinstall libnvidia-fbc.so.${version} 755 usr/lib
-	ln -sf libnvidia-fbc.so.${version} ${DESTDIR}/usr/lib/libnvidia-fbc.so
-	ln -sf libnvidia-fbc.so.${version} ${DESTDIR}/usr/lib/libnvidia-fbc.so.1
-
-	vinstall libnvidia-glsi.so.${version} 755 usr/lib
-
-	# CUDA
-	vbin nvidia-cuda-mps-control
-	vbin nvidia-cuda-mps-server
-	vman nvidia-cuda-mps-control.1.gz
-
-	vinstall libcuda.so.${version} 755 usr/lib
-	ln -sf libcuda.so.${version} ${DESTDIR}/usr/lib/libcuda.so
-	ln -sf libcuda.so.${version} ${DESTDIR}/usr/lib/libcuda.so.1
-
-	vinstall libnvcuvid.so.${version} 755 usr/lib
-	ln -sf libnvcuvid.so.${version} ${DESTDIR}/usr/lib/libnvcuvid.so
-	ln -sf libnvcuvid.so.${version} ${DESTDIR}/usr/lib/libnvcuvid.so.1
-
-	# nvidia-xconfig
-	vbin nvidia-xconfig
-	vman nvidia-xconfig.1.gz
-
-	# nvidia-settings
-	vbin nvidia-settings
-	vman nvidia-settings.1.gz
-	vinstall nvidia-settings.desktop 644 usr/share/applications
-	vinstall nvidia-settings.png 644 usr/share/pixmaps
-	sed -e 's:__UTILS_PATH__:/usr/bin:' \
-		-e 's:__PIXMAP_PATH__:/usr/share/pixmaps:' \
-		-i ${DESTDIR}/usr/share/applications/nvidia-settings.desktop
-
-	# nvidia-bug-report
-	vbin nvidia-bug-report.sh nvidia-bug-report
-	vbin nvidia-debugdump
-
-	# nvidia-smi
-	vbin nvidia-smi
-	vman nvidia-smi.1.gz
-
-	# License and documentation.
-	vlicense LICENSE
-	vdoc README.txt README
-	vdoc NVIDIA_Changelog
-
-	# opencl pkg
-	vinstall nvidia.icd 644 etc/OpenCL/vendors
-
-	vinstall libnvidia-compiler.so.${version} 755 usr/lib
-	ln -sf libnvidia-compiler.so.${version} \
-		${DESTDIR}/usr/lib/libnvidia-compiler.so
-	ln -sf libnvidia-compiler.so.${version} \
-		${DESTDIR}/usr/lib/libnvidia-compiler.so.1
-
-	vinstall libnvidia-opencl.so.${version} 755 usr/lib
-	ln -sf libnvidia-opencl.so.${version} \
-		${DESTDIR}/usr/lib/libnvidia-opencl.so
-	ln -sf libnvidia-opencl.so.${version} \
-		${DESTDIR}/usr/lib/libnvidia-opencl.so.1
-
-	# dkms pkg
-	vmkdir usr/src/nvidia-${version}
-	# add nvidia-uvm dkms submodule too.
-	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
-		cat kernel/uvm/dkms.conf.fragment >> kernel/dkms.conf
-	fi
-	vcopy "kernel/*" usr/src/nvidia-${version}
-
-	# systemd modules-load.d(5) file.
-	vmkdir usr/lib/modules-load.d
-	echo "nvidia" > ${DESTDIR}/usr/lib/modules-load.d/nvidia.conf
-	chmod 644 ${DESTDIR}/usr/lib/modules-load.d/nvidia.conf
-	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
-		echo "nvidia-uvm" > ${DESTDIR}/usr/lib/modules-load.d/nvidia-uvm.conf
-		chmod 644 ${DESTDIR}/usr/lib/modules-load.d/nvidia-uvm.conf
-	fi
-
-	# Blacklist nouveau.
-	vmkdir usr/lib/modprobe.d
-	echo "blacklist nouveau" > ${DESTDIR}/usr/lib/modprobe.d/nvidia.conf
-	chmod 644 ${DESTDIR}/usr/lib/modprobe.d/nvidia.conf
-
-	# Omit drm dracut module too.
-	vmkdir usr/lib/dracut/dracut.conf.d
-	echo "omit_dracutmodules+=\" drm \"" > ${DESTDIR}/usr/lib/dracut/dracut.conf.d/99-nvidia.conf
-}
-
-nvidia340-dkms_package() {
-	short_desc="${_desc} - DKMS kernel module"
-	dkms_modules="nvidia ${version}"
-	depends="dkms"
-	provides="nvidia-dkms-${version}_${revision}"
-	replaces="nvidia-dkms>=0 nvidia-stable-dkms>=0"
-	pkg_install() {
-		vmove usr/src
-		vmove usr/lib/modules-load.d
-		vmove usr/lib/modprobe.d
-		vmove usr/lib/dracut
-	}
-}
-nvidia340-opencl_package() {
-	short_desc="${_desc} - OpenCL implementation"
-	provides="nvidia-opencl-${version}_${revision}"
-	replaces="nvidia-opencl>=0 nvidia-stable-opencl>=0"
-	depends="libOpenCL"
-	pkg_install() {
-		vmove "usr/lib/libnvidia-compiler*"
-		vmove "usr/lib/libnvidia-opencl*"
-		vmove etc/OpenCL
-	}
-}
-nvidia340-libs_package() {
-	short_desc="${_desc} - libraries"
-	provides="libGL-7.11_1 libEGL-7.11_1 libGLES-7.11_1 libglvnd-1.3.0_1"
-	shlib_provides="libGLX.so.0 libOpenGL.so.0"
-	replaces="libGL>=0 libEGL>=0 libGLES>=0 libglvnd>=0"
-	pkg_install() {
-		vmove usr/lib
-	}
-}
diff --git a/srcpkgs/nvidia340/update b/srcpkgs/nvidia340/update
deleted file mode 100644
index 43bad67f7e8..00000000000
--- a/srcpkgs/nvidia340/update
+++ /dev/null
@@ -1,2 +0,0 @@
-site="http://www.nvidia.com/object/unix.html"
-pattern='340.+>\K[\d.]+(?=</A>)'
diff --git a/srcpkgs/removed-packages/template b/srcpkgs/removed-packages/template
index e07c160eafe..d0f1a4969ad 100644
--- a/srcpkgs/removed-packages/template
+++ b/srcpkgs/removed-packages/template
@@ -78,6 +78,10 @@ replaces="
  wireguard-go<=0.0.20181222_2
  wireshark-gtk<=3.0.7_1
  yt-play<=20140117_2
+ nvidia340<=340.108_4
+ nvidia340-dkms<=340.108_4
+ nvidia340-opencl<=340.108_4
+ nvidia340-libs<=340.108_4
 "
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PR PATCH] [Updated] nvidia340: remove
  2020-12-19 22:50 [PR PATCH] nvidia340: remove abenson
  2021-01-09  4:15 ` [PR PATCH] [Updated] " abenson
@ 2021-01-09 18:50 ` abenson
  2021-01-09 22:57 ` [PR PATCH] [Merged]: " abenson
  2 siblings, 0 replies; 4+ messages in thread
From: abenson @ 2021-01-09 18:50 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 312 bytes --]

There is an updated pull request by abenson against master on the void-packages repository

https://github.com/abenson/void-packages rm_nvidia340
https://github.com/void-linux/void-packages/pull/27287

nvidia340: remove


A patch file from https://github.com/void-linux/void-packages/pull/27287.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-rm_nvidia340-27287.patch --]
[-- Type: text/x-diff, Size: 47632 bytes --]

From f57214b1f6a5141c312760984d787b97712e71b7 Mon Sep 17 00:00:00 2001
From: Andrew Benson <abenson+void@gmail.com>
Date: Sat, 19 Dec 2020 16:49:32 -0600
Subject: [PATCH] nvidia340: remove

---
 common/shlibs                            |   3 -
 srcpkgs/nvidia340-dkms                   |   1 -
 srcpkgs/nvidia340-libs                   |   1 -
 srcpkgs/nvidia340-opencl                 |   1 -
 srcpkgs/nvidia340/INSTALL                |   7 -
 srcpkgs/nvidia340/INSTALL.msg            |  15 -
 srcpkgs/nvidia340/REMOVE                 |   7 -
 srcpkgs/nvidia340/files/kernel-5.8.patch |  92 ---
 srcpkgs/nvidia340/files/kernel-5.9.patch | 107 ----
 srcpkgs/nvidia340/files/kernel-5.x.patch | 781 -----------------------
 srcpkgs/nvidia340/files/nvidia-glx.conf  |   4 -
 srcpkgs/nvidia340/template               | 223 -------
 srcpkgs/nvidia340/update                 |   2 -
 srcpkgs/removed-packages/template        |   6 +-
 14 files changed, 5 insertions(+), 1245 deletions(-)
 delete mode 120000 srcpkgs/nvidia340-dkms
 delete mode 120000 srcpkgs/nvidia340-libs
 delete mode 120000 srcpkgs/nvidia340-opencl
 delete mode 100644 srcpkgs/nvidia340/INSTALL
 delete mode 100644 srcpkgs/nvidia340/INSTALL.msg
 delete mode 100644 srcpkgs/nvidia340/REMOVE
 delete mode 100644 srcpkgs/nvidia340/files/kernel-5.8.patch
 delete mode 100644 srcpkgs/nvidia340/files/kernel-5.9.patch
 delete mode 100644 srcpkgs/nvidia340/files/kernel-5.x.patch
 delete mode 100644 srcpkgs/nvidia340/files/nvidia-glx.conf
 delete mode 100644 srcpkgs/nvidia340/template
 delete mode 100644 srcpkgs/nvidia340/update

diff --git a/common/shlibs b/common/shlibs
index de5cb65426e..760041a6657 100644
--- a/common/shlibs
+++ b/common/shlibs
@@ -131,16 +131,13 @@ libbrcmOpenVG.so rpi-userland-20180103_2
 libwayland-egl.so.1 wayland-1.15.0_4
 libnvidia-ml.so.1 nvidia-libs-346.47_1 ignore
 libnvidia-ml.so.1 nvidia304-libs-304.00_1 ignore
-libnvidia-ml.so.1 nvidia340-libs-340.46_1 ignore
 libnvidia-ml.so.1 nvidia390-libs-390.87_1 ignore
 libnvidia-tls.so.346.47 nvidia-libs-346.47_1 ignore
 libnvidia-glcore.so.346.47 nvidia-libs-346.47_1 ignore
 libnvidia-gtk2.so.346.47 nvidia-gtklibs-346.47_1 ignore
 libnvidia-gtk3.so.346.47 nvidia-gtklibs-346.47_1 ignore
-libnvidia-glcore.so.346.47 nvidia340-libs-340.46_1 ignore
 libnvidia-glcore.so.390.87 nvidia390-libs-390.87_1 ignore
 libnvidia-glsi.so.346.72 nvidia-libs-346.72_1 ignore
-libnvidia-glsi.so.340.107 nvidia340-libs-340.107_7 ignore
 libnvidia-fatbinaryloader.so.390.138 nvidia390-libs-390.138_1 ignore
 libnvidia-fatbinaryloader.so.430.40 nvidia-libs-430.40_1 ignore
 libglapi.so.0 libglapi-7.11_1
diff --git a/srcpkgs/nvidia340-dkms b/srcpkgs/nvidia340-dkms
deleted file mode 120000
index 383d067a70f..00000000000
--- a/srcpkgs/nvidia340-dkms
+++ /dev/null
@@ -1 +0,0 @@
-nvidia340
\ No newline at end of file
diff --git a/srcpkgs/nvidia340-libs b/srcpkgs/nvidia340-libs
deleted file mode 120000
index 383d067a70f..00000000000
--- a/srcpkgs/nvidia340-libs
+++ /dev/null
@@ -1 +0,0 @@
-nvidia340
\ No newline at end of file
diff --git a/srcpkgs/nvidia340-opencl b/srcpkgs/nvidia340-opencl
deleted file mode 120000
index 383d067a70f..00000000000
--- a/srcpkgs/nvidia340-opencl
+++ /dev/null
@@ -1 +0,0 @@
-nvidia340
\ No newline at end of file
diff --git a/srcpkgs/nvidia340/INSTALL b/srcpkgs/nvidia340/INSTALL
deleted file mode 100644
index 6b065bedb4a..00000000000
--- a/srcpkgs/nvidia340/INSTALL
+++ /dev/null
@@ -1,7 +0,0 @@
-# Regenerate initramfs.
-case ${ACTION} in
-post)
-	echo "Regenerating initramfs, please wait..."
-	dracut -f -q --regenerate-all
-	;;
-esac
diff --git a/srcpkgs/nvidia340/INSTALL.msg b/srcpkgs/nvidia340/INSTALL.msg
deleted file mode 100644
index 6301c36edbe..00000000000
--- a/srcpkgs/nvidia340/INSTALL.msg
+++ /dev/null
@@ -1,15 +0,0 @@
-> Remove from your /etc/X11/xorg.conf blocks like this:
-
-Section "Files"
-...
-EndSection
-
-This is known to happen when the configuration is generated by nvidia-xconfig.
-Such a section interferes with the "Files" Section provided by the package.
-
--------------------------------------------------------------------------------
-
-> If you wish to go back to nouveau:
-
-# xbps-remove nvidia340 nvidia340-dkms
-# xbps-install libglvnd
diff --git a/srcpkgs/nvidia340/REMOVE b/srcpkgs/nvidia340/REMOVE
deleted file mode 100644
index e4d494ca015..00000000000
--- a/srcpkgs/nvidia340/REMOVE
+++ /dev/null
@@ -1,7 +0,0 @@
-# Regenerate initramfs.
-case ${ACTION} in
-purge)
-	echo "Regenerating initramfs, please wait..."
-	dracut -f -q --regenerate-all
-	;;
-esac
diff --git a/srcpkgs/nvidia340/files/kernel-5.8.patch b/srcpkgs/nvidia340/files/kernel-5.8.patch
deleted file mode 100644
index 1d8b1a40e1e..00000000000
--- a/srcpkgs/nvidia340/files/kernel-5.8.patch
+++ /dev/null
@@ -1,92 +0,0 @@
-From 2cc3342b4b3c96bcc4062513011d35c079b009a2 Mon Sep 17 00:00:00 2001
-From: graysky <graysky@archlinux.us>
-Date: Thu, 22 Oct 2020 06:59:59 -0400
-Subject: [PATCH 2/3] kernel-5.8
-
-credit: https://launchpad.net/~kelebek333/+archive/ubuntu/nvidia-legacy/+packages
-extracted from: https://launchpadlibrarian.net/492468557/nvidia-graphics-drivers-340_340.108-1lmtrfocal3_340.108-2lmtrfocal.diff.gz
----
- kernel/nv-linux.h                | 8 ++++++++
- kernel/nvidia-modules-common.mk  | 1 +
- kernel/os-mlock.c                | 8 ++++++++
- kernel/uvm/nvidia_uvm_lite_api.c | 4 ++++
- 4 files changed, 21 insertions(+)
-
-diff --git a/kernel/nv-linux.h b/kernel/nv-linux.h
-index 83e6433..d055552 100644
---- a/kernel/nv-linux.h
-+++ b/kernel/nv-linux.h
-@@ -669,11 +669,19 @@ extern nv_spinlock_t km_lock;
- #  define KM_FREE_RECORD(a,b,c)
- #endif
- 
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
-+#define NV_VMALLOC(ptr, size)                     \
-+    {                                             \
-+        (ptr) = __vmalloc(size, GFP_KERNEL);      \
-+        VM_ALLOC_RECORD(ptr, size, "vm_vmalloc"); \
-+    }
-+#else
- #define NV_VMALLOC(ptr, size)                               \
-     {                                                       \
-         (ptr) = __vmalloc(size, GFP_KERNEL, PAGE_KERNEL);   \
-         VM_ALLOC_RECORD(ptr, size, "vm_vmalloc");           \
-     }
-+#endif
- 
- #define NV_VFREE(ptr, size)                         \
-     {                                               \
-diff --git a/kernel/nvidia-modules-common.mk b/kernel/nvidia-modules-common.mk
-index b94591b..0e4c228 100644
---- a/kernel/nvidia-modules-common.mk
-+++ b/kernel/nvidia-modules-common.mk
-@@ -222,6 +222,7 @@ build-sanity-checks:
- define BUILD_MODULE_RULE
-  $(1): build-sanity-checks $(3)
- 	@echo "NVIDIA: calling KBUILD..."; \
-+	touch .nv-kernel.o.cmd; \
- 	$$(MAKE) "CC=$$(CC)" NV_MODULE_SUFFIX=$$(strip $(2)) $$(KBUILD_PARAMS) modules; \
- 	echo "NVIDIA: left KBUILD."; \
- 	if ! [ -f $(1) ]; then \
-diff --git a/kernel/os-mlock.c b/kernel/os-mlock.c
-index 8a1fa2f..fc50543 100644
---- a/kernel/os-mlock.c
-+++ b/kernel/os-mlock.c
-@@ -44,11 +44,19 @@ RM_STATUS NV_API_CALL os_lock_user_pages(
-         return rmStatus;
-     }
- 
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
-+    down_read(&mm->mmap_lock);
-+    ret = NV_GET_USER_PAGES((unsigned long)address,
-+                            page_count, write, force, user_pages, NULL);
-+    up_read(&mm->mmap_lock);
-+    pinned = ret;
-+#else
-     down_read(&mm->mmap_sem);
-     ret = NV_GET_USER_PAGES((unsigned long)address,
-                             page_count, write, force, user_pages, NULL);
-     up_read(&mm->mmap_sem);
-     pinned = ret;
-+#endif
- 
-     if (ret < 0)
-     {
-diff --git a/kernel/uvm/nvidia_uvm_lite_api.c b/kernel/uvm/nvidia_uvm_lite_api.c
-index 8448eb6..97a4818 100644
---- a/kernel/uvm/nvidia_uvm_lite_api.c
-+++ b/kernel/uvm/nvidia_uvm_lite_api.c
-@@ -30,6 +30,10 @@
- #include "uvm_gpu_ops_tests.h"
- #endif
- 
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)
-+#define mmap_sem mmap_lock
-+#endif
-+
- //
- // nvidia_uvm_lite_api.c
- //
--- 
-2.29.0
-
diff --git a/srcpkgs/nvidia340/files/kernel-5.9.patch b/srcpkgs/nvidia340/files/kernel-5.9.patch
deleted file mode 100644
index d8584314f24..00000000000
--- a/srcpkgs/nvidia340/files/kernel-5.9.patch
+++ /dev/null
@@ -1,107 +0,0 @@
-From fea401df7500bfbead5a42b1e74560dbddf2f5a3 Mon Sep 17 00:00:00 2001
-From: graysky <graysky@archlinux.us>
-Date: Thu, 22 Oct 2020 07:00:35 -0400
-Subject: [PATCH 3/3] kernel-5.9
-
-credit: https://github.com/warpme/minimyth2/blob/master/script/nvidia/nvidia-340.108/files/nvidia-340.108-fix-5.9-kernel-compile.patch
----
- kernel/nv-drm.c               | 8 ++++++++
- kernel/nv-linux.h             | 9 +++++++--
- kernel/nv.c                   | 4 ++++
- kernel/uvm/nvidia_uvm_linux.h | 2 ++
- 4 files changed, 21 insertions(+), 2 deletions(-)
-
-diff --git a/kernel/nv-drm.c b/kernel/nv-drm.c
-index 85db07e..f0c1299 100644
---- a/kernel/nv-drm.c
-+++ b/kernel/nv-drm.c
-@@ -415,7 +415,11 @@ static struct drm_driver nv_drm_driver = {
-     .set_busid = drm_pci_set_busid,
- #endif
- 
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
-+    .gem_free_object_unlocked = nv_gem_free,
-+#else
-     .gem_free_object = nv_gem_free,
-+#endif
- 
-     .prime_handle_to_fd = drm_gem_prime_handle_to_fd,
-     .gem_prime_export = drm_gem_prime_export,
-@@ -511,8 +515,12 @@ RM_STATUS NV_API_CALL nv_alloc_os_descriptor_handle(
- 
- #if defined(NV_DRM_GEM_OBJECT_PUT_UNLOCKED_PRESENT)
-     drm_gem_object_put_unlocked(&nv_obj->base);
-+#else
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
-+    drm_gem_object_put_locked(&nv_obj->base);
- #else
-     drm_gem_object_unreference_unlocked(&nv_obj->base);
-+#endif
- #endif
- 
-     status = RM_OK;
-diff --git a/kernel/nv-linux.h b/kernel/nv-linux.h
-index d055552..524a8fe 100644
---- a/kernel/nv-linux.h
-+++ b/kernel/nv-linux.h
-@@ -136,8 +136,10 @@
- 
- #if defined(NVCPU_X86_64) && !defined(HAVE_COMPAT_IOCTL)
- #include <linux/syscalls.h>         /* sys_ioctl()                      */
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 9, 0)
- #include <linux/ioctl32.h>          /* register_ioctl32_conversion()    */
- #endif
-+#endif
- 
- #if !defined(NV_FILE_OPERATIONS_HAS_IOCTL) && \
-   !defined(NV_FILE_OPERATIONS_HAS_UNLOCKED_IOCTL)
-@@ -2249,10 +2251,13 @@ static inline NvU64 nv_node_end_pfn(int nid)
-                                             pages, vmas, NULL);
- 
-         #else
--
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
-+               return get_user_pages_remote(mm, start, nr_pages, flags,
-+                                            pages, vmas, NULL);
-+#else
-                return get_user_pages_remote(tsk, mm, start, nr_pages, flags,
-                                             pages, vmas);
--
-+#endif
-         #endif
- 
-         }
-diff --git a/kernel/nv.c b/kernel/nv.c
-index a218f83..be4e0f8 100644
---- a/kernel/nv.c
-+++ b/kernel/nv.c
-@@ -2785,7 +2785,11 @@ nvidia_probe
- 
- #if defined(CONFIG_VGA_ARB)
- #if defined(VGA_DEFAULT_DEVICE)
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 9, 0)
-+    vga_get(VGA_DEFAULT_DEVICE, VGA_RSRC_LEGACY_MASK, 0);
-+#else
-     vga_tryget(VGA_DEFAULT_DEVICE, VGA_RSRC_LEGACY_MASK);
-+#endif
- #endif
-     vga_set_legacy_decoding(dev, VGA_RSRC_NONE);
- #endif
-diff --git a/kernel/uvm/nvidia_uvm_linux.h b/kernel/uvm/nvidia_uvm_linux.h
-index 1625209..efc181f 100644
---- a/kernel/uvm/nvidia_uvm_linux.h
-+++ b/kernel/uvm/nvidia_uvm_linux.h
-@@ -158,8 +158,10 @@
- 
- #if defined(NVCPU_X86_64) && !defined(HAVE_COMPAT_IOCTL)
- #include <linux/syscalls.h>         /* sys_ioctl()                      */
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 9, 0)
- #include <linux/ioctl32.h>          /* register_ioctl32_conversion()    */
- #endif
-+#endif
- 
- #if !defined(NV_FILE_OPERATIONS_HAS_IOCTL) && \
-   !defined(NV_FILE_OPERATIONS_HAS_UNLOCKED_IOCTL)
--- 
-2.29.0
-
diff --git a/srcpkgs/nvidia340/files/kernel-5.x.patch b/srcpkgs/nvidia340/files/kernel-5.x.patch
deleted file mode 100644
index d7f763bbe39..00000000000
--- a/srcpkgs/nvidia340/files/kernel-5.x.patch
+++ /dev/null
@@ -1,781 +0,0 @@
-From 2154cc447a2377cfd60a7b7c5b619e689ebf71b1 Mon Sep 17 00:00:00 2001
-From: graysky <graysky@archlinux.us>
-Date: Thu, 22 Oct 2020 06:58:53 -0400
-Subject: [PATCH 1/3] kernel-5.7
-
-Contains a bunch of stuff required for things up to 5.7.
-credit: https://gitlab.manjaro.org/packages?utf8=%E2%9C%93&filter=nvidia-340xx
----
- kernel/Makefile              |   5 +
- kernel/conftest.sh           |  81 +++++++++++++
- kernel/dkms.conf             |   8 +-
- kernel/nv-drm.c              | 229 ++++++++++++++++++++++++++++++++++-
- kernel/nv-linux.h            |  49 ++++++++
- kernel/nv-procfs.c           |  20 +++
- kernel/nv-time.h             |   9 +-
- kernel/nv.c                  |   2 +-
- kernel/os-interface.c        |   8 +-
- kernel/uvm/Makefile          |   1 +
- kernel/uvm/conftest.sh       |   4 +
- kernel/uvm/nvidia_uvm_lite.c |  29 ++++-
- 12 files changed, 431 insertions(+), 14 deletions(-)
-
-diff --git a/kernel/Makefile b/kernel/Makefile
-index 125a690..2597080 100644
---- a/kernel/Makefile
-+++ b/kernel/Makefile
-@@ -108,12 +108,14 @@ COMPILE_TESTS = \
- 	acquire_console_sem \
- 	console_lock \
- 	kmem_cache_create \
-+	kmem_cache_create_usercopy \
- 	outer_flush_all \
- 	on_each_cpu \
- 	smp_call_function \
- 	nvmap_support \
- 	acpi_evaluate_integer \
- 	ioremap_cache \
-+	ioremap_nocache \
- 	ioremap_wc \
- 	proc_dir_entry \
- 	INIT_WORK \
-@@ -122,6 +124,7 @@ COMPILE_TESTS = \
- 	pci_domain_nr \
- 	pci_dma_mapping_error \
- 	file_operations \
-+	proc_ops \
- 	sg_alloc_table \
- 	sg_init_table \
- 	pci_get_domain_bus_and_slot \
-@@ -147,6 +150,8 @@ COMPILE_TESTS = \
- 	vm_fault_present \
- 	vm_fault_has_address \
- 	drm_driver_unload_has_int_return_type \
-+	drm_get_pci_dev \
-+	drm_pci_init \
- 	drm_legacy_pci_init \
- 	timer_setup \
- 	do_gettimeofday \
-diff --git a/kernel/conftest.sh b/kernel/conftest.sh
-index b7a85f0..a5225e5 100755
---- a/kernel/conftest.sh
-+++ b/kernel/conftest.sh
-@@ -176,6 +176,7 @@ test_headers() {
-     FILES="$FILES linux/ktime.h"
-     FILES="$FILES linux/file.h"
- 
-+    FILES_ARCH="$FILES_ARCH asm/pgtable.h"
-     FILES_ARCH="$FILES_ARCH asm/set_memory.h"
- 
-     translate_and_find_header_files $HEADERS      $FILES
-@@ -440,6 +441,9 @@ compile_test() {
-             # Determine if the set_memory_array_uc() function is present.
-             #
-             CODE="
-+            #if defined(NV_ASM_PGTABLE_H_PRESENT)
-+            #include <asm/pgtable.h>
-+            #endif
-             #if defined(NV_ASM_SET_MEMORY_H_PRESENT)
-             #include <asm/set_memory.h>
-             #else
-@@ -914,6 +918,21 @@ compile_test() {
-             fi
-         ;;
- 
-+        kmem_cache_create_usercopy)
-+            #
-+            # Determine if the kmem_cache_create_usercopy function exists.
-+            #
-+            # This function was added by:
-+            #   2017-06-10  8eb8284b412906181357c2b0110d879d5af95e52
-+            CODE="
-+            #include <linux/slab.h>
-+            void kmem_cache_create_usercopy(void) {
-+                kmem_cache_create_usercopy();
-+            }"
-+
-+            compile_check_conftest "$CODE" "NV_KMEM_CACHE_CREATE_USERCOPY_PRESENT" "" "functions"
-+        ;;
-+
-         smp_call_function)
-             #
-             # Determine if the smp_call_function() function is
-@@ -1188,6 +1207,22 @@ compile_test() {
-             compile_check_conftest "$CODE" "NV_IOREMAP_CACHE_PRESENT" "" "functions"
-         ;;
- 
-+        ioremap_nocache)
-+            #
-+            # Determine if the ioremap_nocache() function is present.
-+            #
-+            # Removed by commit 4bdc0d676a64 ("remove ioremap_nocache and
-+            # devm_ioremap_nocache") in v5.6 (2020-01-06)
-+            #
-+            CODE="
-+            #include <asm/io.h>
-+            void conftest_ioremap_nocache(void) {
-+                ioremap_nocache();
-+            }"
-+
-+            compile_check_conftest "$CODE" "NV_IOREMAP_NOCACHE_PRESENT" "" "functions"
-+        ;;
-+
-         ioremap_wc)
-             #
-             # Determine if the ioremap_wc() function is present.
-@@ -1371,6 +1406,16 @@ compile_test() {
-             compile_check_conftest "$CODE" "NV_FILE_OPERATIONS_HAS_COMPAT_IOCTL" "" "types"
-         ;;
- 
-+        proc_ops)
-+            CODE="
-+            #include <linux/proc_fs.h>
-+            int conftest_proc_ops(void) {
-+                return offsetof(struct proc_ops, proc_open);
-+            }"
-+
-+            compile_check_conftest "$CODE" "NV_HAVE_PROC_OPS" "" "types"
-+        ;;
-+
-         sg_init_table)
-             #
-             # Determine if the sg_init_table() function is present.
-@@ -2044,6 +2089,42 @@ compile_test() {
-             compile_check_conftest "$CODE" "NV_DRM_DRIVER_UNLOAD_HAS_INT_RETURN_TYPE" "" "types"
-         ;;
- 
-+        drm_get_pci_dev)
-+            #
-+            # Determine if drm_get_pci_dev() is present.
-+            #
-+            CODE="
-+            #if defined(NV_DRM_DRMP_H_PRESENT)
-+            #include <drm/drmP.h>
-+            #endif
-+
-+            #if defined(NV_DRM_DRM_PCI_H_PRESENT)
-+            #include <drm/drm_pci.h>
-+            #endif
-+
-+            void conftest_drm_legacy_pci_init(void) {
-+                drm_get_pci_dev();
-+            }"
-+
-+            compile_check_conftest "$CODE" "NV_DRM_GET_PCI_DEV_PRESENT" "" "functions"
-+        ;;
-+
-+        drm_pci_init)
-+            #
-+            # Determine if drm_pci_init() is present.
-+            #
-+            CODE="
-+            #if defined(NV_DRM_DRMP_H_PRESENT)
-+            #include <drm/drmP.h>
-+            #endif
-+
-+            void conftest_drm_legacy_pci_init(void) {
-+                drm_pci_init();
-+            }"
-+
-+            compile_check_conftest "$CODE" "NV_DRM_PCI_INIT_PRESENT" "" "functions"
-+        ;;
-+
-         drm_legacy_pci_init)
-             #
-             # Determine if drm_legacy_pci_init() is present. drm_pci_init() was
-diff --git a/kernel/dkms.conf b/kernel/dkms.conf
-index 79a02ae..3140f03 100644
---- a/kernel/dkms.conf
-+++ b/kernel/dkms.conf
-@@ -1,7 +1,13 @@
-+if [ -x /usr/bin/nproc ]; then
-+  num_cpu_cores=$(nproc)
-+else
-+  num_cpu_cores=1
-+fi
-+
- PACKAGE_NAME="nvidia"
- PACKAGE_VERSION="340.108"
- BUILT_MODULE_NAME[0]="$PACKAGE_NAME"
- DEST_MODULE_LOCATION[0]="/kernel/drivers/video"
--MAKE[0]="make module KERNEL_UNAME=${kernelver}"
-+MAKE[0]="make -j$num_cpu_cores module KERNEL_UNAME=${kernelver}"
- CLEAN="make clean"
- AUTOINSTALL="yes"
-diff --git a/kernel/nv-drm.c b/kernel/nv-drm.c
-index 0d1cdbf..85db07e 100644
---- a/kernel/nv-drm.c
-+++ b/kernel/nv-drm.c
-@@ -50,9 +50,236 @@
- #if defined(NV_DRM_LEGACY_PCI_INIT_PRESENT)
- #define nv_drm_pci_init drm_legacy_pci_init
- #define nv_drm_pci_exit drm_legacy_pci_exit
--#else
-+#elif defined(NV_DRM_PCI_INIT_PRESENT)
- #define nv_drm_pci_init drm_pci_init
- #define nv_drm_pci_exit drm_pci_exit
-+#else
-+#if defined(NV_DRM_GET_PCI_DEV_PRESENT)
-+#define nv_drm_get_pci_dev drm_get_pci_dev
-+#else
-+#include <drm/drm_agpsupport.h>
-+
-+struct nv_drm_agp_head {
-+    struct agp_kern_info agp_info;
-+    struct list_head memory;
-+    unsigned long mode;
-+    struct agp_bridge_data *bridge;
-+    int enabled;
-+    int acquired;
-+    unsigned long base;
-+    int agp_mtrr;
-+    int cant_use_aperture;
-+    unsigned long page_mask;
-+};
-+
-+struct nv_drm_agp_mem {
-+    unsigned long handle;
-+    struct agp_memory *memory;
-+    unsigned long bound;
-+    int pages;
-+    struct list_head head;
-+};
-+
-+/*
-+ * Code from drm_agp_init/nv_drm_{free,unbind}_agp
-+ * Extracted from commit: 5b8b9d0c6d0e0f1993c6c56deaf9646942c49d94, file: drivers/gpu/drm/drm_agpsupport.c
-+ */
-+struct drm_agp_head *nv_drm_agp_init(struct drm_device *dev)
-+{
-+    struct nv_drm_agp_head *head = NULL;
-+
-+    head = kzalloc(sizeof(*head), GFP_KERNEL);
-+    if (!head)
-+        return NULL;
-+    head->bridge = agp_find_bridge(dev->pdev);
-+    if (!head->bridge) {
-+        head->bridge = agp_backend_acquire(dev->pdev);
-+        if (!head->bridge) {
-+            kfree(head);
-+            return NULL;
-+        }
-+        agp_copy_info(head->bridge, &head->agp_info);
-+        agp_backend_release(head->bridge);
-+    } else {
-+        agp_copy_info(head->bridge, &head->agp_info);
-+    }
-+    if (head->agp_info.chipset == NOT_SUPPORTED) {
-+        kfree(head);
-+        return NULL;
-+    }
-+    INIT_LIST_HEAD(&head->memory);
-+    head->cant_use_aperture = head->agp_info.cant_use_aperture;
-+    head->page_mask = head->agp_info.page_mask;
-+    head->base = head->agp_info.aper_base;
-+    return (struct drm_agp_head *)head;
-+}
-+
-+void nv_drm_free_agp(struct agp_memory *handle, int pages)
-+{
-+    agp_free_memory(handle);
-+}
-+
-+int nv_drm_unbind_agp(struct agp_memory *handle)
-+{
-+    return agp_unbind_memory(handle);
-+}
-+
-+/*
-+ * Code from drm_pci_agp_{clear,destroy,init}/drm_get_pci_dev
-+ * Extracted from commit: 5b8b9d0c6d0e0f1993c6c56deaf9646942c49d94, file: drivers/gpu/drm/drm_pci.c
-+ */
-+static void nv_drm_pci_agp_init(struct drm_device *dev)
-+{
-+    if (drm_core_check_feature(dev, DRIVER_USE_AGP)) {
-+        if (pci_find_capability(dev->pdev, PCI_CAP_ID_AGP))
-+            dev->agp = nv_drm_agp_init(dev);
-+        if (dev->agp) {
-+            dev->agp->agp_mtrr = arch_phys_wc_add(
-+                dev->agp->agp_info.aper_base,
-+                dev->agp->agp_info.aper_size *
-+                1024 * 1024);
-+        }
-+    }
-+}
-+
-+void nv_drm_legacy_agp_clear(struct drm_device *dev)
-+{
-+    struct nv_drm_agp_mem *entry, *tempe;
-+
-+    if (!dev->agp)
-+        return;
-+    if (!drm_core_check_feature(dev, DRIVER_LEGACY))
-+        return;
-+
-+    list_for_each_entry_safe(entry, tempe, &dev->agp->memory, head) {
-+        if (entry->bound)
-+            nv_drm_unbind_agp(entry->memory);
-+        nv_drm_free_agp(entry->memory, entry->pages);
-+        kfree(entry);
-+    }
-+    INIT_LIST_HEAD(&dev->agp->memory);
-+
-+    if (dev->agp->acquired)
-+        drm_agp_release(dev);
-+
-+    dev->agp->acquired = 0;
-+    dev->agp->enabled = 0;
-+}
-+
-+void nv_drm_pci_agp_destroy(struct drm_device *dev)
-+{
-+    if (dev->agp) {
-+        arch_phys_wc_del(dev->agp->agp_mtrr);
-+        nv_drm_legacy_agp_clear(dev);
-+        kfree(dev->agp);
-+        dev->agp = NULL;
-+    }
-+}
-+
-+static int nv_drm_get_pci_dev(struct pci_dev *pdev,
-+               const struct pci_device_id *ent,
-+               struct drm_driver *driver)
-+{
-+    struct drm_device *dev;
-+    int ret;
-+
-+    DRM_DEBUG("\n");
-+
-+    dev = drm_dev_alloc(driver, &pdev->dev);
-+    if (IS_ERR(dev))
-+        return PTR_ERR(dev);
-+
-+    ret = pci_enable_device(pdev);
-+    if (ret)
-+        goto err_free;
-+
-+    dev->pdev = pdev;
-+#ifdef __alpha__
-+    dev->hose = pdev->sysdata;
-+#endif
-+
-+    if (drm_core_check_feature(dev, DRIVER_MODESET))
-+        pci_set_drvdata(pdev, dev);
-+
-+    nv_drm_pci_agp_init(dev);
-+
-+    ret = drm_dev_register(dev, ent->driver_data);
-+    if (ret)
-+        goto err_agp;
-+
-+    /* No locking needed since shadow-attach is single-threaded since it may
-+     * only be called from the per-driver module init hook. */
-+    if (drm_core_check_feature(dev, DRIVER_LEGACY))
-+        list_add_tail(&dev->legacy_dev_list, &driver->legacy_dev_list);
-+
-+    return 0;
-+
-+err_agp:
-+    nv_drm_pci_agp_destroy(dev);
-+    pci_disable_device(pdev);
-+err_free:
-+    drm_dev_put(dev);
-+    return ret;
-+}
-+#endif
-+
-+/*
-+ * Code from drm_legacy_pci_{init,exit}
-+ * Extracted from tag: v5.6.3, file: drivers/gpu/drm/drm_pci.c
-+ */
-+int nv_drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver)
-+{
-+    struct pci_dev *pdev = NULL;
-+    const struct pci_device_id *pid;
-+    int i;
-+
-+    DRM_DEBUG("\n");
-+
-+    if (WARN_ON(!(driver->driver_features & DRIVER_LEGACY)))
-+        return -EINVAL;
-+
-+    /* If not using KMS, fall back to stealth mode manual scanning. */
-+    INIT_LIST_HEAD(&driver->legacy_dev_list);
-+    for (i = 0; pdriver->id_table[i].vendor != 0; i++) {
-+        pid = &pdriver->id_table[i];
-+
-+        /* Loop around setting up a DRM device for each PCI device
-+         * matching our ID and device class.  If we had the internal
-+         * function that pci_get_subsys and pci_get_class used, we'd
-+         * be able to just pass pid in instead of doing a two-stage
-+         * thing.
-+         */
-+        pdev = NULL;
-+        while ((pdev =
-+            pci_get_subsys(pid->vendor, pid->device, pid->subvendor,
-+                       pid->subdevice, pdev)) != NULL) {
-+            if ((pdev->class & pid->class_mask) != pid->class)
-+                continue;
-+
-+            /* stealth mode requires a manual probe */
-+            pci_dev_get(pdev);
-+            nv_drm_get_pci_dev(pdev, pid, driver);
-+        }
-+    }
-+    return 0;
-+}
-+
-+void nv_drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver)
-+{
-+    struct drm_device *dev, *tmp;
-+    DRM_DEBUG("\n");
-+
-+    if (!(driver->driver_features & DRIVER_LEGACY)) {
-+        WARN_ON(1);
-+    } else {
-+        list_for_each_entry_safe(dev, tmp, &driver->legacy_dev_list,
-+                     legacy_dev_list) {
-+            list_del(&dev->legacy_dev_list);
-+            drm_put_dev(dev);
-+        }
-+    }
-+    DRM_INFO("Module unloaded\n");
-+}
- #endif
- 
- extern nv_linux_state_t *nv_linux_devices;
-diff --git a/kernel/nv-linux.h b/kernel/nv-linux.h
-index a1d2c68..83e6433 100644
---- a/kernel/nv-linux.h
-+++ b/kernel/nv-linux.h
-@@ -688,11 +688,16 @@ extern nv_spinlock_t km_lock;
-         VM_ALLOC_RECORD(ptr, size, "vm_ioremap"); \
-     }
- 
-+#if defined(NV_IOREMAP_NOCACHE_PRESENT)
- #define NV_IOREMAP_NOCACHE(ptr, physaddr, size) \
-     { \
-         (ptr) = ioremap_nocache(physaddr, size); \
-         VM_ALLOC_RECORD(ptr, size, "vm_ioremap_nocache"); \
-     }
-+#else
-+#define NV_IOREMAP_NOCACHE(ptr, physaddr, size) \
-+    NV_IOREMAP(ptr, physaddr, size)
-+#endif
- 
- #if defined(NV_IOREMAP_CACHE_PRESENT)
- #define NV_IOREMAP_CACHE(ptr, physaddr, size)            \
-@@ -774,6 +779,17 @@ extern nv_spinlock_t km_lock;
- #error "NV_KMEM_CACHE_CREATE() undefined (kmem_cache_create() unavailable)!"
- #endif
- 
-+#if defined(NV_KMEM_CACHE_CREATE_USERCOPY_PRESENT)
-+#define NV_KMEM_CACHE_CREATE_USERCOPY(kmem_cache, name, type)       \
-+    {                                                               \
-+        kmem_cache = kmem_cache_create_usercopy(name, sizeof(type), \
-+                        0, 0, 0, sizeof(type), NULL);               \
-+    }
-+#else
-+#define NV_KMEM_CACHE_CREATE_USERCOPY(kmem_cache, name, type)       \
-+        NV_KMEM_CACHE_CREATE(kmem_cache, name, type)
-+#endif
-+
- #define NV_KMEM_CACHE_ALLOC(ptr, kmem_cache, type)              \
-     {                                                           \
-         (ptr) = kmem_cache_alloc(kmem_cache, GFP_KERNEL);       \
-@@ -1971,6 +1987,19 @@ extern NvU32 nv_assign_gpu_count;
-     })
- #endif
- 
-+#if defined(NV_HAVE_PROC_OPS)
-+#define NV_CREATE_PROC_FILE(filename,parent,__name,__data)               \
-+   ({                                                                    \
-+        struct proc_dir_entry *__entry;                                  \
-+        int mode = (S_IFREG | S_IRUGO);                                  \
-+        const struct proc_ops *fops = &nv_procfs_##__name##_fops;        \
-+        if (fops->proc_write != 0)                                       \
-+            mode |= S_IWUSR;                                             \
-+        __entry = NV_CREATE_PROC_ENTRY(filename, mode, parent, fops,     \
-+            __data);                                                     \
-+        __entry;                                                         \
-+    })
-+#else
- #define NV_CREATE_PROC_FILE(filename,parent,__name,__data)               \
-    ({                                                                    \
-         struct proc_dir_entry *__entry;                                  \
-@@ -1982,6 +2011,7 @@ extern NvU32 nv_assign_gpu_count;
-             __data);                                                     \
-         __entry;                                                         \
-     })
-+#endif
- 
- /*
-  * proc_mkdir_mode exists in Linux 2.6.9, but isn't exported until Linux 3.0.
-@@ -2023,6 +2053,24 @@ extern NvU32 nv_assign_gpu_count;
-     remove_proc_entry(entry->name, entry->parent);
- #endif
- 
-+#if defined(NV_HAVE_PROC_OPS)
-+#define NV_DEFINE_PROCFS_SINGLE_FILE(__name)                                  \
-+    static int nv_procfs_open_##__name(                                       \
-+        struct inode *inode,                                                  \
-+        struct file *filep                                                    \
-+    )                                                                         \
-+    {                                                                         \
-+        return single_open(filep, nv_procfs_read_##__name,                    \
-+            NV_PDE_DATA(inode));                                              \
-+    }                                                                         \
-+                                                                              \
-+    static const struct proc_ops nv_procfs_##__name##_fops = {                \
-+        .proc_open       = nv_procfs_open_##__name,                           \
-+        .proc_read       = seq_read,                                          \
-+        .proc_lseek      = seq_lseek,                                         \
-+        .proc_release    = single_release,                                    \
-+    };
-+#else
- #define NV_DEFINE_PROCFS_SINGLE_FILE(__name)                                  \
-     static int nv_procfs_open_##__name(                                       \
-         struct inode *inode,                                                  \
-@@ -2040,6 +2088,7 @@ extern NvU32 nv_assign_gpu_count;
-         .llseek     = seq_lseek,                                              \
-         .release    = single_release,                                         \
-     };
-+#endif
- 
- #endif  /* CONFIG_PROC_FS */
- 
-diff --git a/kernel/nv-procfs.c b/kernel/nv-procfs.c
-index ebca3e8..9365c3c 100644
---- a/kernel/nv-procfs.c
-+++ b/kernel/nv-procfs.c
-@@ -409,6 +409,15 @@ done:
-     return ((status < 0) ? status : (int)count);
- }
- 
-+#if defined(NV_HAVE_PROC_OPS)
-+static struct proc_ops nv_procfs_registry_fops = {
-+    .proc_open    = nv_procfs_open_registry,
-+    .proc_read    = seq_read,
-+    .proc_write   = nv_procfs_write_file,
-+    .proc_lseek   = seq_lseek,
-+    .proc_release = nv_procfs_close_registry,
-+};
-+#else
- static struct file_operations nv_procfs_registry_fops = {
-     .owner   = THIS_MODULE,
-     .open    = nv_procfs_open_registry,
-@@ -417,6 +426,7 @@ static struct file_operations nv_procfs_registry_fops = {
-     .llseek  = seq_lseek,
-     .release = nv_procfs_close_registry,
- };
-+#endif
- 
- static int
- nv_procfs_read_unbind_lock(
-@@ -538,6 +548,15 @@ done:
-     return rc;
- }
- 
-+#if defined(NV_HAVE_PROC_OPS)
-+static struct proc_ops nv_procfs_unbind_lock_fops = {
-+    .proc_open    = nv_procfs_open_unbind_lock,
-+    .proc_read    = seq_read,
-+    .proc_write   = nv_procfs_write_file,
-+    .proc_lseek   = seq_lseek,
-+    .proc_release = nv_procfs_close_unbind_lock,
-+};
-+#else
- static struct file_operations nv_procfs_unbind_lock_fops = {
-     .owner   = THIS_MODULE,
-     .open    = nv_procfs_open_unbind_lock,
-@@ -546,6 +565,7 @@ static struct file_operations nv_procfs_unbind_lock_fops = {
-     .llseek  = seq_lseek,
-     .release = nv_procfs_close_unbind_lock,
- };
-+#endif
- 
- static int
- nv_procfs_read_text_file(
-diff --git a/kernel/nv-time.h b/kernel/nv-time.h
-index a34ceb2..780f8bc 100644
---- a/kernel/nv-time.h
-+++ b/kernel/nv-time.h
-@@ -28,7 +28,12 @@
- #include <linux/ktime.h>
- #endif
- 
--static inline void nv_gettimeofday(struct timeval *tv)
-+struct nv_timeval {
-+    __kernel_long_t      tv_sec;
-+    __kernel_suseconds_t tv_usec;
-+};
-+
-+static inline void nv_gettimeofday(struct nv_timeval *tv)
- {
- #ifdef NV_DO_GETTIMEOFDAY_PRESENT
-     do_gettimeofday(tv);
-@@ -37,7 +42,7 @@ static inline void nv_gettimeofday(struct timeval *tv)
- 
-     ktime_get_real_ts64(&now);
- 
--    *tv = (struct timeval) {
-+    *tv = (struct nv_timeval) {
-         .tv_sec = now.tv_sec,
-         .tv_usec = now.tv_nsec/1000,
-     };
-diff --git a/kernel/nv.c b/kernel/nv.c
-index a167be9..a218f83 100644
---- a/kernel/nv.c
-+++ b/kernel/nv.c
-@@ -752,7 +752,7 @@ int __init nvidia_init_module(void)
-     NV_SPIN_LOCK_INIT(&km_lock);
- #endif
- 
--    NV_KMEM_CACHE_CREATE(nv_stack_t_cache, NV_STACK_CACHE_STR, nv_stack_t);
-+    NV_KMEM_CACHE_CREATE_USERCOPY(nv_stack_t_cache, NV_STACK_CACHE_STR, nv_stack_t);
-     if (nv_stack_t_cache == NULL)
-     {
-         nv_printf(NV_DBG_ERRORS, "NVRM: stack cache allocation failed!\n");
-diff --git a/kernel/os-interface.c b/kernel/os-interface.c
-index 7190b26..0c0dc05 100644
---- a/kernel/os-interface.c
-+++ b/kernel/os-interface.c
-@@ -439,7 +439,7 @@ RM_STATUS NV_API_CALL os_get_current_time(
-     NvU32 *useconds
- )
- {
--    struct timeval tm;
-+    struct nv_timeval tm;
- 
-     nv_gettimeofday(&tm);
- 
-@@ -474,7 +474,7 @@ RM_STATUS NV_API_CALL os_delay_us(NvU32 MicroSeconds)
-     unsigned long usec;
- 
- #ifdef NV_CHECK_DELAY_ACCURACY
--    struct timeval tm1, tm2;
-+    struct nv_timeval tm1, tm2;
- 
-     nv_gettimeofday(&tm1);
- #endif
-@@ -514,9 +514,9 @@ RM_STATUS NV_API_CALL os_delay(NvU32 MilliSeconds)
-     unsigned long MicroSeconds;
-     unsigned long jiffies;
-     unsigned long mdelay_safe_msec;
--    struct timeval tm_end, tm_aux;
-+    struct nv_timeval tm_end, tm_aux;
- #ifdef NV_CHECK_DELAY_ACCURACY
--    struct timeval tm_start;
-+    struct nv_timeval tm_start;
- #endif
- 
-     nv_gettimeofday(&tm_aux);
-diff --git a/kernel/uvm/Makefile b/kernel/uvm/Makefile
-index 0cad8ff..043a08d 100644
---- a/kernel/uvm/Makefile
-+++ b/kernel/uvm/Makefile
-@@ -207,6 +207,7 @@ ccflags-y += $(EXTRA_CFLAGS)
- 
- RM_MODULE_SYMVERS:= $(RM_OUT_DIR)/Module.symvers
- UVM_MODULE_SYMVERS:= $(obj)/Module.symvers
-+KBUILD_EXTRA_SYMBOLS:= $(UVM_MODULE_SYMVERS)
- 
- module $(MODULE_NAME).ko: $(UVM_MODULE_SYMVERS) debug_diagnostics_printing
- 
-diff --git a/kernel/uvm/conftest.sh b/kernel/uvm/conftest.sh
-index b7a85f0..33e2a63 100755
---- a/kernel/uvm/conftest.sh
-+++ b/kernel/uvm/conftest.sh
-@@ -176,6 +176,7 @@ test_headers() {
-     FILES="$FILES linux/ktime.h"
-     FILES="$FILES linux/file.h"
- 
-+    FILES_ARCH="$FILES_ARCH asm/pgtable.h"
-     FILES_ARCH="$FILES_ARCH asm/set_memory.h"
- 
-     translate_and_find_header_files $HEADERS      $FILES
-@@ -440,6 +441,9 @@ compile_test() {
-             # Determine if the set_memory_array_uc() function is present.
-             #
-             CODE="
-+            #if defined(NV_ASM_PGTABLE_H_PRESENT)
-+            #include <asm/pgtable.h>
-+            #endif
-             #if defined(NV_ASM_SET_MEMORY_H_PRESENT)
-             #include <asm/set_memory.h>
-             #else
-diff --git a/kernel/uvm/nvidia_uvm_lite.c b/kernel/uvm/nvidia_uvm_lite.c
-index 6943e7c..9a7e3b6 100644
---- a/kernel/uvm/nvidia_uvm_lite.c
-+++ b/kernel/uvm/nvidia_uvm_lite.c
-@@ -131,8 +131,8 @@ static
- RM_STATUS _preexisting_error_on_channel(UvmGpuMigrationTracking *pMigTracker,
-                                          UvmCommitRecord *pRecord);
- 
--static void _set_timeout_in_usec(struct timeval *src,
--                                 struct timeval *result,
-+static void _set_timeout_in_usec(struct nv_timeval *src,
-+                                 struct nv_timeval *result,
-                                  unsigned long timeoutInUsec)
- {
-     if (!src || !result)
-@@ -820,7 +820,13 @@ done:
- }
- 
- #if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
-+vm_fault_t _fault(struct vm_fault *vmf)
-+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
-+int _fault(struct vm_fault *vmf)
-+#else
- int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)
-+#endif
- {
- #if defined(NV_VM_FAULT_HAS_ADDRESS)
-     unsigned long vaddr = vmf->address;
-@@ -828,8 +834,15 @@ int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)
-     unsigned long vaddr = (unsigned long)vmf->virtual_address;
- #endif
-     struct page *page = NULL;
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
-+    vm_fault_t retval;
-+#else
-     int retval;
- 
-+#endif
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
-+   struct vm_area_struct *vma = vmf->vma;
-+#endif
-     retval = _fault_common(vma, vaddr, &page, vmf->flags);
- 
-     vmf->page = page;
-@@ -868,7 +881,13 @@ static struct vm_operations_struct uvmlite_vma_ops =
- // it's dealing with anonymous mapping (see handle_pte_fault).
- //
- #if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0)
-+vm_fault_t _sigbus_fault(struct vm_fault *vmf)
-+#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
-+int _sigbus_fault(struct vm_fault *vmf)
-+#else
- int _sigbus_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
-+#endif
- {
-     vmf->page = NULL;
-     return VM_FAULT_SIGBUS;
-@@ -1992,9 +2011,9 @@ void umvlite_destroy_per_process_gpu_resources(UvmGpuUuid *gpuUuidStruct)
- static RM_STATUS _check_ecc_errors(UvmGpuMigrationTracking *pMigTracker,
-                                     NvBool *pIsEccErrorSet)
- {
--    struct timeval eccErrorStartTime = {0};
--    struct timeval eccErrorCurrentTime = {0};
--    struct timeval eccTimeout = {0};
-+    struct nv_timeval eccErrorStartTime = {0};
-+    struct nv_timeval eccErrorCurrentTime = {0};
-+    struct nv_timeval eccTimeout = {0};
-     NvBool bEccErrorTimeout = NV_FALSE;
-     NvBool bEccIncomingError = NV_FALSE;
-     unsigned rmInterruptSet = 0;
--- 
-2.29.0
-
diff --git a/srcpkgs/nvidia340/files/nvidia-glx.conf b/srcpkgs/nvidia340/files/nvidia-glx.conf
deleted file mode 100644
index 7c76883abb3..00000000000
--- a/srcpkgs/nvidia340/files/nvidia-glx.conf
+++ /dev/null
@@ -1,4 +0,0 @@
-Section "Files"
-    ModulePath "/usr/lib/nvidia/xorg"
-    ModulePath "/usr/lib/xorg/modules"
-EndSection
diff --git a/srcpkgs/nvidia340/template b/srcpkgs/nvidia340/template
deleted file mode 100644
index 166f35756bc..00000000000
--- a/srcpkgs/nvidia340/template
+++ /dev/null
@@ -1,223 +0,0 @@
-# Template file for 'nvidia340'
-
-_desc="NVIDIA drivers (GeForce 8, 9, 9M, 100, 100M, 200, 300 series)"
-
-pkgname=nvidia340
-version=340.108
-revision=4
-maintainer="Orphaned <orphan@voidlinux.org>"
-license="custom:NVIDIA proprietary"
-homepage="http://www.nvidia.com"
-
-archs="i686 x86_64"
-nopie=yes
-repository=nonfree
-create_wrksrc=yes
-short_desc="${_desc} - Libraries and Utilities"
-hostmakedepends="tar"
-depends="${pkgname}-dkms-${version}_${revision} pkg-config"
-conflicts="catalyst>=0 xserver-abi-video>24_1"
-
-provides="nvidia-${version}_${revision}"
-replaces="nvidia>=0 nvidia-stable>=0"
-subpackages="${pkgname}-dkms ${pkgname}-opencl ${pkgname}-libs"
-
-if [ "$XBPS_TARGET_MACHINE" = "i686" ]; then
-	_pkg="NVIDIA-Linux-x86-${version}"
-	distfiles="http://us.download.nvidia.com/XFree86/Linux-x86/${version}/${_pkg}.run"
-	checksum=2032aad612d9f3af1aecf979cfdfe423d79aa76929ef8bf8d3a403076f507cca
-else
-	_pkg="NVIDIA-Linux-x86_64-${version}-no-compat32"
-	distfiles="http://us.download.nvidia.com/XFree86/Linux-x86_64/${version}/${_pkg}.run"
-	checksum=995d44fef587ff5284497a47a95d71adbee0c13020d615e940ac928f180f5b77
-fi
-
-do_extract() {
-	install -m755 ${XBPS_SRCDISTDIR}/${pkgname}-${version}/${_pkg}.run ${wrksrc}
-	cd ${wrksrc}
-	./${_pkg}.run --extract-only
-	rm -f ${_pkg}.run
-}
-
-do_patch() {
-	cd ${_pkg}
-	patch -p1 < ${FILESDIR}/kernel-5.x.patch
-	patch -p1 < ${FILESDIR}/kernel-5.8.patch
-	patch -p1 < ${FILESDIR}/kernel-5.9.patch
-}
-
-do_install() {
-	cd ${_pkg}
-
-	# X driver
-	vinstall nvidia_drv.so 755 usr/lib/xorg/modules/drivers
-
-	# GLX extension module for X
-	vinstall libglx.so.${version} 755 usr/lib/nvidia/xorg
-	ln -sf libglx.so.${version} ${DESTDIR}/usr/lib/nvidia/xorg/libglx.so.1
-	ln -sf libglx.so.${version} ${DESTDIR}/usr/lib/nvidia/xorg/libglx.so
-	# Override default ModulePath to load nvidia's glx instead of xorg's
-	vinstall ${FILESDIR}/nvidia-glx.conf 644 /usr/share/X11/xorg.conf.d 10-nvidia-glx.conf
-
-	# OpenGL libraries (GL, EGL and GLES)
-	vinstall libGL.so.${version} 755 usr/lib
-	ln -sf libGL.so.${version} ${DESTDIR}/usr/lib/libGL.so.1
-	vinstall libEGL.so.${version} 755 usr/lib
-	ln -sf libEGL.so.${version} ${DESTDIR}/usr/lib/libEGL.so.1
-	vinstall libGLESv1_CM.so.${version} 755 usr/lib
-	ln -sf libGLESv1_CM.so.${version} ${DESTDIR}/usr/lib/libGLESv1_CM.so.1
-	vinstall libGLESv2.so.${version} 755 usr/lib
-	ln -sf libGLESv2.so.${version} ${DESTDIR}/usr/lib/libGLESv2.so.2
-	# Some programs link to these libglvnd links
-	ln -sf libGL.so.1 ${DESTDIR}/usr/lib/libOpenGL.so.0
-	ln -sf libGL.so.1 ${DESTDIR}/usr/lib/libGLX.so.0
-
-	# OpenGL core library
-	vinstall libnvidia-glcore.so.${version} 755 usr/lib
-	ln -sf libnvidia-glcore.so.${version} ${DESTDIR}/usr/lib/libnvidia-glcore.so
-
-	# VDPAU
-	vinstall libvdpau_nvidia.so.${version} 755 usr/lib/vdpau
-	ln -sf libvdpau_nvidia.so.${version} ${DESTDIR}/usr/lib/vdpau/libvdpau_nvidia.so
-	ln -sf libvdpau_nvidia.so.${version} ${DESTDIR}/usr/lib/vdpau/libvdpau_nvidia.so.1
-
-	# misc libraries
-	vinstall tls/libnvidia-tls.so.${version} 755 usr/lib
-	ln -sf libnvidia-tls.so.${version} ${DESTDIR}/usr/lib/libnvidia-tls.so
-
-	vinstall libnvidia-cfg.so.${version} 755 usr/lib
-	ln -sf libnvidia-cfg.so.${version} ${DESTDIR}/usr/lib/libnvidia-cfg.so
-	ln -sf libnvidia-cfg.so.${version} ${DESTDIR}/usr/lib/libnvidia-cfg.so.1
-
-	vinstall libnvidia-ml.so.${version} 755 usr/lib
-	ln -sf libnvidia-ml.so.${version} ${DESTDIR}/usr/lib/libnvidia-ml.so
-	ln -sf libnvidia-ml.so.${version} ${DESTDIR}/usr/lib/libnvidia-ml.so.1
-
-	vinstall libnvidia-encode.so.${version} 755 usr/lib
-	ln -sf libnvidia-encode.so.${version} ${DESTDIR}/usr/lib/libnvidia-encode.so
-	ln -sf libnvidia-encode.so.${version} ${DESTDIR}/usr/lib/libnvidia-encode.so.1
-
-	vinstall libnvidia-ifr.so.${version} 755 usr/lib
-	ln -sf libnvidia-ifr.so.${version} ${DESTDIR}/usr/lib/libnvidia-ifr.so
-	ln -sf libnvidia-ifr.so.${version} ${DESTDIR}/usr/lib/libnvidia-ifr.so.1
-
-	vinstall libnvidia-fbc.so.${version} 755 usr/lib
-	ln -sf libnvidia-fbc.so.${version} ${DESTDIR}/usr/lib/libnvidia-fbc.so
-	ln -sf libnvidia-fbc.so.${version} ${DESTDIR}/usr/lib/libnvidia-fbc.so.1
-
-	vinstall libnvidia-glsi.so.${version} 755 usr/lib
-
-	# CUDA
-	vbin nvidia-cuda-mps-control
-	vbin nvidia-cuda-mps-server
-	vman nvidia-cuda-mps-control.1.gz
-
-	vinstall libcuda.so.${version} 755 usr/lib
-	ln -sf libcuda.so.${version} ${DESTDIR}/usr/lib/libcuda.so
-	ln -sf libcuda.so.${version} ${DESTDIR}/usr/lib/libcuda.so.1
-
-	vinstall libnvcuvid.so.${version} 755 usr/lib
-	ln -sf libnvcuvid.so.${version} ${DESTDIR}/usr/lib/libnvcuvid.so
-	ln -sf libnvcuvid.so.${version} ${DESTDIR}/usr/lib/libnvcuvid.so.1
-
-	# nvidia-xconfig
-	vbin nvidia-xconfig
-	vman nvidia-xconfig.1.gz
-
-	# nvidia-settings
-	vbin nvidia-settings
-	vman nvidia-settings.1.gz
-	vinstall nvidia-settings.desktop 644 usr/share/applications
-	vinstall nvidia-settings.png 644 usr/share/pixmaps
-	sed -e 's:__UTILS_PATH__:/usr/bin:' \
-		-e 's:__PIXMAP_PATH__:/usr/share/pixmaps:' \
-		-i ${DESTDIR}/usr/share/applications/nvidia-settings.desktop
-
-	# nvidia-bug-report
-	vbin nvidia-bug-report.sh nvidia-bug-report
-	vbin nvidia-debugdump
-
-	# nvidia-smi
-	vbin nvidia-smi
-	vman nvidia-smi.1.gz
-
-	# License and documentation.
-	vlicense LICENSE
-	vdoc README.txt README
-	vdoc NVIDIA_Changelog
-
-	# opencl pkg
-	vinstall nvidia.icd 644 etc/OpenCL/vendors
-
-	vinstall libnvidia-compiler.so.${version} 755 usr/lib
-	ln -sf libnvidia-compiler.so.${version} \
-		${DESTDIR}/usr/lib/libnvidia-compiler.so
-	ln -sf libnvidia-compiler.so.${version} \
-		${DESTDIR}/usr/lib/libnvidia-compiler.so.1
-
-	vinstall libnvidia-opencl.so.${version} 755 usr/lib
-	ln -sf libnvidia-opencl.so.${version} \
-		${DESTDIR}/usr/lib/libnvidia-opencl.so
-	ln -sf libnvidia-opencl.so.${version} \
-		${DESTDIR}/usr/lib/libnvidia-opencl.so.1
-
-	# dkms pkg
-	vmkdir usr/src/nvidia-${version}
-	# add nvidia-uvm dkms submodule too.
-	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
-		cat kernel/uvm/dkms.conf.fragment >> kernel/dkms.conf
-	fi
-	vcopy "kernel/*" usr/src/nvidia-${version}
-
-	# systemd modules-load.d(5) file.
-	vmkdir usr/lib/modules-load.d
-	echo "nvidia" > ${DESTDIR}/usr/lib/modules-load.d/nvidia.conf
-	chmod 644 ${DESTDIR}/usr/lib/modules-load.d/nvidia.conf
-	if [ "$XBPS_TARGET_MACHINE" = "x86_64" ]; then
-		echo "nvidia-uvm" > ${DESTDIR}/usr/lib/modules-load.d/nvidia-uvm.conf
-		chmod 644 ${DESTDIR}/usr/lib/modules-load.d/nvidia-uvm.conf
-	fi
-
-	# Blacklist nouveau.
-	vmkdir usr/lib/modprobe.d
-	echo "blacklist nouveau" > ${DESTDIR}/usr/lib/modprobe.d/nvidia.conf
-	chmod 644 ${DESTDIR}/usr/lib/modprobe.d/nvidia.conf
-
-	# Omit drm dracut module too.
-	vmkdir usr/lib/dracut/dracut.conf.d
-	echo "omit_dracutmodules+=\" drm \"" > ${DESTDIR}/usr/lib/dracut/dracut.conf.d/99-nvidia.conf
-}
-
-nvidia340-dkms_package() {
-	short_desc="${_desc} - DKMS kernel module"
-	dkms_modules="nvidia ${version}"
-	depends="dkms"
-	provides="nvidia-dkms-${version}_${revision}"
-	replaces="nvidia-dkms>=0 nvidia-stable-dkms>=0"
-	pkg_install() {
-		vmove usr/src
-		vmove usr/lib/modules-load.d
-		vmove usr/lib/modprobe.d
-		vmove usr/lib/dracut
-	}
-}
-nvidia340-opencl_package() {
-	short_desc="${_desc} - OpenCL implementation"
-	provides="nvidia-opencl-${version}_${revision}"
-	replaces="nvidia-opencl>=0 nvidia-stable-opencl>=0"
-	depends="libOpenCL"
-	pkg_install() {
-		vmove "usr/lib/libnvidia-compiler*"
-		vmove "usr/lib/libnvidia-opencl*"
-		vmove etc/OpenCL
-	}
-}
-nvidia340-libs_package() {
-	short_desc="${_desc} - libraries"
-	provides="libGL-7.11_1 libEGL-7.11_1 libGLES-7.11_1 libglvnd-1.3.0_1"
-	shlib_provides="libGLX.so.0 libOpenGL.so.0"
-	replaces="libGL>=0 libEGL>=0 libGLES>=0 libglvnd>=0"
-	pkg_install() {
-		vmove usr/lib
-	}
-}
diff --git a/srcpkgs/nvidia340/update b/srcpkgs/nvidia340/update
deleted file mode 100644
index 43bad67f7e8..00000000000
--- a/srcpkgs/nvidia340/update
+++ /dev/null
@@ -1,2 +0,0 @@
-site="http://www.nvidia.com/object/unix.html"
-pattern='340.+>\K[\d.]+(?=</A>)'
diff --git a/srcpkgs/removed-packages/template b/srcpkgs/removed-packages/template
index e07c160eafe..c3b79f436a5 100644
--- a/srcpkgs/removed-packages/template
+++ b/srcpkgs/removed-packages/template
@@ -1,7 +1,7 @@
 # Template file for 'removed-packages'
 pkgname=removed-packages
 version=0.1
-revision=6
+revision=7
 build_style=meta
 short_desc="Uninstalls packages removed from repository"
 maintainer="Piotr Wójcik <chocimier@tlen.pl>"
@@ -78,6 +78,10 @@ replaces="
  wireguard-go<=0.0.20181222_2
  wireshark-gtk<=3.0.7_1
  yt-play<=20140117_2
+ nvidia340<=340.108_4
+ nvidia340-dkms<=340.108_4
+ nvidia340-opencl<=340.108_4
+ nvidia340-libs<=340.108_4
 "
 
 if [ "$XBPS_TARGET_LIBC" = "musl" ]; then

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PR PATCH] [Merged]: nvidia340: remove
  2020-12-19 22:50 [PR PATCH] nvidia340: remove abenson
  2021-01-09  4:15 ` [PR PATCH] [Updated] " abenson
  2021-01-09 18:50 ` abenson
@ 2021-01-09 22:57 ` abenson
  2 siblings, 0 replies; 4+ messages in thread
From: abenson @ 2021-01-09 22:57 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 151 bytes --]

There's a merged pull request on the void-packages repository

nvidia340: remove
https://github.com/void-linux/void-packages/pull/27287

Description:


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-01-09 22:57 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-19 22:50 [PR PATCH] nvidia340: remove abenson
2021-01-09  4:15 ` [PR PATCH] [Updated] " abenson
2021-01-09 18:50 ` abenson
2021-01-09 22:57 ` [PR PATCH] [Merged]: " abenson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).