nvidia390 rebuild
This commit is contained in:
@@ -26,10 +26,10 @@ def setup():
|
||||
% (arch, get.srcVERSION()))
|
||||
shelltools.move("tmp/*", ".")
|
||||
|
||||
#5.5 patch icin
|
||||
#5.5 patch
|
||||
#shelltools.move("tmp/.manifest", ".")
|
||||
#shelltools.system("patch -p1 < kernel-5.5.patch")
|
||||
#shelltools.system("patch -p1 < kernel-5.8.patch")
|
||||
shelltools.system("patch -p1 < kernel-5.14-pdev.patch")
|
||||
shelltools.system("patch -p1 < kernel-5.14-state.patch")
|
||||
|
||||
#if get.buildTYPE() != 'emul32':
|
||||
#shelltools.system("patch -p1 < linux-5.1.patch")
|
||||
|
||||
@@ -1,96 +0,0 @@
|
||||
diff --git a/kernel/common/inc/nv-linux.h b/kernel/common/inc/nv-linux.h
|
||||
index ac5bb95..3d2f0b7 100644
|
||||
--- a/kernel/common/inc/nv-linux.h
|
||||
+++ b/kernel/common/inc/nv-linux.h
|
||||
@@ -531,7 +531,11 @@ extern int nv_pat_mode;
|
||||
|
||||
static inline void *nv_vmalloc(unsigned long size)
|
||||
{
|
||||
+#if defined(NV_VMALLOC_HAS_PGPROT_T_ARG)
|
||||
void *ptr = __vmalloc(size, GFP_KERNEL, PAGE_KERNEL);
|
||||
+#else
|
||||
+ void *ptr = __vmalloc(size, GFP_KERNEL);
|
||||
+#endif
|
||||
if (ptr)
|
||||
NV_MEMDBG_ADD(ptr, size);
|
||||
return ptr;
|
||||
diff --git a/kernel/common/inc/nv-mm.h b/kernel/common/inc/nv-mm.h
|
||||
index 1270bf3..d2d7657 100644
|
||||
--- a/kernel/common/inc/nv-mm.h
|
||||
+++ b/kernel/common/inc/nv-mm.h
|
||||
@@ -29,6 +29,10 @@
|
||||
typedef int vm_fault_t;
|
||||
#endif
|
||||
|
||||
+#if defined(NV_MM_HAS_MMAP_LOCK)
|
||||
+#define mmap_sem mmap_lock
|
||||
+#endif
|
||||
+
|
||||
/* get_user_pages
|
||||
*
|
||||
* The 8-argument version of get_user_pages was deprecated by commit
|
||||
diff --git a/kernel/conftest.sh b/kernel/conftest.sh
|
||||
index 7da7505..7793dd6 100755
|
||||
--- a/kernel/conftest.sh
|
||||
+++ b/kernel/conftest.sh
|
||||
@@ -4067,6 +4067,44 @@ compile_test() {
|
||||
compile_check_conftest "$CODE" "NV_KTIME_GET_REAL_TS64_PRESENT" "" "functions"
|
||||
;;
|
||||
|
||||
+ vmalloc_has_pgprot_t_arg)
|
||||
+ #
|
||||
+ # Determine if __vmalloc has the 'pgprot' argument.
|
||||
+ #
|
||||
+ # The third argument to __vmalloc, page protection
|
||||
+ # 'pgprot_t prot', was removed by commit 88dca4ca5a93
|
||||
+ # (mm: remove the pgprot argument to __vmalloc)
|
||||
+ # in v5.8-rc1 (2020-06-01).
|
||||
+ CODE="
|
||||
+ #include <linux/vmalloc.h>
|
||||
+
|
||||
+ void conftest_vmalloc_has_pgprot_t_arg(void) {
|
||||
+ pgprot_t prot;
|
||||
+ (void)__vmalloc(0, 0, prot);
|
||||
+ }"
|
||||
+
|
||||
+ compile_check_conftest "$CODE" "NV_VMALLOC_HAS_PGPROT_T_ARG" "" "types"
|
||||
+
|
||||
+ ;;
|
||||
+
|
||||
+ mm_has_mmap_lock)
|
||||
+ #
|
||||
+ # Determine if the 'mm_struct' structure has a 'mmap_lock' field.
|
||||
+ #
|
||||
+ # Kernel commit da1c55f1b272 ("mmap locking API: rename mmap_sem
|
||||
+ # to mmap_lock") replaced the field 'mmap_sem' by 'mmap_lock'
|
||||
+ # in v5.8-rc1 (2020-06-08).
|
||||
+ CODE="
|
||||
+ #include <linux/mm_types.h>
|
||||
+
|
||||
+ int conftest_mm_has_mmap_lock(void) {
|
||||
+ return offsetof(struct mm_struct, mmap_lock);
|
||||
+ }"
|
||||
+
|
||||
+ compile_check_conftest "$CODE" "NV_MM_HAS_MMAP_LOCK" "" "types"
|
||||
+
|
||||
+ ;;
|
||||
+
|
||||
pci_dev_has_skip_bus_pm)
|
||||
#
|
||||
# Determine if skip_bus_pm flag is present in struct pci_dev.
|
||||
diff --git a/kernel/nvidia/nvidia.Kbuild b/kernel/nvidia/nvidia.Kbuild
|
||||
index 63e369f..656db7b 100644
|
||||
--- a/kernel/nvidia/nvidia.Kbuild
|
||||
+++ b/kernel/nvidia/nvidia.Kbuild
|
||||
@@ -192,7 +192,9 @@ NV_CONFTEST_TYPE_COMPILE_TESTS += iterate_dir
|
||||
NV_CONFTEST_TYPE_COMPILE_TESTS += kstrtoull
|
||||
NV_CONFTEST_TYPE_COMPILE_TESTS += backlight_properties_type
|
||||
NV_CONFTEST_TYPE_COMPILE_TESTS += proc_ops
|
||||
+NV_CONFTEST_TYPE_COMPILE_TESTS += vmalloc_has_pgprot_t_arg
|
||||
NV_CONFTEST_TYPE_COMPILE_TESTS += timeval
|
||||
+NV_CONFTEST_TYPE_COMPILE_TESTS += mm_has_mmap_lock
|
||||
NV_CONFTEST_TYPE_COMPILE_TESTS += kmem_cache_has_kobj_remove_work
|
||||
NV_CONFTEST_TYPE_COMPILE_TESTS += sysfs_slab_unlink
|
||||
NV_CONFTEST_TYPE_COMPILE_TESTS += pci_dev_has_skip_bus_pm
|
||||
--
|
||||
2.25.1
|
||||
@@ -1,397 +0,0 @@
|
||||
|
||||
.manifest | 1 +
|
||||
kernel/common/inc/nv-drm.h | 36 ++++++++++++++++++++++++++++++++++++
|
||||
kernel/conftest.sh | 31 +++++++++++++++++++++++++++++++
|
||||
kernel/nvidia-drm/nvidia-drm-connector.c | 14 ++++++++++++++
|
||||
kernel/nvidia-drm/nvidia-drm-connector.h | 2 +-
|
||||
kernel/nvidia-drm/nvidia-drm-crtc.h | 2 +-
|
||||
kernel/nvidia-drm/nvidia-drm-drv.c | 2 +-
|
||||
kernel/nvidia-drm/nvidia-drm-encoder.h | 2 +-
|
||||
kernel/nvidia-drm/nvidia-drm-fb.h | 2 +-
|
||||
kernel/nvidia-drm/nvidia-drm-gem.h | 2 +-
|
||||
kernel/nvidia-drm/nvidia-drm-helper.c | 2 +-
|
||||
kernel/nvidia-drm/nvidia-drm-helper.h | 2 +-
|
||||
kernel/nvidia-drm/nvidia-drm-modeset.h | 2 +-
|
||||
kernel/nvidia-drm/nvidia-drm-os-interface.h | 2 +-
|
||||
kernel/nvidia-drm/nvidia-drm-prime-fence.h | 2 +-
|
||||
kernel/nvidia-drm/nvidia-drm-priv.h | 2 +-
|
||||
kernel/nvidia-drm/nvidia-drm-utils.h | 2 +-
|
||||
17 files changed, 95 insertions(+), 13 deletions(-)
|
||||
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.132.orig/kernel/common/inc/nv-drm.h NVIDIA-Linux-x86_64-390.132/kernel/common/inc/nv-drm.h
|
||||
--- NVIDIA-Linux-x86_64-390.132.orig/kernel/common/inc/nv-drm.h 1970-01-01 02:00:00.000000000 +0200
|
||||
+++ NVIDIA-Linux-x86_64-390.132/kernel/common/inc/nv-drm.h 2020-02-09 22:37:55.798547949 +0200
|
||||
@@ -0,0 +1,36 @@
|
||||
+#ifndef _NV_DRM_H_
|
||||
+#define _NV_DRM_H_
|
||||
+
|
||||
+#include "conftest.h"
|
||||
+
|
||||
+#if defined(NV_DRM_DRMP_H_PRESENT)
|
||||
+#include <drm/drmP.h>
|
||||
+#else
|
||||
+#include <linux/agp_backend.h>
|
||||
+#include <linux/file.h>
|
||||
+#include <linux/init.h>
|
||||
+#include <linux/jiffies.h>
|
||||
+#include <linux/kernel.h>
|
||||
+#include <linux/mutex.h>
|
||||
+#include <linux/slab.h>
|
||||
+#include <linux/types.h>
|
||||
+#include <asm/pgalloc.h>
|
||||
+#include <linux/uaccess.h>
|
||||
+
|
||||
+#include <uapi/drm/drm.h>
|
||||
+#include <uapi/drm/drm_mode.h>
|
||||
+
|
||||
+#include <drm/drm_agpsupport.h>
|
||||
+#include <drm/drm_crtc.h>
|
||||
+#include <drm/drm_drv.h>
|
||||
+#include <drm/drm_prime.h>
|
||||
+#include <drm/drm_pci.h>
|
||||
+#include <drm/drm_ioctl.h>
|
||||
+#include <drm/drm_sysfs.h>
|
||||
+#include <drm/drm_vblank.h>
|
||||
+#include <drm/drm_device.h>
|
||||
+
|
||||
+#include <drm/drm_gem.h>
|
||||
+#endif
|
||||
+
|
||||
+#endif
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.132.orig/kernel/conftest.sh NVIDIA-Linux-x86_64-390.132/kernel/conftest.sh
|
||||
--- NVIDIA-Linux-x86_64-390.132.orig/kernel/conftest.sh 2019-11-01 11:39:53.000000000 +0200
|
||||
+++ NVIDIA-Linux-x86_64-390.132/kernel/conftest.sh 2020-02-09 22:37:55.799547995 +0200
|
||||
@@ -1678,6 +1678,9 @@ compile_test() {
|
||||
CODE="
|
||||
#if defined(NV_DRM_DRMP_H_PRESENT)
|
||||
#include <drm/drmP.h>
|
||||
+ #else
|
||||
+ #include <drm/drm_drv.h>
|
||||
+ #include <drm/drm_prime.h>
|
||||
#endif
|
||||
#if !defined(CONFIG_DRM) && !defined(CONFIG_DRM_MODULE)
|
||||
#error DRM not enabled
|
||||
@@ -2266,6 +2269,8 @@ compile_test() {
|
||||
echo "$CONFTEST_PREAMBLE
|
||||
#if defined(NV_DRM_DRMP_H_PRESENT)
|
||||
#include <drm/drmP.h>
|
||||
+ #else
|
||||
+ #include <drm/drm_drv.h>
|
||||
#endif
|
||||
#include <drm/drm_atomic.h>
|
||||
#if !defined(CONFIG_DRM) && !defined(CONFIG_DRM_MODULE)
|
||||
@@ -2384,7 +2389,11 @@ compile_test() {
|
||||
# 2013-12-11 b3f2333de8e81b089262b26d52272911523e605f
|
||||
#
|
||||
CODE="
|
||||
+ #if defined(NV_DRM_DRMP_H_PRESENT)
|
||||
#include <drm/drmP.h>
|
||||
+ #else
|
||||
+ #include <drm/drm_drv.h>
|
||||
+ #endif
|
||||
int conftest_drm_driver_has_legacy_dev_list(void) {
|
||||
return offsetof(struct drm_driver, legacy_dev_list);
|
||||
}"
|
||||
@@ -2408,7 +2417,11 @@ compile_test() {
|
||||
# 2017-07-23 e6fc3b68558e4c6d8d160b5daf2511b99afa8814
|
||||
#
|
||||
CODE="
|
||||
+ #if defined(NV_DRM_DRMP_H_PRESENT)
|
||||
#include <drm/drmP.h>
|
||||
+ #else
|
||||
+ #include <drm/drm_crtc.h>
|
||||
+ #endif
|
||||
|
||||
int conftest_drm_crtc_init_with_planes_has_name_arg(void) {
|
||||
return
|
||||
@@ -2424,7 +2437,11 @@ compile_test() {
|
||||
compile_check_conftest "$CODE" "NV_DRM_CRTC_INIT_WITH_PLANES_HAS_NAME_ARG" "" "types"
|
||||
|
||||
CODE="
|
||||
+ #if defined(NV_DRM_DRMP_H_PRESENT)
|
||||
#include <drm/drmP.h>
|
||||
+ #else
|
||||
+ #include <drm/drm_encoder.h>
|
||||
+ #endif
|
||||
|
||||
int conftest_drm_encoder_init_has_name_arg(void) {
|
||||
return
|
||||
@@ -2439,7 +2456,11 @@ compile_test() {
|
||||
compile_check_conftest "$CODE" "NV_DRM_ENCODER_INIT_HAS_NAME_ARG" "" "types"
|
||||
|
||||
echo "$CONFTEST_PREAMBLE
|
||||
+ #if defined(NV_DRM_DRMP_H_PRESENT)
|
||||
#include <drm/drmP.h>
|
||||
+ #else
|
||||
+ #include <drm/drm_plane.h>
|
||||
+ #endif
|
||||
|
||||
int conftest_drm_universal_plane_init_has_format_modifiers_arg(void) {
|
||||
return
|
||||
@@ -2466,7 +2487,11 @@ compile_test() {
|
||||
echo "#undef NV_DRM_UNIVERSAL_PLANE_INIT_HAS_FORMAT_MODIFIERS_ARG" | append_conftest "types"
|
||||
|
||||
echo "$CONFTEST_PREAMBLE
|
||||
+ #if defined(NV_DRM_DRMP_H_PRESENT)
|
||||
#include <drm/drmP.h>
|
||||
+ #else
|
||||
+ #include <drm/drm_plane.h>
|
||||
+ #endif
|
||||
|
||||
int conftest_drm_universal_plane_init_has_name_arg(void) {
|
||||
return
|
||||
@@ -3605,7 +3630,9 @@ compile_test() {
|
||||
# Introduce drm_framebuffer_{get,put}()) on 2017-02-28.
|
||||
#
|
||||
CODE="
|
||||
+ #if defined(NV_DRM_DRMP_H_PRESENT)
|
||||
#include <drm/drmP.h>
|
||||
+ #endif
|
||||
#if defined(NV_DRM_DRM_FRAMEBUFFER_H_PRESENT)
|
||||
#include <drm/drm_framebuffer.h>
|
||||
#endif
|
||||
@@ -3624,7 +3651,9 @@ compile_test() {
|
||||
# Introduce drm_gem_object_{get,put}()) on 2017-02-28.
|
||||
#
|
||||
CODE="
|
||||
+ #if defined(NV_DRM_DRMP_H_PRESENT)
|
||||
#include <drm/drmP.h>
|
||||
+ #endif
|
||||
#if defined(NV_DRM_DRM_GEM_H_PRESENT)
|
||||
#include <drm/drm_gem.h>
|
||||
#endif
|
||||
@@ -3643,7 +3672,9 @@ compile_test() {
|
||||
# introduce drm_dev_{get/put} functions) on 2017-09-26.
|
||||
#
|
||||
CODE="
|
||||
+ #if defined(NV_DRM_DRMP_H_PRESENT)
|
||||
#include <drm/drmP.h>
|
||||
+ #endif
|
||||
#if defined(NV_DRM_DRM_DRV_H_PRESENT)
|
||||
#include <drm/drm_drv.h>
|
||||
#endif
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-drm/nvidia-drm-connector.c NVIDIA-Linux-x86_64-390.132/kernel/nvidia-drm/nvidia-drm-connector.c
|
||||
--- NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-drm/nvidia-drm-connector.c 2019-11-01 14:37:55.000000000 +0200
|
||||
+++ NVIDIA-Linux-x86_64-390.132/kernel/nvidia-drm/nvidia-drm-connector.c 2020-02-09 22:37:55.799547995 +0200
|
||||
@@ -20,6 +20,8 @@
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
+#include <linux/version.h>
|
||||
+
|
||||
#include "nvidia-drm-conftest.h" /* NV_DRM_ATOMIC_MODESET_AVAILABLE */
|
||||
|
||||
#if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
|
||||
@@ -71,7 +73,11 @@ static enum drm_connector_status __nv_dr
|
||||
struct nv_drm_encoder *nv_detected_encoder = NULL;
|
||||
|
||||
struct NvKmsKapiDynamicDisplayParams *pDetectParams = NULL;
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0)
|
||||
unsigned int i;
|
||||
+#else
|
||||
+ struct drm_encoder *encoder = NULL;
|
||||
+#endif
|
||||
|
||||
BUG_ON(!mutex_is_locked(&dev->mode_config.mutex));
|
||||
|
||||
@@ -87,11 +93,16 @@ static enum drm_connector_status __nv_dr
|
||||
goto done;
|
||||
}
|
||||
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0)
|
||||
for (i = 0;
|
||||
i < DRM_CONNECTOR_MAX_ENCODER && detected_encoder == NULL; i++) {
|
||||
struct drm_encoder *encoder;
|
||||
+#else
|
||||
+ drm_connector_for_each_possible_encoder(connector, encoder) {
|
||||
+#endif
|
||||
struct nv_drm_encoder *nv_encoder;
|
||||
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 5, 0)
|
||||
if (connector->encoder_ids[i] == 0) {
|
||||
break;
|
||||
}
|
||||
@@ -102,6 +113,7 @@ static enum drm_connector_status __nv_dr
|
||||
BUG_ON(encoder != NULL);
|
||||
continue;
|
||||
}
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* DVI-I connectors can drive both digital and analog
|
||||
@@ -169,6 +181,8 @@ static enum drm_connector_status __nv_dr
|
||||
}
|
||||
|
||||
detected_encoder = encoder;
|
||||
+
|
||||
+ break;
|
||||
}
|
||||
}
|
||||
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-drm/nvidia-drm-connector.h NVIDIA-Linux-x86_64-390.132/kernel/nvidia-drm/nvidia-drm-connector.h
|
||||
--- NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-drm/nvidia-drm-connector.h 2019-11-01 14:37:54.000000000 +0200
|
||||
+++ NVIDIA-Linux-x86_64-390.132/kernel/nvidia-drm/nvidia-drm-connector.h 2020-02-09 22:37:55.799547995 +0200
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
|
||||
|
||||
-#include <drm/drmP.h>
|
||||
+#include "nv-drm.h"
|
||||
|
||||
#include "nvtypes.h"
|
||||
#include "nvkms-api-types.h"
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-drm/nvidia-drm-crtc.h NVIDIA-Linux-x86_64-390.132/kernel/nvidia-drm/nvidia-drm-crtc.h
|
||||
--- NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-drm/nvidia-drm-crtc.h 2019-11-01 14:37:54.000000000 +0200
|
||||
+++ NVIDIA-Linux-x86_64-390.132/kernel/nvidia-drm/nvidia-drm-crtc.h 2020-02-09 22:37:55.799547995 +0200
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
#include "nvidia-drm-helper.h"
|
||||
|
||||
-#include <drm/drmP.h>
|
||||
+#include "nv-drm.h"
|
||||
#include "nvtypes.h"
|
||||
#include "nvkms-kapi.h"
|
||||
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-drm/nvidia-drm-drv.c NVIDIA-Linux-x86_64-390.132/kernel/nvidia-drm/nvidia-drm-drv.c
|
||||
--- NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-drm/nvidia-drm-drv.c 2019-11-01 14:37:54.000000000 +0200
|
||||
+++ NVIDIA-Linux-x86_64-390.132/kernel/nvidia-drm/nvidia-drm-drv.c 2020-02-09 22:37:55.799547995 +0200
|
||||
@@ -39,7 +39,7 @@
|
||||
|
||||
#include "nvidia-drm-ioctl.h"
|
||||
|
||||
-#include <drm/drmP.h>
|
||||
+#include "nv-drm.h"
|
||||
|
||||
/*
|
||||
* Commit fcd70cd36b9b ("drm: Split out drm_probe_helper.h")
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-drm/nvidia-drm-encoder.h NVIDIA-Linux-x86_64-390.132/kernel/nvidia-drm/nvidia-drm-encoder.h
|
||||
--- NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-drm/nvidia-drm-encoder.h 2019-11-01 14:37:54.000000000 +0200
|
||||
+++ NVIDIA-Linux-x86_64-390.132/kernel/nvidia-drm/nvidia-drm-encoder.h 2020-02-09 22:37:55.799547995 +0200
|
||||
@@ -32,7 +32,7 @@
|
||||
#if defined(NV_DRM_DRM_ENCODER_H_PRESENT)
|
||||
#include <drm/drm_encoder.h>
|
||||
#else
|
||||
-#include <drm/drmP.h>
|
||||
+#include "nv-drm.h"
|
||||
#endif
|
||||
|
||||
#include "nvkms-kapi.h"
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-drm/nvidia-drm-fb.h NVIDIA-Linux-x86_64-390.132/kernel/nvidia-drm/nvidia-drm-fb.h
|
||||
--- NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-drm/nvidia-drm-fb.h 2019-11-01 14:37:54.000000000 +0200
|
||||
+++ NVIDIA-Linux-x86_64-390.132/kernel/nvidia-drm/nvidia-drm-fb.h 2020-02-09 22:37:55.799547995 +0200
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
|
||||
|
||||
-#include <drm/drmP.h>
|
||||
+#include "nv-drm.h"
|
||||
#include "nvidia-drm-gem-nvkms-memory.h"
|
||||
#include "nvkms-kapi.h"
|
||||
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-drm/nvidia-drm-gem.h NVIDIA-Linux-x86_64-390.132/kernel/nvidia-drm/nvidia-drm-gem.h
|
||||
--- NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-drm/nvidia-drm-gem.h 2019-11-01 14:37:54.000000000 +0200
|
||||
+++ NVIDIA-Linux-x86_64-390.132/kernel/nvidia-drm/nvidia-drm-gem.h 2020-02-09 22:37:55.799547995 +0200
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
#include "nvidia-drm-priv.h"
|
||||
|
||||
-#include <drm/drmP.h>
|
||||
+#include "nv-drm.h"
|
||||
#include "nvkms-kapi.h"
|
||||
|
||||
#if defined(NV_DRM_DRIVER_HAS_GEM_PRIME_RES_OBJ)
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-drm/nvidia-drm-helper.c NVIDIA-Linux-x86_64-390.132/kernel/nvidia-drm/nvidia-drm-helper.c
|
||||
--- NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-drm/nvidia-drm-helper.c 2019-11-01 14:37:54.000000000 +0200
|
||||
+++ NVIDIA-Linux-x86_64-390.132/kernel/nvidia-drm/nvidia-drm-helper.c 2020-02-09 22:37:55.799547995 +0200
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
#if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
|
||||
|
||||
-#include <drm/drmP.h>
|
||||
+#include "nv-drm.h"
|
||||
#if defined(NV_DRM_DRM_ATOMIC_UAPI_H_PRESENT)
|
||||
#include <drm/drm_atomic_uapi.h>
|
||||
#endif
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-drm/nvidia-drm-helper.h NVIDIA-Linux-x86_64-390.132/kernel/nvidia-drm/nvidia-drm-helper.h
|
||||
--- NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-drm/nvidia-drm-helper.h 2019-11-01 14:37:54.000000000 +0200
|
||||
+++ NVIDIA-Linux-x86_64-390.132/kernel/nvidia-drm/nvidia-drm-helper.h 2020-02-09 22:37:55.799547995 +0200
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#if defined(NV_DRM_AVAILABLE)
|
||||
|
||||
-#include <drm/drmP.h>
|
||||
+#include "nv-drm.h"
|
||||
|
||||
/*
|
||||
* drm_dev_put() is added by commit 9a96f55034e41b4e002b767e9218d55f03bdff7d
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-drm/nvidia-drm-modeset.h NVIDIA-Linux-x86_64-390.132/kernel/nvidia-drm/nvidia-drm-modeset.h
|
||||
--- NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-drm/nvidia-drm-modeset.h 2019-11-01 14:37:54.000000000 +0200
|
||||
+++ NVIDIA-Linux-x86_64-390.132/kernel/nvidia-drm/nvidia-drm-modeset.h 2020-02-09 22:37:55.799547995 +0200
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
|
||||
|
||||
-#include <drm/drmP.h>
|
||||
+#include "nv-drm.h"
|
||||
|
||||
struct drm_atomic_state *nv_drm_atomic_state_alloc(struct drm_device *dev);
|
||||
void nv_drm_atomic_state_clear(struct drm_atomic_state *state);
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-drm/nvidia-drm-os-interface.h NVIDIA-Linux-x86_64-390.132/kernel/nvidia-drm/nvidia-drm-os-interface.h
|
||||
--- NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-drm/nvidia-drm-os-interface.h 2019-11-01 14:37:54.000000000 +0200
|
||||
+++ NVIDIA-Linux-x86_64-390.132/kernel/nvidia-drm/nvidia-drm-os-interface.h 2020-02-09 22:37:55.799547995 +0200
|
||||
@@ -29,7 +29,7 @@
|
||||
|
||||
#if defined(NV_DRM_AVAILABLE)
|
||||
|
||||
-#include <drm/drmP.h>
|
||||
+#include "nv-drm.h"
|
||||
|
||||
/* Set to true when the atomic modeset feature is enabled. */
|
||||
extern bool nv_drm_modeset_module_param;
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-drm/nvidia-drm-prime-fence.h NVIDIA-Linux-x86_64-390.132/kernel/nvidia-drm/nvidia-drm-prime-fence.h
|
||||
--- NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-drm/nvidia-drm-prime-fence.h 2019-11-01 14:37:54.000000000 +0200
|
||||
+++ NVIDIA-Linux-x86_64-390.132/kernel/nvidia-drm/nvidia-drm-prime-fence.h 2020-02-09 22:37:55.799547995 +0200
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#if defined(NV_DRM_AVAILABLE)
|
||||
|
||||
-#include <drm/drmP.h>
|
||||
+#include "nv-drm.h"
|
||||
|
||||
#if defined(NV_DRM_DRIVER_HAS_GEM_PRIME_RES_OBJ)
|
||||
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-drm/nvidia-drm-priv.h NVIDIA-Linux-x86_64-390.132/kernel/nvidia-drm/nvidia-drm-priv.h
|
||||
--- NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-drm/nvidia-drm-priv.h 2019-11-01 14:37:54.000000000 +0200
|
||||
+++ NVIDIA-Linux-x86_64-390.132/kernel/nvidia-drm/nvidia-drm-priv.h 2020-02-09 22:37:55.799547995 +0200
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#if defined(NV_DRM_AVAILABLE)
|
||||
|
||||
-#include <drm/drmP.h>
|
||||
+#include "nv-drm.h"
|
||||
|
||||
#if defined(NV_DRM_DRM_GEM_H_PRESENT)
|
||||
#include <drm/drm_gem.h>
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-drm/nvidia-drm-utils.h NVIDIA-Linux-x86_64-390.132/kernel/nvidia-drm/nvidia-drm-utils.h
|
||||
--- NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-drm/nvidia-drm-utils.h 2019-11-01 14:37:54.000000000 +0200
|
||||
+++ NVIDIA-Linux-x86_64-390.132/kernel/nvidia-drm/nvidia-drm-utils.h 2020-02-09 22:37:55.799547995 +0200
|
||||
@@ -27,7 +27,7 @@
|
||||
|
||||
#if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
|
||||
|
||||
-#include <drm/drmP.h>
|
||||
+#include "nv-drm.h"
|
||||
#include "nvkms-kapi.h"
|
||||
|
||||
struct NvKmsKapiConnectorInfo*
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.132.orig/.manifest NVIDIA-Linux-x86_64-390.132/.manifest
|
||||
--- NVIDIA-Linux-x86_64-390.132.orig/.manifest 2019-11-01 10:31:50.000000000 +0200
|
||||
+++ NVIDIA-Linux-x86_64-390.132/.manifest 2020-02-09 22:37:55.798547949 +0200
|
||||
@@ -37,6 +37,7 @@ kernel/nvidia/nv-ibmnpu.c 0644 KERNEL_MO
|
||||
kernel/nvidia/nv-report-err.c 0644 KERNEL_MODULE_SRC INHERIT_PATH_DEPTH:1 MODULE:resman
|
||||
kernel/conftest.sh 0644 KERNEL_MODULE_SRC INHERIT_PATH_DEPTH:1 MODULE:resman
|
||||
kernel/common/inc/nv.h 0644 KERNEL_MODULE_SRC INHERIT_PATH_DEPTH:1 MODULE:resman
|
||||
+kernel/common/inc/nv-drm.h 0644 KERNEL_MODULE_SRC INHERIT_PATH_DEPTH:1 MODULE:resman
|
||||
kernel/common/inc/nv-pgprot.h 0644 KERNEL_MODULE_SRC INHERIT_PATH_DEPTH:1 MODULE:resman
|
||||
kernel/common/inc/nv-mm.h 0644 KERNEL_MODULE_SRC INHERIT_PATH_DEPTH:1 MODULE:resman
|
||||
kernel/common/inc/nv-timer.h 0644 KERNEL_MODULE_SRC INHERIT_PATH_DEPTH:1 MODULE:resman
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-uvm/uvm_linux.h NVIDIA-Linux-x86_64-390.132/kernel/nvidia-uvm/uvm_linux.h
|
||||
--- NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-uvm/uvm_linux.h 2019-11-01 14:37:49.000000000 +0200
|
||||
+++ NVIDIA-Linux-x86_64-390.132/kernel/nvidia-uvm/uvm_linux.h 2020-04-11 01:44:45.233557933 +0300
|
||||
@@ -329,7 +329,16 @@ static inline uint64_t NV_DIV64(uint64_t
|
||||
}
|
||||
#endif
|
||||
|
||||
-#if defined(CLOCK_MONOTONIC_RAW)
|
||||
+#if defined(NV_KTIME_GET_RAW_TS64_PRESENT)
|
||||
+static inline NvU64 NV_GETTIME(void)
|
||||
+{
|
||||
+ struct timespec64 ts64 = {0};
|
||||
+
|
||||
+ ktime_get_raw_ts64(&ts64);
|
||||
+
|
||||
+ return (ts64.tv_sec * 1000000000ULL + ts64.tv_nsec);
|
||||
+}
|
||||
+#elif defined(CLOCK_MONOTONIC_RAW)
|
||||
/* Return a nanosecond-precise value */
|
||||
static inline NvU64 NV_GETTIME(void)
|
||||
{
|
||||
@@ -345,7 +354,7 @@ static inline NvU64 NV_GETTIME(void)
|
||||
* available non-GPL symbols. */
|
||||
static inline NvU64 NV_GETTIME(void)
|
||||
{
|
||||
- struct timeval tv = {0};
|
||||
+ struct nv_timeval tv = {0};
|
||||
|
||||
nv_gettimeofday(&tv);
|
||||
|
||||
@@ -1,375 +0,0 @@
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.132.orig/kernel/common/inc/nv-linux.h NVIDIA-Linux-x86_64-390.132/kernel/common/inc/nv-linux.h
|
||||
--- NVIDIA-Linux-x86_64-390.132.orig/kernel/common/inc/nv-linux.h 2019-11-01 14:37:47.000000000 +0200
|
||||
+++ NVIDIA-Linux-x86_64-390.132/kernel/common/inc/nv-linux.h 2020-04-11 01:44:45.232557886 +0300
|
||||
@@ -553,7 +553,11 @@ static inline void *nv_ioremap(NvU64 phy
|
||||
|
||||
static inline void *nv_ioremap_nocache(NvU64 phys, NvU64 size)
|
||||
{
|
||||
+#if defined(NV_IOREMAP_NOCACHE_PRESENT)
|
||||
void *ptr = ioremap_nocache(phys, size);
|
||||
+#else
|
||||
+ void *ptr = ioremap(phys, size);
|
||||
+#endif
|
||||
if (ptr)
|
||||
NV_MEMDBG_ADD(ptr, size);
|
||||
return ptr;
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.132.orig/kernel/common/inc/nv-procfs.h NVIDIA-Linux-x86_64-390.132/kernel/common/inc/nv-procfs.h
|
||||
--- NVIDIA-Linux-x86_64-390.132.orig/kernel/common/inc/nv-procfs.h 2019-11-01 14:37:47.000000000 +0200
|
||||
+++ NVIDIA-Linux-x86_64-390.132/kernel/common/inc/nv-procfs.h 2020-04-11 01:44:45.232557886 +0300
|
||||
@@ -52,6 +52,19 @@
|
||||
})
|
||||
#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; \
|
||||
@@ -63,6 +76,7 @@
|
||||
__data); \
|
||||
__entry; \
|
||||
})
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* proc_mkdir_mode exists in Linux 2.6.9, but isn't exported until Linux 3.0.
|
||||
@@ -104,6 +118,24 @@
|
||||
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, \
|
||||
@@ -121,6 +153,7 @@
|
||||
.llseek = seq_lseek, \
|
||||
.release = single_release, \
|
||||
};
|
||||
+#endif
|
||||
|
||||
#endif /* CONFIG_PROC_FS */
|
||||
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.132.orig/kernel/common/inc/nv-time.h NVIDIA-Linux-x86_64-390.132/kernel/common/inc/nv-time.h
|
||||
--- NVIDIA-Linux-x86_64-390.132.orig/kernel/common/inc/nv-time.h 2019-11-01 14:37:47.000000000 +0200
|
||||
+++ NVIDIA-Linux-x86_64-390.132/kernel/common/inc/nv-time.h 2020-04-11 01:44:45.232557886 +0300
|
||||
@@ -30,7 +30,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);
|
||||
@@ -39,7 +44,7 @@ static inline void nv_gettimeofday(struc
|
||||
|
||||
ktime_get_real_ts64(&now);
|
||||
|
||||
- *tv = (struct timeval) {
|
||||
+ *tv = (struct nv_timeval) {
|
||||
.tv_sec = now.tv_sec,
|
||||
.tv_usec = now.tv_nsec/1000,
|
||||
};
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.132.orig/kernel/conftest.sh NVIDIA-Linux-x86_64-390.132/kernel/conftest.sh
|
||||
--- NVIDIA-Linux-x86_64-390.132.orig/kernel/conftest.sh 2020-04-11 01:44:21.688440269 +0300
|
||||
+++ NVIDIA-Linux-x86_64-390.132/kernel/conftest.sh 2020-04-11 01:44:45.233557933 +0300
|
||||
@@ -1189,6 +1189,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.
|
||||
@@ -1422,6 +1438,31 @@ compile_test() {
|
||||
compile_check_conftest "$CODE" "NV_SG_ALLOC_TABLE_FROM_PAGES_PRESENT" "" "functions"
|
||||
;;
|
||||
|
||||
+ 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"
|
||||
+ ;;
|
||||
+
|
||||
+ ktime_get_raw_ts64)
|
||||
+ #
|
||||
+ # Determine if the ktime_get_raw_ts64() function is present.
|
||||
+ #
|
||||
+ CODE="
|
||||
+ #include <linux/ktime.h>
|
||||
+ int conftest_ktime_get_raw_ts64(void) {
|
||||
+ struct timespec64 ts = {0};
|
||||
+
|
||||
+ ktime_get_raw_ts64(&ts64);
|
||||
+ }"
|
||||
+
|
||||
+ compile_check_conftest "$CODE" "NV_KTIME_GET_RAW_TS64_PRESENT" "" "functions"
|
||||
+ ;;
|
||||
+
|
||||
efi_enabled)
|
||||
#
|
||||
# Determine if the efi_enabled symbol is present, or if
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia/nvidia.Kbuild NVIDIA-Linux-x86_64-390.132/kernel/nvidia/nvidia.Kbuild
|
||||
--- NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia/nvidia.Kbuild 2019-11-01 12:31:51.000000000 +0200
|
||||
+++ NVIDIA-Linux-x86_64-390.132/kernel/nvidia/nvidia.Kbuild 2020-04-11 01:44:45.233557933 +0300
|
||||
@@ -117,6 +117,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += on
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += smp_call_function
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += acpi_evaluate_integer
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += ioremap_cache
|
||||
+NV_CONFTEST_FUNCTION_COMPILE_TESTS += ioremap_nocache
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += ioremap_wc
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += acpi_walk_namespace
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_domain_nr
|
||||
@@ -169,7 +170,9 @@ NV_CONFTEST_TYPE_COMPILE_TESTS += outer_
|
||||
NV_CONFTEST_TYPE_COMPILE_TESTS += proc_dir_entry
|
||||
NV_CONFTEST_TYPE_COMPILE_TESTS += scatterlist
|
||||
NV_CONFTEST_TYPE_COMPILE_TESTS += sg_table
|
||||
+NV_CONFTEST_TYPE_COMPILE_TESTS += proc_ops
|
||||
NV_CONFTEST_TYPE_COMPILE_TESTS += file_operations
|
||||
+NV_CONFTEST_TYPE_COMPILE_TESTS += ktime_get_raw_ts64
|
||||
NV_CONFTEST_TYPE_COMPILE_TESTS += vm_operations_struct
|
||||
NV_CONFTEST_TYPE_COMPILE_TESTS += atomic_long_type
|
||||
NV_CONFTEST_TYPE_COMPILE_TESTS += pci_save_state
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia/nvlink_linux.c NVIDIA-Linux-x86_64-390.132/kernel/nvidia/nvlink_linux.c
|
||||
--- NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia/nvlink_linux.c 2019-11-01 14:37:55.000000000 +0200
|
||||
+++ NVIDIA-Linux-x86_64-390.132/kernel/nvidia/nvlink_linux.c 2020-04-11 01:44:45.233557933 +0300
|
||||
@@ -518,8 +518,8 @@ void * NVLINK_API_CALL nvlink_memcpy(voi
|
||||
|
||||
static NvBool nv_timer_less_than
|
||||
(
|
||||
- const struct timeval *a,
|
||||
- const struct timeval *b
|
||||
+ const struct nv_timeval *a,
|
||||
+ const struct nv_timeval *b
|
||||
)
|
||||
{
|
||||
return (a->tv_sec == b->tv_sec) ? (a->tv_usec < b->tv_usec)
|
||||
@@ -528,9 +528,9 @@ static NvBool nv_timer_less_than
|
||||
|
||||
static void nv_timeradd
|
||||
(
|
||||
- const struct timeval *a,
|
||||
- const struct timeval *b,
|
||||
- struct timeval *result
|
||||
+ const struct nv_timeval *a,
|
||||
+ const struct nv_timeval *b,
|
||||
+ struct nv_timeval *result
|
||||
)
|
||||
{
|
||||
result->tv_sec = a->tv_sec + b->tv_sec;
|
||||
@@ -544,9 +544,9 @@ static void nv_timeradd
|
||||
|
||||
static void nv_timersub
|
||||
(
|
||||
- const struct timeval *a,
|
||||
- const struct timeval *b,
|
||||
- struct timeval *result
|
||||
+ const struct nv_timeval *a,
|
||||
+ const struct nv_timeval *b,
|
||||
+ struct nv_timeval *result
|
||||
)
|
||||
{
|
||||
result->tv_sec = a->tv_sec - b->tv_sec;
|
||||
@@ -566,7 +566,7 @@ void NVLINK_API_CALL nvlink_sleep(unsign
|
||||
unsigned long us;
|
||||
unsigned long jiffies;
|
||||
unsigned long mdelay_safe_msec;
|
||||
- struct timeval tm_end, tm_aux;
|
||||
+ struct nv_timeval tm_end, tm_aux;
|
||||
|
||||
nv_gettimeofday(&tm_aux);
|
||||
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia/nv-procfs.c NVIDIA-Linux-x86_64-390.132/kernel/nvidia/nv-procfs.c
|
||||
--- NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia/nv-procfs.c 2019-11-01 14:37:47.000000000 +0200
|
||||
+++ NVIDIA-Linux-x86_64-390.132/kernel/nvidia/nv-procfs.c 2020-04-11 01:44:45.233557933 +0300
|
||||
@@ -414,6 +414,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,
|
||||
@@ -422,6 +431,7 @@ static struct file_operations nv_procfs_
|
||||
.llseek = seq_lseek,
|
||||
.release = nv_procfs_close_registry,
|
||||
};
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* Forwards error to nv_log_error which exposes data to vendor callback
|
||||
@@ -517,12 +527,20 @@ done:
|
||||
return status;
|
||||
}
|
||||
|
||||
+#if defined(NV_HAVE_PROC_OPS)
|
||||
+static struct proc_ops nv_procfs_exercise_error_forwarding_fops = {
|
||||
+ .proc_open = nv_procfs_open_exercise_error_forwarding,
|
||||
+ .proc_write = nv_procfs_write_file,
|
||||
+ .proc_release = nv_procfs_close_exercise_error_forwarding,
|
||||
+};
|
||||
+#else
|
||||
static struct file_operations nv_procfs_exercise_error_forwarding_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = nv_procfs_open_exercise_error_forwarding,
|
||||
.write = nv_procfs_write_file,
|
||||
.release = nv_procfs_close_exercise_error_forwarding,
|
||||
};
|
||||
+#endif
|
||||
|
||||
static int
|
||||
nv_procfs_read_unbind_lock(
|
||||
@@ -650,6 +668,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,
|
||||
@@ -658,6 +685,7 @@ static struct file_operations nv_procfs_
|
||||
.llseek = seq_lseek,
|
||||
.release = nv_procfs_close_unbind_lock,
|
||||
};
|
||||
+#endif
|
||||
|
||||
static int
|
||||
nv_procfs_read_text_file(
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia/os-interface.c NVIDIA-Linux-x86_64-390.132/kernel/nvidia/os-interface.c
|
||||
--- NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia/os-interface.c 2019-11-01 14:37:47.000000000 +0200
|
||||
+++ NVIDIA-Linux-x86_64-390.132/kernel/nvidia/os-interface.c 2020-04-11 01:44:45.233557933 +0300
|
||||
@@ -430,7 +430,7 @@ NV_STATUS NV_API_CALL os_get_current_tim
|
||||
NvU32 *useconds
|
||||
)
|
||||
{
|
||||
- struct timeval tm;
|
||||
+ struct nv_timeval tm;
|
||||
|
||||
nv_gettimeofday(&tm);
|
||||
|
||||
@@ -444,9 +444,15 @@ NV_STATUS NV_API_CALL os_get_current_tim
|
||||
|
||||
void NV_API_CALL os_get_current_tick(NvU64 *nseconds)
|
||||
{
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 5, 0)
|
||||
+ struct timespec64 ts;
|
||||
+
|
||||
+ jiffies_to_timespec64(jiffies, &ts);
|
||||
+#else
|
||||
struct timespec ts;
|
||||
|
||||
jiffies_to_timespec(jiffies, &ts);
|
||||
+#endif
|
||||
|
||||
*nseconds = ((NvU64)ts.tv_sec * NSEC_PER_SEC + (NvU64)ts.tv_nsec);
|
||||
}
|
||||
@@ -502,7 +508,7 @@ NV_STATUS NV_API_CALL os_delay_us(NvU32
|
||||
unsigned long usec;
|
||||
|
||||
#ifdef NV_CHECK_DELAY_ACCURACY
|
||||
- struct timeval tm1, tm2;
|
||||
+ struct nv_timeval tm1, tm2;
|
||||
|
||||
nv_gettimeofday(&tm1);
|
||||
#endif
|
||||
@@ -542,9 +548,9 @@ NV_STATUS NV_API_CALL os_delay(NvU32 Mil
|
||||
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);
|
||||
@@ -1926,7 +1932,7 @@ static NV_STATUS NV_API_CALL _os_ipmi_re
|
||||
{
|
||||
struct ipmi_recv_msg *rx_msg;
|
||||
int err_no;
|
||||
- struct timeval tv;
|
||||
+ struct nv_timeval tv;
|
||||
NvU64 start_time;
|
||||
|
||||
nv_gettimeofday(&tv);
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-modeset/nvidia-modeset-linux.c NVIDIA-Linux-x86_64-390.132/kernel/nvidia-modeset/nvidia-modeset-linux.c
|
||||
--- NVIDIA-Linux-x86_64-390.132.orig/kernel/nvidia-modeset/nvidia-modeset-linux.c 2019-11-01 14:37:54.000000000 +0200
|
||||
+++ NVIDIA-Linux-x86_64-390.132/kernel/nvidia-modeset/nvidia-modeset-linux.c 2020-04-11 01:44:45.233557933 +0300
|
||||
@@ -216,7 +216,7 @@ void NVKMS_API_CALL nvkms_usleep(NvU64 u
|
||||
|
||||
NvU64 NVKMS_API_CALL nvkms_get_usec(void)
|
||||
{
|
||||
- struct timeval tv;
|
||||
+ struct nv_timeval tv;
|
||||
|
||||
nv_gettimeofday(&tv);
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.87.orig/kernel/nvidia-drm/nvidia-drm-connector.c NVIDIA-Linux-x86_64-390.87/kernel/nvidia-drm/nvidia-drm-connector.c
|
||||
--- NVIDIA-Linux-x86_64-390.87.orig/kernel/nvidia-drm/nvidia-drm-connector.c 2018-08-22 03:55:29.000000000 +0300
|
||||
+++ NVIDIA-Linux-x86_64-390.87/kernel/nvidia-drm/nvidia-drm-connector.c 2018-11-09 19:46:54.625801192 +0200
|
||||
@@ -30,6 +30,8 @@
|
||||
#include "nvidia-drm-utils.h"
|
||||
#include "nvidia-drm-encoder.h"
|
||||
|
||||
+#include <linux/version.h>
|
||||
+
|
||||
#include <drm/drm_crtc_helper.h>
|
||||
|
||||
#include <drm/drm_atomic.h>
|
||||
@@ -226,8 +228,13 @@ static int nv_drm_connector_get_modes(st
|
||||
|
||||
|
||||
if (nv_connector->edid != NULL) {
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)
|
||||
drm_mode_connector_update_edid_property(
|
||||
connector, nv_connector->edid);
|
||||
+#else
|
||||
+ drm_connector_update_edid_property(
|
||||
+ connector, nv_connector->edid);
|
||||
+#endif
|
||||
}
|
||||
|
||||
while (1) {
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.87.orig/kernel/nvidia-drm/nvidia-drm-encoder.c NVIDIA-Linux-x86_64-390.87/kernel/nvidia-drm/nvidia-drm-encoder.c
|
||||
--- NVIDIA-Linux-x86_64-390.87.orig/kernel/nvidia-drm/nvidia-drm-encoder.c 2018-08-22 03:55:29.000000000 +0300
|
||||
+++ NVIDIA-Linux-x86_64-390.87/kernel/nvidia-drm/nvidia-drm-encoder.c 2018-11-09 19:49:34.863861811 +0200
|
||||
@@ -30,6 +30,8 @@
|
||||
#include "nvidia-drm-connector.h"
|
||||
#include "nvidia-drm-crtc.h"
|
||||
|
||||
+#include <linux/version.h>
|
||||
+
|
||||
#include <drm/drm_crtc_helper.h>
|
||||
|
||||
#include <drm/drm_atomic.h>
|
||||
@@ -216,7 +218,11 @@ nv_drm_add_encoder(struct drm_device *de
|
||||
|
||||
/* Attach encoder and connector */
|
||||
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)
|
||||
ret = drm_mode_connector_attach_encoder(connector, encoder);
|
||||
+#else
|
||||
+ ret = drm_connector_attach_encoder(connector, encoder);
|
||||
+#endif
|
||||
|
||||
if (ret != 0) {
|
||||
NV_DRM_DEV_LOG_ERR(
|
||||
@@ -1,43 +0,0 @@
|
||||
--- a/kernel/nvidia/os-interface.c
|
||||
+++ b/kernel/nvidia/os-interface.c
|
||||
@@ -1670,7 +1670,7 @@
|
||||
|
||||
struct nv_ipmi_softc
|
||||
{
|
||||
- ipmi_user_t p_user; // ptr to ipmi_msghandler user structure
|
||||
+ struct ipmi_user *p_user;
|
||||
spinlock_t msg_lock;
|
||||
struct list_head msgs;
|
||||
NvU32 seqNum; //request sequence number
|
||||
@@ -1679,7 +1679,7 @@
|
||||
static inline int
|
||||
nv_ipmi_set_my_address
|
||||
(
|
||||
- ipmi_user_t user,
|
||||
+ struct ipmi_user *user,
|
||||
unsigned char address
|
||||
)
|
||||
{
|
||||
--- a/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c
|
||||
+++ b/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c
|
||||
@@ -20,6 +20,8 @@
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
+#include <linux/version.h>
|
||||
+
|
||||
#include "nvidia-drm-conftest.h"
|
||||
|
||||
#if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
|
||||
@@ -345,7 +347,11 @@ static int __nv_drm_vma_fault(struct vm_area_struct *vma,
|
||||
|
||||
page_offset = vmf->pgoff - drm_vma_node_start(&gem->vma_node);
|
||||
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 19, 0)
|
||||
ret = vm_insert_pfn(vma, address, pfn + page_offset);
|
||||
+#else
|
||||
+ ret = vmf_insert_pfn(vma, address, pfn + page_offset);
|
||||
+#endif
|
||||
|
||||
switch (ret) {
|
||||
case 0:
|
||||
@@ -0,0 +1,34 @@
|
||||
|
||||
Commit:
|
||||
|
||||
From b347e04452ff6382ace8fba9c81f5bcb63be17a6 Mon Sep 17 00:00:00 2001
|
||||
From: Thomas Zimmermann <tzimmermann@suse.de>
|
||||
Date: Sun, 2 May 2021 12:49:53 +0200
|
||||
Subject: drm: Remove pdev field from struct drm_device
|
||||
|
||||
removed pdev from struct.
|
||||
|
||||
Signed-off-by: Thomas Backlund <tmb@mageia.org>
|
||||
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.144.orig/kernel/nvidia-drm/nvidia-drm-drv.c NVIDIA-Linux-x86_64-390.144/kernel/nvidia-drm/nvidia-drm-drv.c
|
||||
--- NVIDIA-Linux-x86_64-390.144.orig/kernel/nvidia-drm/nvidia-drm-drv.c 2021-06-03 02:10:01.000000000 +0300
|
||||
+++ NVIDIA-Linux-x86_64-390.144/kernel/nvidia-drm/nvidia-drm-drv.c 2021-08-31 22:28:43.141140842 +0300
|
||||
@@ -35,6 +35,8 @@
|
||||
#include "nvidia-drm-gem-nvkms-memory.h"
|
||||
#include "nvidia-drm-gem-user-memory.h"
|
||||
|
||||
+#include <linux/version.h>
|
||||
+
|
||||
#if defined(NV_DRM_AVAILABLE)
|
||||
|
||||
#include "nvidia-drm-ioctl.h"
|
||||
@@ -811,7 +817,9 @@ static void nv_drm_register_drm_device(c
|
||||
|
||||
dev->dev_private = nv_dev;
|
||||
nv_dev->dev = dev;
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0)
|
||||
dev->pdev = pdev;
|
||||
+#endif
|
||||
|
||||
/* Register DRM device to DRM sub-system */
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
|
||||
Commit:
|
||||
|
||||
From 2f064a59a11ff9bc22e52e9678bc601404c7cb34 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Zijlstra <peterz@infradead.org>
|
||||
Date: Fri, 11 Jun 2021 10:28:17 +0200
|
||||
Subject: sched: Change task_struct::state
|
||||
|
||||
changed "state" to "__state" to catch callers that could use READ_ONCE/WRITE_ONCE
|
||||
as appropriate.
|
||||
|
||||
so lets switch to using set_current_state()
|
||||
|
||||
Signed-off-by: Thomas Backlund <tmb@mageia.org>
|
||||
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.144.orig/kernel/nvidia/nvlink_linux.c NVIDIA-Linux-x86_64-390.144/kernel/nvidia/nvlink_linux.c
|
||||
--- NVIDIA-Linux-x86_64-390.144.orig/kernel/nvidia/nvlink_linux.c 2021-06-03 02:10:01.000000000 +0300
|
||||
+++ NVIDIA-Linux-x86_64-390.144/kernel/nvidia/nvlink_linux.c 2021-08-31 21:48:30.559918371 +0300
|
||||
@@ -597,7 +597,11 @@ void NVLINK_API_CALL nvlink_sleep(unsign
|
||||
// the requested timeout has expired, loop until less
|
||||
// than a jiffie of the desired delay remains.
|
||||
//
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0)
|
||||
current->state = TASK_INTERRUPTIBLE;
|
||||
+#else
|
||||
+ set_current_state(TASK_INTERRUPTIBLE);
|
||||
+#endif
|
||||
do
|
||||
{
|
||||
schedule_timeout(jiffies);
|
||||
diff -Nurp NVIDIA-Linux-x86_64-390.144.orig/kernel/nvidia/os-interface.c NVIDIA-Linux-x86_64-390.144/kernel/nvidia/os-interface.c
|
||||
--- NVIDIA-Linux-x86_64-390.144.orig/kernel/nvidia/os-interface.c 2021-06-03 02:09:57.000000000 +0300
|
||||
+++ NVIDIA-Linux-x86_64-390.144/kernel/nvidia/os-interface.c 2021-08-31 21:49:57.002092986 +0300
|
||||
@@ -580,7 +580,11 @@ NV_STATUS NV_API_CALL os_delay(NvU32 Mil
|
||||
// the requested timeout has expired, loop until less
|
||||
// than a jiffie of the desired delay remains.
|
||||
//
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0)
|
||||
current->state = TASK_INTERRUPTIBLE;
|
||||
+#else
|
||||
+ set_current_state(TASK_INTERRUPTIBLE);
|
||||
+#endif
|
||||
do
|
||||
{
|
||||
schedule_timeout(jiffies);
|
||||
@@ -1,415 +0,0 @@
|
||||
diff --git a/kernel/common/inc/nv-linux.h b/kernel/common/inc/nv-linux.h
|
||||
index 85041c2..ac5bb95 100644
|
||||
--- a/kernel/common/inc/nv-linux.h
|
||||
+++ b/kernel/common/inc/nv-linux.h
|
||||
@@ -553,7 +553,11 @@ static inline void *nv_ioremap(NvU64 phys, NvU64 size)
|
||||
|
||||
static inline void *nv_ioremap_nocache(NvU64 phys, NvU64 size)
|
||||
{
|
||||
+#if defined(NV_IOREMAP_NOCACHE_PRESENT)
|
||||
void *ptr = ioremap_nocache(phys, size);
|
||||
+#else
|
||||
+ void *ptr = ioremap(phys, size);
|
||||
+#endif
|
||||
if (ptr)
|
||||
NV_MEMDBG_ADD(ptr, size);
|
||||
return ptr;
|
||||
diff --git a/kernel/common/inc/nv-procfs.h b/kernel/common/inc/nv-procfs.h
|
||||
index 3c812ea..e57c4f9 100644
|
||||
--- a/kernel/common/inc/nv-procfs.h
|
||||
+++ b/kernel/common/inc/nv-procfs.h
|
||||
@@ -52,6 +52,19 @@
|
||||
})
|
||||
#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; \
|
||||
@@ -63,6 +76,7 @@
|
||||
__data); \
|
||||
__entry; \
|
||||
})
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* proc_mkdir_mode exists in Linux 2.6.9, but isn't exported until Linux 3.0.
|
||||
@@ -104,6 +118,24 @@
|
||||
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, \
|
||||
@@ -121,6 +153,7 @@
|
||||
.llseek = seq_lseek, \
|
||||
.release = single_release, \
|
||||
};
|
||||
+#endif
|
||||
|
||||
#endif /* CONFIG_PROC_FS */
|
||||
|
||||
diff --git a/kernel/common/inc/nv-time.h b/kernel/common/inc/nv-time.h
|
||||
index 2c799c9..0206062 100644
|
||||
--- a/kernel/common/inc/nv-time.h
|
||||
+++ b/kernel/common/inc/nv-time.h
|
||||
@@ -30,7 +30,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);
|
||||
@@ -39,7 +44,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/conftest.sh b/kernel/conftest.sh
|
||||
index ec9e093..463a464 100755
|
||||
--- a/kernel/conftest.sh
|
||||
+++ b/kernel/conftest.sh
|
||||
@@ -1197,6 +1197,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.
|
||||
@@ -1430,6 +1446,31 @@ compile_test() {
|
||||
compile_check_conftest "$CODE" "NV_SG_ALLOC_TABLE_FROM_PAGES_PRESENT" "" "functions"
|
||||
;;
|
||||
|
||||
+ 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"
|
||||
+ ;;
|
||||
+
|
||||
+ ktime_get_raw_ts64)
|
||||
+ #
|
||||
+ # Determine if the ktime_get_raw_ts64() function is present.
|
||||
+ #
|
||||
+ CODE="
|
||||
+ #include <linux/ktime.h>
|
||||
+ int conftest_ktime_get_raw_ts64(void) {
|
||||
+ struct timespec64 ts = {0};
|
||||
+
|
||||
+ ktime_get_raw_ts64(&ts64);
|
||||
+ }"
|
||||
+
|
||||
+ compile_check_conftest "$CODE" "NV_KTIME_GET_RAW_TS64_PRESENT" "" "functions"
|
||||
+ ;;
|
||||
+
|
||||
efi_enabled)
|
||||
#
|
||||
# Determine if the efi_enabled symbol is present, or if
|
||||
diff --git a/kernel/nvidia-modeset/nvidia-modeset-linux.c b/kernel/nvidia-modeset/nvidia-modeset-linux.c
|
||||
index d42aabb..f0404fb 100644
|
||||
--- a/kernel/nvidia-modeset/nvidia-modeset-linux.c
|
||||
+++ b/kernel/nvidia-modeset/nvidia-modeset-linux.c
|
||||
@@ -216,7 +216,7 @@ void NVKMS_API_CALL nvkms_usleep(NvU64 usec)
|
||||
|
||||
NvU64 NVKMS_API_CALL nvkms_get_usec(void)
|
||||
{
|
||||
- struct timeval tv;
|
||||
+ struct nv_timeval tv;
|
||||
|
||||
nv_gettimeofday(&tv);
|
||||
|
||||
diff --git a/kernel/nvidia-uvm/uvm_linux.h b/kernel/nvidia-uvm/uvm_linux.h
|
||||
index 8784a82..c256cdb 100644
|
||||
--- a/kernel/nvidia-uvm/uvm_linux.h
|
||||
+++ b/kernel/nvidia-uvm/uvm_linux.h
|
||||
@@ -329,7 +329,16 @@ static inline uint64_t NV_DIV64(uint64_t dividend, uint64_t divisor, uint64_t *r
|
||||
}
|
||||
#endif
|
||||
|
||||
-#if defined(CLOCK_MONOTONIC_RAW)
|
||||
+#if defined(NV_KTIME_GET_RAW_TS64_PRESENT)
|
||||
+static inline NvU64 NV_GETTIME(void)
|
||||
+{
|
||||
+ struct timespec64 ts64 = {0};
|
||||
+
|
||||
+ ktime_get_raw_ts64(&ts64);
|
||||
+
|
||||
+ return (ts64.tv_sec * 1000000000ULL + ts64.tv_nsec);
|
||||
+}
|
||||
+#elif defined(CLOCK_MONOTONIC_RAW)
|
||||
/* Return a nanosecond-precise value */
|
||||
static inline NvU64 NV_GETTIME(void)
|
||||
{
|
||||
@@ -345,7 +354,7 @@ static inline NvU64 NV_GETTIME(void)
|
||||
* available non-GPL symbols. */
|
||||
static inline NvU64 NV_GETTIME(void)
|
||||
{
|
||||
- struct timeval tv = {0};
|
||||
+ struct nv_timeval tv = {0};
|
||||
|
||||
nv_gettimeofday(&tv);
|
||||
|
||||
diff --git a/kernel/nvidia/nv-procfs.c b/kernel/nvidia/nv-procfs.c
|
||||
index 5808a88..bc60a08 100644
|
||||
--- a/kernel/nvidia/nv-procfs.c
|
||||
+++ b/kernel/nvidia/nv-procfs.c
|
||||
@@ -414,6 +414,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,
|
||||
@@ -422,6 +431,7 @@ static struct file_operations nv_procfs_registry_fops = {
|
||||
.llseek = seq_lseek,
|
||||
.release = nv_procfs_close_registry,
|
||||
};
|
||||
+#endif
|
||||
|
||||
/*
|
||||
* Forwards error to nv_log_error which exposes data to vendor callback
|
||||
@@ -517,12 +527,20 @@ done:
|
||||
return status;
|
||||
}
|
||||
|
||||
+#if defined(NV_HAVE_PROC_OPS)
|
||||
+static struct proc_ops nv_procfs_exercise_error_forwarding_fops = {
|
||||
+ .proc_open = nv_procfs_open_exercise_error_forwarding,
|
||||
+ .proc_write = nv_procfs_write_file,
|
||||
+ .proc_release = nv_procfs_close_exercise_error_forwarding,
|
||||
+};
|
||||
+#else
|
||||
static struct file_operations nv_procfs_exercise_error_forwarding_fops = {
|
||||
.owner = THIS_MODULE,
|
||||
.open = nv_procfs_open_exercise_error_forwarding,
|
||||
.write = nv_procfs_write_file,
|
||||
.release = nv_procfs_close_exercise_error_forwarding,
|
||||
};
|
||||
+#endif
|
||||
|
||||
static int
|
||||
nv_procfs_read_unbind_lock(
|
||||
@@ -650,6 +668,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,
|
||||
@@ -658,6 +685,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/nvidia/nvidia.Kbuild b/kernel/nvidia/nvidia.Kbuild
|
||||
index 8ae1016..da7f135 100644
|
||||
--- a/kernel/nvidia/nvidia.Kbuild
|
||||
+++ b/kernel/nvidia/nvidia.Kbuild
|
||||
@@ -117,6 +117,7 @@ NV_CONFTEST_FUNCTION_COMPILE_TESTS += on_each_cpu
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += smp_call_function
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += acpi_evaluate_integer
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += ioremap_cache
|
||||
+NV_CONFTEST_FUNCTION_COMPILE_TESTS += ioremap_nocache
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += ioremap_wc
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += acpi_walk_namespace
|
||||
NV_CONFTEST_FUNCTION_COMPILE_TESTS += pci_domain_nr
|
||||
@@ -169,7 +170,9 @@ NV_CONFTEST_TYPE_COMPILE_TESTS += outer_flush_all
|
||||
NV_CONFTEST_TYPE_COMPILE_TESTS += proc_dir_entry
|
||||
NV_CONFTEST_TYPE_COMPILE_TESTS += scatterlist
|
||||
NV_CONFTEST_TYPE_COMPILE_TESTS += sg_table
|
||||
+NV_CONFTEST_TYPE_COMPILE_TESTS += proc_ops
|
||||
NV_CONFTEST_TYPE_COMPILE_TESTS += file_operations
|
||||
+NV_CONFTEST_TYPE_COMPILE_TESTS += ktime_get_raw_ts64
|
||||
NV_CONFTEST_TYPE_COMPILE_TESTS += vm_operations_struct
|
||||
NV_CONFTEST_TYPE_COMPILE_TESTS += atomic_long_type
|
||||
NV_CONFTEST_TYPE_COMPILE_TESTS += pci_save_state
|
||||
diff --git a/kernel/nvidia/nvlink_linux.c b/kernel/nvidia/nvlink_linux.c
|
||||
index 0014280..537b257 100644
|
||||
--- a/kernel/nvidia/nvlink_linux.c
|
||||
+++ b/kernel/nvidia/nvlink_linux.c
|
||||
@@ -518,8 +518,8 @@ void * NVLINK_API_CALL nvlink_memcpy(void *dest, void *src, NvLength size)
|
||||
|
||||
static NvBool nv_timer_less_than
|
||||
(
|
||||
- const struct timeval *a,
|
||||
- const struct timeval *b
|
||||
+ const struct nv_timeval *a,
|
||||
+ const struct nv_timeval *b
|
||||
)
|
||||
{
|
||||
return (a->tv_sec == b->tv_sec) ? (a->tv_usec < b->tv_usec)
|
||||
@@ -528,9 +528,9 @@ static NvBool nv_timer_less_than
|
||||
|
||||
static void nv_timeradd
|
||||
(
|
||||
- const struct timeval *a,
|
||||
- const struct timeval *b,
|
||||
- struct timeval *result
|
||||
+ const struct nv_timeval *a,
|
||||
+ const struct nv_timeval *b,
|
||||
+ struct nv_timeval *result
|
||||
)
|
||||
{
|
||||
result->tv_sec = a->tv_sec + b->tv_sec;
|
||||
@@ -544,9 +544,9 @@ static void nv_timeradd
|
||||
|
||||
static void nv_timersub
|
||||
(
|
||||
- const struct timeval *a,
|
||||
- const struct timeval *b,
|
||||
- struct timeval *result
|
||||
+ const struct nv_timeval *a,
|
||||
+ const struct nv_timeval *b,
|
||||
+ struct nv_timeval *result
|
||||
)
|
||||
{
|
||||
result->tv_sec = a->tv_sec - b->tv_sec;
|
||||
@@ -566,7 +566,7 @@ void NVLINK_API_CALL nvlink_sleep(unsigned int ms)
|
||||
unsigned long us;
|
||||
unsigned long jiffies;
|
||||
unsigned long mdelay_safe_msec;
|
||||
- struct timeval tm_end, tm_aux;
|
||||
+ struct nv_timeval tm_end, tm_aux;
|
||||
|
||||
nv_gettimeofday(&tm_aux);
|
||||
|
||||
diff --git a/kernel/nvidia/os-interface.c b/kernel/nvidia/os-interface.c
|
||||
index 344daa8..39d0a19 100644
|
||||
--- a/kernel/nvidia/os-interface.c
|
||||
+++ b/kernel/nvidia/os-interface.c
|
||||
@@ -430,7 +430,7 @@ NV_STATUS NV_API_CALL os_get_current_time(
|
||||
NvU32 *useconds
|
||||
)
|
||||
{
|
||||
- struct timeval tm;
|
||||
+ struct nv_timeval tm;
|
||||
|
||||
nv_gettimeofday(&tm);
|
||||
|
||||
@@ -444,9 +444,15 @@ NV_STATUS NV_API_CALL os_get_current_time(
|
||||
|
||||
void NV_API_CALL os_get_current_tick(NvU64 *nseconds)
|
||||
{
|
||||
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 5, 0)
|
||||
+ struct timespec64 ts;
|
||||
+
|
||||
+ jiffies_to_timespec64(jiffies, &ts);
|
||||
+#else
|
||||
struct timespec ts;
|
||||
|
||||
jiffies_to_timespec(jiffies, &ts);
|
||||
+#endif
|
||||
|
||||
*nseconds = ((NvU64)ts.tv_sec * NSEC_PER_SEC + (NvU64)ts.tv_nsec);
|
||||
}
|
||||
@@ -502,7 +508,7 @@ NV_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
|
||||
@@ -542,9 +548,9 @@ NV_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);
|
||||
@@ -1926,7 +1932,7 @@ static NV_STATUS NV_API_CALL _os_ipmi_receive_resp
|
||||
{
|
||||
struct ipmi_recv_msg *rx_msg;
|
||||
int err_no;
|
||||
- struct timeval tv;
|
||||
+ struct nv_timeval tv;
|
||||
NvU64 start_time;
|
||||
|
||||
nv_gettimeofday(&tv);
|
||||
@@ -1,130 +0,0 @@
|
||||
diff --git a/kernel/common/inc/nv-list-helpers.h b/kernel/common/inc/nv-list-helpers.h
|
||||
index 0aed851..d6304c9 100644
|
||||
--- a/kernel/common/inc/nv-list-helpers.h
|
||||
+++ b/kernel/common/inc/nv-list-helpers.h
|
||||
@@ -26,6 +26,8 @@
|
||||
#include <linux/list.h>
|
||||
#include "conftest.h"
|
||||
|
||||
+#include <linux/version.h>
|
||||
+
|
||||
#if !defined (list_for_each)
|
||||
#define list_for_each(pos, head) \
|
||||
for (pos = (head)->next; pos != (head); pos = (pos)->next)
|
||||
@@ -91,10 +93,12 @@
|
||||
list_entry((pos)->member.next, typeof(*(pos)), member)
|
||||
#endif
|
||||
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
|
||||
static inline int list_is_first(const struct list_head *list,
|
||||
const struct list_head *head)
|
||||
{
|
||||
return list->prev == head;
|
||||
}
|
||||
+#endif
|
||||
|
||||
#endif // __NV_LIST_HELPERS_H__
|
||||
diff --git a/kernel/nvidia-drm/nvidia-drm-connector.c b/kernel/nvidia-drm/nvidia-drm-connector.c
|
||||
index 24631c0..ba1497c 100644
|
||||
--- a/kernel/nvidia-drm/nvidia-drm-connector.c
|
||||
+++ b/kernel/nvidia-drm/nvidia-drm-connector.c
|
||||
@@ -30,7 +30,12 @@
|
||||
#include "nvidia-drm-utils.h"
|
||||
#include "nvidia-drm-encoder.h"
|
||||
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
|
||||
#include <drm/drm_crtc_helper.h>
|
||||
+#else
|
||||
+#include <drm/drm_probe_helper.h>
|
||||
+#endif
|
||||
|
||||
#include <drm/drm_atomic.h>
|
||||
#include <drm/drm_atomic_helper.h>
|
||||
diff --git a/kernel/nvidia-drm/nvidia-drm-drv.c b/kernel/nvidia-drm/nvidia-drm-drv.c
|
||||
index 1c2db68..d524d51 100644
|
||||
--- a/kernel/nvidia-drm/nvidia-drm-drv.c
|
||||
+++ b/kernel/nvidia-drm/nvidia-drm-drv.c
|
||||
@@ -41,7 +41,12 @@
|
||||
|
||||
#include <drm/drmP.h>
|
||||
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
|
||||
#include <drm/drm_crtc_helper.h>
|
||||
+#else
|
||||
+#include <drm/drm_probe_helper.h>
|
||||
+#endif
|
||||
|
||||
#if defined(NV_DRM_DRM_GEM_H_PRESENT)
|
||||
#include <drm/drm_gem.h>
|
||||
diff --git a/kernel/nvidia-drm/nvidia-drm-encoder.c b/kernel/nvidia-drm/nvidia-drm-encoder.c
|
||||
index f66bbd7..df38042 100644
|
||||
--- a/kernel/nvidia-drm/nvidia-drm-encoder.c
|
||||
+++ b/kernel/nvidia-drm/nvidia-drm-encoder.c
|
||||
@@ -31,7 +31,12 @@
|
||||
#include "nvidia-drm-crtc.h"
|
||||
#include "nvidia-drm-helper.h"
|
||||
|
||||
+#include <linux/version.h>
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
|
||||
#include <drm/drm_crtc_helper.h>
|
||||
+#else
|
||||
+#include <drm/drm_probe_helper.h>
|
||||
+#endif
|
||||
|
||||
#include <drm/drm_atomic.h>
|
||||
#include <drm/drm_atomic_helper.h>
|
||||
diff --git a/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c b/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c
|
||||
index 8636eff..fd0c8da 100644
|
||||
--- a/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c
|
||||
+++ b/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c
|
||||
@@ -29,6 +29,8 @@
|
||||
|
||||
#include "nv-mm.h"
|
||||
|
||||
+#include <linux/version.h>
|
||||
+
|
||||
static void __nv_drm_gem_nvkms_memory_free(struct nv_drm_gem_object *nv_gem)
|
||||
{
|
||||
struct nv_drm_device *nv_dev = nv_gem->nv_dev;
|
||||
@@ -268,7 +270,11 @@ static int __nv_drm_vma_fault(struct vm_area_struct *vma,
|
||||
*/
|
||||
|
||||
#if defined(NV_VM_OPS_FAULT_REMOVED_VMA_ARG)
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
|
||||
static int nv_drm_vma_fault(struct vm_fault *vmf)
|
||||
+#else
|
||||
+static vm_fault_t nv_drm_vma_fault(struct vm_fault *vmf)
|
||||
+#endif
|
||||
{
|
||||
return __nv_drm_vma_fault(vmf->vma, vmf);
|
||||
}
|
||||
diff --git a/kernel/nvidia-uvm/uvm8.c b/kernel/nvidia-uvm/uvm8.c
|
||||
index e00923d..2e01e3c 100644
|
||||
--- a/kernel/nvidia-uvm/uvm8.c
|
||||
+++ b/kernel/nvidia-uvm/uvm8.c
|
||||
@@ -172,7 +172,11 @@ static int uvm_vm_fault_sigbus(struct vm_area_struct *vma, struct vm_fault *vmf)
|
||||
return VM_FAULT_SIGBUS;
|
||||
}
|
||||
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
|
||||
static int uvm_vm_fault_sigbus_wrapper(struct vm_fault *vmf)
|
||||
+#else
|
||||
+static vm_fault_t uvm_vm_fault_sigbus_wrapper(struct vm_fault *vmf)
|
||||
+#endif
|
||||
{
|
||||
#if defined(NV_VM_OPS_FAULT_REMOVED_VMA_ARG)
|
||||
return uvm_vm_fault_sigbus(vmf->vma, vmf);
|
||||
@@ -507,7 +511,11 @@ convert_error:
|
||||
}
|
||||
}
|
||||
|
||||
+#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
|
||||
static int uvm_vm_fault_wrapper(struct vm_fault *vmf)
|
||||
+#else
|
||||
+static vm_fault_t uvm_vm_fault_wrapper(struct vm_fault *vmf)
|
||||
+#endif
|
||||
{
|
||||
#if defined(NV_VM_OPS_FAULT_REMOVED_VMA_ARG)
|
||||
return uvm_vm_fault(vmf->vma, vmf);
|
||||
@@ -15,12 +15,11 @@
|
||||
<Archive sha1sum="c99412df21d49cae64f2d13b27c70ac48ccb19d0" type="binary">http://http.download.nvidia.com/XFree86/Linux-x86_64/390.144/NVIDIA-Linux-x86_64-390.144.run</Archive>
|
||||
<AdditionalFiles>
|
||||
<AdditionalFile owner="root" permission="0644" target="dkms.conf">dkms.conf</AdditionalFile>
|
||||
<AdditionalFile owner="root" permission="0644" target="kernel-5.5.patch">NVIDIA-Linux-x86_64-390.132-kernel-5.5.patch</AdditionalFile>
|
||||
<AdditionalFile owner="root" permission="0644" target="kernel-5.8.patch">NVIDIA-Linux-390.138-x86_64-kernel-5.8.patch</AdditionalFile>
|
||||
<AdditionalFile owner="root" permission="0644" target="kernel-5.6-uvm.patch">NVIDIA-Linux-x86_64-390.132-kernel-5.6-uvm.patch</AdditionalFile>
|
||||
<AdditionalFile owner="root" permission="0644" target="kernel-5.14-pdev.patch">kernel-5.14-pdev.patch</AdditionalFile>
|
||||
<AdditionalFile owner="root" permission="0644" target="kernel-5.14-state.patch">kernel-5.14-state.patch</AdditionalFile>
|
||||
</AdditionalFiles>
|
||||
<BuildDependencies>
|
||||
<Dependency version="5.10.78">kernel-module-headers</Dependency>
|
||||
<Dependency version="5.15.1">kernel-module-headers</Dependency>
|
||||
<Dependency>libX11-devel</Dependency>
|
||||
<Dependency>gtk2-devel</Dependency>
|
||||
<Dependency>gtk3-devel</Dependency>
|
||||
@@ -32,7 +31,7 @@
|
||||
<IsA>driver</IsA>
|
||||
<Summary>Kernel module for current NVIDIA graphics driver releases</Summary>
|
||||
<RuntimeDependencies>
|
||||
<Dependency version="5.10.78">kernel</Dependency>
|
||||
<Dependency version="5.15.1">kernel</Dependency>
|
||||
<!-- <Dependency release="current">module-nvidia-current-userspace</Dependency> -->
|
||||
</RuntimeDependencies>
|
||||
<Files>
|
||||
@@ -196,7 +195,7 @@
|
||||
|
||||
<History>
|
||||
<Update release="20">
|
||||
<Date>2021-11-08</Date>
|
||||
<Date>2021-11-11</Date>
|
||||
<Version>390.144</Version>
|
||||
<Comment>Version bump.</Comment>
|
||||
<Name>Mustafa Cinasal</Name>
|
||||
|
||||
Reference in New Issue
Block a user