nvidia340: update to 340.108

This commit is contained in:
Stefano Ragni 2020-01-03 01:59:26 +01:00 committed by Juan RP
parent dec3cb1c37
commit fa22a7c837
4 changed files with 5 additions and 133 deletions

View File

@ -1,67 +1,5 @@
--- kernel/os-interface.c 2019-03-05 22:53:13.298064826 +0100
+++ kernel/os-interface.c 2019-03-05 23:04:09.064902532 +0100
@@ -14,6 +14,19 @@
#include "os-interface.h"
#include "nv-linux.h"
+#include <linux/version.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/nv-drm.c 2019-03-05 22:37:07.015611635 +0100
+++ kernel/nv-drm.c 2019-03-05 22:54:46.448761250 +0100
@@ -13,6 +13,7 @@
#include "nv-misc.h"
#include "os-interface.h"
#include "nv-linux.h"
+#include <linux/version.h>
#if defined(NV_DRM_AVAILABLE)
@@ -251,8 +252,11 @@
status = RM_ERR_OPERATING_SYSTEM;
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/uvm/nvidia_uvm_lite.c 2019-09-10 16:26:28.674315544 +0200
+++ kernel/uvm/nvidia_uvm_lite.c 2019-09-10 16:28:05.224054277 +0200
@@ -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.
@@ -820,8 +830,10 @@
#if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)

View File

@ -1,16 +0,0 @@
diff -Nur nv/kernel/nv-drm.c nv2/kernel/nv-drm.c
--- kernel/nv-drm.c 2018-05-25 06:16:20.000000000 +0200
+++ kernel/nv-drm.c 2019-05-09 20:51:33.364278935 +0200
@@ -146,11 +146,7 @@
};
static struct drm_driver nv_drm_driver = {
-#if defined(DRIVER_LEGACY)
.driver_features = DRIVER_GEM | DRIVER_PRIME | DRIVER_LEGACY,
-#else
- .driver_features = DRIVER_GEM | DRIVER_PRIME,
-#endif
.load = nv_drm_load,
.unload = nv_drm_unload,
.fops = &nv_drm_fops,

View File

@ -1,49 +0,0 @@
diff --git kernel/nv-linux.h kernel/nv-linux.h
index 4043bf1..62f0874 100644
--- kernel/nv-linux.h
+++ kernel/nv-linux.h
@@ -877,12 +877,21 @@ extern void *nv_stack_t_cache;
__ret; \
})
#elif (NV_SMP_CALL_FUNCTION_ARGUMENT_COUNT == 3)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 3, 0)
#define NV_SMP_CALL_FUNCTION(func, info, wait) \
({ \
int __ret = smp_call_function(func, info, wait); \
__ret; \
})
#else
+#define NV_SMP_CALL_FUNCTION(func, info, wait) \
+ ({ \
+ int __ret = 0; \
+ smp_call_function(func, info, wait); \
+ __ret; \
+ })
+#endif
+#else
#error "NV_SMP_CALL_FUNCTION_ARGUMENT_COUNT value unrecognized!"
#endif
#elif defined(CONFIG_SMP)
@@ -897,12 +906,21 @@ extern void *nv_stack_t_cache;
__ret; \
})
#elif (NV_ON_EACH_CPU_ARGUMENT_COUNT == 3)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 3, 0)
#define NV_ON_EACH_CPU(func, info, wait) \
({ \
int __ret = on_each_cpu(func, info, wait); \
__ret; \
})
#else
+#define NV_ON_EACH_CPU(func, info, wait) \
+ ({ \
+ int __ret = 0; \
+ on_each_cpu(func, info, wait); \
+ __ret; \
+ })
+#endif
+#else
#error "NV_ON_EACH_CPU_ARGUMENT_COUNT value unrecognized!"
#endif
#elif defined(CONFIG_SMP)

View File

@ -3,8 +3,8 @@
_desc="NVIDIA drivers (GeForce 8, 9, 9M, 100, 100M, 200, 300 series)"
pkgname=nvidia340
version=340.107
revision=8
version=340.108
revision=1
maintainer="Orphaned <orphan@voidlinux.org>"
license="custom:NVIDIA proprietary"
homepage="http://www.nvidia.com"
@ -24,11 +24,11 @@ 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=8d8bd2b04019eaa55d848534e2dbdc460be918e7731ecd8da87199ef9c1a0856
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=6dc6f183c69c414670d8adef0286a2362eedd6e16ec6dfae811e48ea4a4505dc
checksum=995d44fef587ff5284497a47a95d71adbee0c13020d615e940ac928f180f5b77
fi
do_extract() {
@ -42,8 +42,6 @@ do_patch() {
cd ${_pkg}
patch -p0 < ${FILESDIR}/kernel-4.11.patch
patch -p0 < ${FILESDIR}/kernel-5.0.patch
patch -p0 < ${FILESDIR}/kernel-5.1.patch
patch -p0 < ${FILESDIR}/kernel-5.3.patch
}
do_install() {
@ -215,6 +213,7 @@ nvidia340-opencl_package() {
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