mirror of
https://github.com/archlinux-jerry/nvidia-340xx
synced 2024-12-23 06:29:24 +08:00
Update to 340.108-1
This commit is contained in:
parent
7b3598b172
commit
7438396df4
6 changed files with 70 additions and 157 deletions
24
.SRCINFO
24
.SRCINFO
|
@ -1,37 +1,33 @@
|
||||||
pkgbase = nvidia-340xx-lts
|
pkgbase = nvidia-340xx-lts
|
||||||
pkgdesc = NVIDIA drivers for linux-lts, 340xx legacy branch
|
pkgdesc = NVIDIA drivers for linux-lts, 340xx legacy branch
|
||||||
pkgver = 340.107
|
pkgver = 340.108
|
||||||
pkgrel = 26
|
pkgrel = 1
|
||||||
url = https://www.nvidia.com/
|
url = https://www.nvidia.com/
|
||||||
arch = x86_64
|
arch = x86_64
|
||||||
license = custom
|
license = custom
|
||||||
makedepends = nvidia-340xx-utils=340.107
|
makedepends = nvidia-340xx-utils=340.108
|
||||||
makedepends = linux-lts>=4.19.79
|
makedepends = linux-lts>=4.19.79
|
||||||
makedepends = linux-lts-headers>=4.19.79
|
makedepends = linux-lts-headers>=4.19.79
|
||||||
conflicts = nvidia-lts
|
conflicts = nvidia-lts
|
||||||
options = !strip
|
options = !strip
|
||||||
source = https://us.download.nvidia.com/XFree86/Linux-x86_64/340.107/NVIDIA-Linux-x86_64-340.107-no-compat32.run
|
source = https://us.download.nvidia.com/XFree86/Linux-x86_64/340.108/NVIDIA-Linux-x86_64-340.108-no-compat32.run
|
||||||
source = kernel-4.11.patch
|
source = unfuck-340.108-build-fix.patch
|
||||||
source = kernel-5.0.patch
|
sha256sums = 995d44fef587ff5284497a47a95d71adbee0c13020d615e940ac928f180f5b77
|
||||||
source = kernel-5.1.patch
|
sha256sums = 2b7e3ef24846a40f4492e749be946e4f7f70ebed054bc2c9079f6cbdcbfabe57
|
||||||
sha256sums = 6dc6f183c69c414670d8adef0286a2362eedd6e16ec6dfae811e48ea4a4505dc
|
|
||||||
sha256sums = 5ba7e6d5e502882c3534d1d8578f7fd29fdf3d2aeb49206efa7b3514a7e3e821
|
|
||||||
sha256sums = 236a1d1dc9adc1cafec828f0650d5a15f1f6d0fa27905dab58ca072a46f159fa
|
|
||||||
sha256sums = 2b0e69814bfaee6b227bbf15d89d056ab27d84bd325248614e27cb5fa33a63a1
|
|
||||||
|
|
||||||
pkgname = nvidia-340xx-lts
|
pkgname = nvidia-340xx-lts
|
||||||
pkgdesc = NVIDIA drivers for linux-lts, 340xx legacy branch.
|
pkgdesc = NVIDIA drivers for linux-lts, 340xx legacy branch.
|
||||||
depends = linux-lts>=4.19.72
|
depends = linux-lts>=4.19.72
|
||||||
depends = nvidia-340xx-utils=340.107
|
depends = nvidia-340xx-utils=340.108
|
||||||
depends = libgl
|
depends = libgl
|
||||||
|
|
||||||
pkgname = nvidia-340xx-lts-dkms
|
pkgname = nvidia-340xx-lts-dkms
|
||||||
pkgdesc = NVIDIA driver sources for linux-lts, 340xx legacy branch
|
pkgdesc = NVIDIA driver sources for linux-lts, 340xx legacy branch
|
||||||
depends = dkms
|
depends = dkms
|
||||||
depends = nvidia-340xx-utils=340.107
|
depends = nvidia-340xx-utils=340.108
|
||||||
depends = libgl
|
depends = libgl
|
||||||
optdepends = linux-lts-headers: Build the module for lts kernel
|
optdepends = linux-lts-headers: Build the module for lts kernel
|
||||||
provides = nvidia-340xx=340.107
|
provides = nvidia-340xx=340.108
|
||||||
conflicts = nvidia-lts
|
conflicts = nvidia-lts
|
||||||
conflicts = nvidia-340xx
|
conflicts = nvidia-340xx
|
||||||
|
|
||||||
|
|
22
PKGBUILD
22
PKGBUILD
|
@ -5,8 +5,8 @@
|
||||||
|
|
||||||
pkgbase=nvidia-340xx-lts
|
pkgbase=nvidia-340xx-lts
|
||||||
pkgname=(nvidia-340xx-lts nvidia-340xx-lts-dkms)
|
pkgname=(nvidia-340xx-lts nvidia-340xx-lts-dkms)
|
||||||
pkgver=340.107
|
pkgver=340.108
|
||||||
pkgrel=26
|
pkgrel=1
|
||||||
pkgdesc="NVIDIA drivers for linux-lts, 340xx legacy branch"
|
pkgdesc="NVIDIA drivers for linux-lts, 340xx legacy branch"
|
||||||
arch=('x86_64')
|
arch=('x86_64')
|
||||||
url="https://www.nvidia.com/"
|
url="https://www.nvidia.com/"
|
||||||
|
@ -15,12 +15,10 @@ conflicts=('nvidia-lts')
|
||||||
license=('custom')
|
license=('custom')
|
||||||
options=(!strip)
|
options=(!strip)
|
||||||
source=("https://us.download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/NVIDIA-Linux-x86_64-${pkgver}-no-compat32.run"
|
source=("https://us.download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/NVIDIA-Linux-x86_64-${pkgver}-no-compat32.run"
|
||||||
'kernel-4.11.patch' 'kernel-5.0.patch' 'kernel-5.1.patch'
|
unfuck-340.108-build-fix.patch
|
||||||
)
|
)
|
||||||
sha256sums=('6dc6f183c69c414670d8adef0286a2362eedd6e16ec6dfae811e48ea4a4505dc'
|
sha256sums=('995d44fef587ff5284497a47a95d71adbee0c13020d615e940ac928f180f5b77'
|
||||||
'5ba7e6d5e502882c3534d1d8578f7fd29fdf3d2aeb49206efa7b3514a7e3e821'
|
'2b7e3ef24846a40f4492e749be946e4f7f70ebed054bc2c9079f6cbdcbfabe57')
|
||||||
'236a1d1dc9adc1cafec828f0650d5a15f1f6d0fa27905dab58ca072a46f159fa'
|
|
||||||
'2b0e69814bfaee6b227bbf15d89d056ab27d84bd325248614e27cb5fa33a63a1')
|
|
||||||
_pkg="NVIDIA-Linux-x86_64-${pkgver}-no-compat32"
|
_pkg="NVIDIA-Linux-x86_64-${pkgver}-no-compat32"
|
||||||
|
|
||||||
# default is 'linux' substitute custom name here
|
# default is 'linux' substitute custom name here
|
||||||
|
@ -33,9 +31,13 @@ prepare() {
|
||||||
cd "${_pkg}"
|
cd "${_pkg}"
|
||||||
|
|
||||||
# patches here
|
# patches here
|
||||||
patch -Np0 < "${srcdir}/kernel-4.11.patch"
|
local src
|
||||||
patch -Np0 < "${srcdir}/kernel-5.0.patch"
|
for src in "${source[@]}"; do
|
||||||
patch -Np0 < "${srcdir}/kernel-5.1.patch"
|
src="${src%%::*}"
|
||||||
|
src="${src##*/}"
|
||||||
|
[[ $src = *.patch ]] || continue
|
||||||
|
(cd kernel ; patch -p1 --no-backup-if-mismatch -i "../../$src")
|
||||||
|
done
|
||||||
|
|
||||||
cp -a kernel kernel-dkms
|
cp -a kernel kernel-dkms
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
--- kernel/uvm/nvidia_uvm_lite.c 2017-09-27 13:50:46.334075042 +0200
|
|
||||||
+++ kernel/uvm/nvidia_uvm_lite.c 2017-09-27 13:56:06.358041280 +0200
|
|
||||||
@@ -818,7 +818,11 @@
|
|
||||||
}
|
|
||||||
|
|
||||||
#if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
|
|
||||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
|
|
||||||
int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)
|
|
||||||
+#else
|
|
||||||
+int _fault(struct vm_fault *vmf)
|
|
||||||
+#endif
|
|
||||||
{
|
|
||||||
#if defined(NV_VM_FAULT_HAS_ADDRESS)
|
|
||||||
unsigned long vaddr = vmf->address;
|
|
||||||
@@ -828,7 +832,11 @@
|
|
||||||
struct page *page = NULL;
|
|
||||||
int retval;
|
|
||||||
|
|
||||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
|
|
||||||
retval = _fault_common(vma, vaddr, &page, vmf->flags);
|
|
||||||
+#else
|
|
||||||
+ retval = _fault_common(NULL, vaddr, &page, vmf->flags);
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
vmf->page = page;
|
|
||||||
|
|
||||||
@@ -866,7 +874,11 @@
|
|
||||||
// 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, 11, 0)
|
|
||||||
int _sigbus_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
|
|
||||||
+#else
|
|
||||||
+int _sigbus_fault(struct vm_fault *vmf)
|
|
||||||
+#endif
|
|
||||||
{
|
|
||||||
vmf->page = NULL;
|
|
||||||
return VM_FAULT_SIGBUS;
|
|
|
@ -1,52 +0,0 @@
|
||||||
--- kernel/nv-drm.c 2018-05-25 04:16:20.000000000 +0000
|
|
||||||
+++ kernel/nv-drm.c 2019-03-04 20:57:40.065280734 +0000
|
|
||||||
@@ -252,7 +252,11 @@
|
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
|
|
||||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 0, 0)
|
|
||||||
drm_gem_object_unreference_unlocked(&nv_obj->base);
|
|
||||||
+#else
|
|
||||||
+ drm_gem_object_put_unlocked(&nv_obj->base);
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
status = RM_OK;
|
|
||||||
|
|
||||||
--- kernel/os-interface.c 2018-05-25 04:16:20.000000000 +0000
|
|
||||||
+++ kernel/os-interface.c 2019-03-04 21:03:03.815854982 +0000
|
|
||||||
@@ -14,6 +14,16 @@
|
|
||||||
#include "os-interface.h"
|
|
||||||
#include "nv-linux.h"
|
|
||||||
|
|
||||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)
|
|
||||||
+static inline void do_gettimeofday(struct timeval *tv)
|
|
||||||
+{
|
|
||||||
+ struct timespec64 now;
|
|
||||||
+ ktime_get_real_ts64(&now);
|
|
||||||
+ tv->tv_sec = now.tv_sec;
|
|
||||||
+ tv->tv_usec = now.tv_nsec/1000;
|
|
||||||
+}
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
RM_STATUS NV_API_CALL os_disable_console_access(void)
|
|
||||||
{
|
|
||||||
NV_ACQUIRE_CONSOLE_SEM();
|
|
||||||
--- kernel/uvm/nvidia_uvm_lite.c 2019-03-04 20:57:25.815255511 +0000
|
|
||||||
+++ kernel/uvm/nvidia_uvm_lite.c 2019-03-04 21:04:25.239333050 +0000
|
|
||||||
@@ -30,6 +30,16 @@
|
|
||||||
#include "nvidia_uvm_lite_counters.h"
|
|
||||||
#include "ctrl2080mc.h"
|
|
||||||
|
|
||||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 0, 0)
|
|
||||||
+static inline void do_gettimeofday(struct timeval *tv)
|
|
||||||
+{
|
|
||||||
+ struct timespec64 now;
|
|
||||||
+ ktime_get_real_ts64(&now);
|
|
||||||
+ tv->tv_sec = now.tv_sec;
|
|
||||||
+ tv->tv_usec = now.tv_nsec/1000;
|
|
||||||
+}
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
//
|
|
||||||
// nvidia_uvm_lite.c
|
|
||||||
// This file contains code that is specific to the UVM-Lite mode of operation.
|
|
|
@ -1,43 +0,0 @@
|
||||||
diff --git kernel/uvm/nvidia_uvm_lite.c kernel/uvm/nvidia_uvm_lite.c
|
|
||||||
index 65b9a4d..f5ea5d7 100644
|
|
||||||
--- kernel/uvm/nvidia_uvm_lite.c
|
|
||||||
+++ kernel/uvm/nvidia_uvm_lite.c
|
|
||||||
@@ -830,8 +830,10 @@ done:
|
|
||||||
#if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
|
|
||||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
|
|
||||||
int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)
|
|
||||||
-#else
|
|
||||||
-int _fault(struct vm_fault *vmf)
|
|
||||||
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
|
|
||||||
+int _fault(struct vm_fault *vmf)
|
|
||||||
+#else
|
|
||||||
+vm_fault_t _fault(struct vm_fault *vmf)
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
#if defined(NV_VM_FAULT_HAS_ADDRESS)
|
|
||||||
@@ -886,8 +888,10 @@ static struct vm_operations_struct uvmlite_vma_ops =
|
|
||||||
#if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
|
|
||||||
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
|
|
||||||
int _sigbus_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
|
|
||||||
-#else
|
|
||||||
+#elif LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
|
|
||||||
int _sigbus_fault(struct vm_fault *vmf)
|
|
||||||
+#else
|
|
||||||
+vm_fault_t _sigbus_fault(struct vm_fault *vmf)
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
vmf->page = NULL;
|
|
||||||
diff --git kernel/nv-drm.c kernel/nv-drm.c
|
|
||||||
index 122ba7d..1be5733 100644
|
|
||||||
--- kernel/nv-drm.c
|
|
||||||
+++ kernel/nv-drm.c
|
|
||||||
@@ -146,7 +146,7 @@ static const struct file_operations nv_drm_fops = {
|
|
||||||
};
|
|
||||||
|
|
||||||
static struct drm_driver nv_drm_driver = {
|
|
||||||
-#if defined(DRIVER_LEGACY)
|
|
||||||
+#if defined(DRIVER_LEGACY) || LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
|
|
||||||
.driver_features = DRIVER_GEM | DRIVER_PRIME | DRIVER_LEGACY,
|
|
||||||
#else
|
|
||||||
.driver_features = DRIVER_GEM | DRIVER_PRIME,
|
|
||||||
|
|
48
unfuck-340.108-build-fix.patch
Normal file
48
unfuck-340.108-build-fix.patch
Normal file
|
@ -0,0 +1,48 @@
|
||||||
|
diff --git a/uvm/nvidia_uvm_lite.c b/uvm/nvidia_uvm_lite.c
|
||||||
|
index 6943e7c..c5d232c 100644
|
||||||
|
--- a/uvm/nvidia_uvm_lite.c
|
||||||
|
+++ b/uvm/nvidia_uvm_lite.c
|
||||||
|
@@ -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;
|
Loading…
Reference in a new issue