commit 69a4ccf6405f881e8cad21ab239d2d240ca103fb
Author: leigh123linux <leigh123linux(a)googlemail.com>
Date: Fri May 3 15:46:51 2019 +0100
Patch for 5.1rc kernel
kernel-5.1.patch | 162 +++++++++++++++++++++++++++++++++++++++++++++++++
nv-linux-arm.patch | 7 +--
nv-linux-arm2.patch | 7 +--
nvidia-390xx-kmod.spec | 7 ++-
4 files changed, 174 insertions(+), 9 deletions(-)
---
diff --git a/kernel-5.1.patch b/kernel-5.1.patch
new file mode 100644
index 0000000..d1f6a63
--- /dev/null
+++ b/kernel-5.1.patch
@@ -0,0 +1,162 @@
+--- 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_
+ */
+
+ #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);
+ }
+--- a/kernel/nvidia-drm/nvidia-drm-connector.c
++++ b/kernel/nvidia-drm/nvidia-drm-connector.c
+@@ -35,6 +35,8 @@
+ #include <drm/drm_atomic.h>
+ #include <drm/drm_atomic_helper.h>
+
++#include <linux/version.h>
++
+ static void nv_drm_connector_destroy(struct drm_connector *connector)
+ {
+ struct nv_drm_connector *nv_connector = to_nv_connector(connector);
+@@ -201,6 +203,12 @@ nv_drm_connector_detect(struct drm_conne
+ return __nv_drm_connector_detect_internal(connector);
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
++int drm_helper_probe_single_connector_modes(struct drm_connector
++ *connector, uint32_t maxX,
++ uint32_t maxY);
++#endif
++
+ static struct drm_connector_funcs nv_connector_funcs = {
+ #if defined NV_DRM_ATOMIC_HELPER_CONNECTOR_DPMS_PRESENT
+ .dpms = drm_atomic_helper_connector_dpms,
+--- a/kernel/nvidia-drm/nvidia-drm-encoder.c
++++ b/kernel/nvidia-drm/nvidia-drm-encoder.c
+@@ -36,6 +36,12 @@
+ #include <drm/drm_atomic.h>
+ #include <drm/drm_atomic_helper.h>
+
++#include <linux/version.h>
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
++void drm_kms_helper_hotplug_event(struct drm_device *dev);
++#endif
++
+ static void nv_drm_encoder_destroy(struct drm_encoder *encoder)
+ {
+ struct nv_drm_encoder *nv_encoder = to_nv_encoder(encoder);
+@@ -152,6 +158,12 @@ nv_drm_encoder_new(struct drm_device *de
+ return &nv_encoder->base;
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
++int drm_helper_probe_single_connector_modes(struct drm_connector
++ *connector, uint32_t maxX,
++ uint32_t maxY);
++#endif
++
+ /*
+ * Add encoder for given NvKmsKapiDisplay
+ */
+--- a/kernel/nvidia-drm/nvidia-drm-drv.c
++++ b/kernel/nvidia-drm/nvidia-drm-drv.c
+@@ -35,6 +35,15 @@
+ #include "nvidia-drm-gem-nvkms-memory.h"
+ #include "nvidia-drm-gem-user-memory.h"
+
++#include <linux/version.h>
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
++void drm_kms_helper_poll_init(struct drm_device *dev);
++void drm_kms_helper_poll_fini(struct drm_device *dev);
++bool drm_helper_hpd_irq_event(struct drm_device *dev);
++void drm_kms_helper_poll_disable(struct drm_device *dev);
++#endif
++
+ #if defined(NV_DRM_AVAILABLE)
+
+ #include "nvidia-drm-ioctl.h"
+--- a/kernel/common/inc/nv-list-helpers.h
++++ b/kernel/common/inc/nv-list-helpers.h
+@@ -23,6 +23,8 @@
+ #ifndef __NV_LIST_HELPERS_H__
+ #define __NV_LIST_HELPERS_H__
+
++#include <linux/version.h>
++
+ #include <linux/list.h>
+ #include "conftest.h"
+
+@@ -91,8 +91,13 @@
+ 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)
++#else
++static inline int nv_list_is_first(const struct list_head *list,
++ const struct list_head *head)
++#endif
+ {
+ return list->prev == head;
+ }
+--- a/kernel/nvidia-uvm/uvm8.c
++++ b/kernel/nvidia-uvm/uvm8.c
+@@ -172,7 +172,11 @@ static int uvm_vm_fault_sigbus(struct vm
+ 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);
+--- a/kernel/nvidia-uvm/uvm8_range_tree.c
++++ b/kernel/nvidia-uvm/uvm8_range_tree.c
+@@ -31,9 +31,15 @@ static uvm_range_tree_node_t *get_range_node(struct rb_node *rb_node)
+
+ uvm_range_tree_node_t *uvm_range_tree_prev(uvm_range_tree_t *tree, uvm_range_tree_node_t
*node)
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
+ if (list_is_first(&node->list, &tree->head))
+ return NULL;
+ return list_prev_entry(node, list);
++#else
++ if (nv_list_is_first(&node->list, &tree->head))
++ return NULL;
++ return list_prev_entry(node, list);
++#endif
+ }
+
+ uvm_range_tree_node_t *uvm_range_tree_next(uvm_range_tree_t *tree, uvm_range_tree_node_t
*node)
diff --git a/nv-linux-arm.patch b/nv-linux-arm.patch
index fe5ff1e..f3d24bc 100644
--- a/nv-linux-arm.patch
+++ b/nv-linux-arm.patch
@@ -1,7 +1,6 @@
-diff -up nvidiapkg-armv7hl/kernel/common/inc/nv-linux.h.arm
nvidiapkg-armv7hl/kernel/common/inc/nv-linux.h
---- nvidiapkg-armv7hl/kernel/common/inc/nv-linux.h.arm 2015-01-11 04:30:46.000000000
+0000
-+++ nvidiapkg-armv7hl/kernel/common/inc/nv-linux.h 2015-01-16 23:20:16.785229307 +0000
-@@ -260,7 +260,8 @@ NV_STATUS nvos_forward_error_to_cray(str
+--- a/kernel/common/inc/nv-linux.h
++++ b/kernel/common/inc/nv-linux.h
+@@ -281,7 +281,8 @@ NV_STATUS nvos_forward_error_to_cray(str
* NVIDIA graphics driver has no way of knowing and is unlikely
* to work correctly.
*/
diff --git a/nv-linux-arm2.patch b/nv-linux-arm2.patch
index 6c717bf..d5593e8 100644
--- a/nv-linux-arm2.patch
+++ b/nv-linux-arm2.patch
@@ -1,7 +1,6 @@
-diff -up nvidiapkg-armv7hl/kernel/common/inc/nv-linux.h.swf
nvidiapkg-armv7hl/kernel/common/inc/nv-linux.h
---- nvidiapkg-armv7hl/kernel/common/inc/nv-linux.h.swf 2015-07-22 02:40:54.000000000
+0200
-+++ nvidiapkg-armv7hl/kernel/common/inc/nv-linux.h 2015-07-29 14:07:14.866367595 +0200
-@@ -156,7 +156,7 @@ static inline uid_t __kuid_val(kuid_t ui
+--- a/kernel/common/inc/nv-linux.h
++++ b/kernel/common/inc/nv-linux.h
+@@ -178,7 +178,7 @@ static inline uid_t __kuid_val(kuid_t ui
#include <linux/dma-mapping.h>
#endif
diff --git a/nvidia-390xx-kmod.spec b/nvidia-390xx-kmod.spec
index cc4c664..aa59a3d 100644
--- a/nvidia-390xx-kmod.spec
+++ b/nvidia-390xx-kmod.spec
@@ -10,7 +10,7 @@ Name: nvidia-390xx-kmod
Epoch: 3
Version: 390.116
# Taken over by kmodtool
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: NVIDIA 390xx display driver kernel module
Group: System Environment/Kernel
License: Redistributable, no modification permitted
@@ -19,6 +19,7 @@ URL:
http://www.nvidia.com/
Source11: nvidia-390xx-kmodtool-excludekernel-filterfile
Patch0: nv-linux-arm.patch
Patch1: nv-linux-arm2.patch
+Patch2: kernel-5.1.patch
# needed for plague to make sure it builds for i586 and i686
ExclusiveArch: i686 x86_64 armv7hl
@@ -44,6 +45,7 @@ tar --use-compress-program xz -xf
%{_datadir}/%{name}-%{version}/%{name}-%{versi
# patch loop
%patch0 -p1
%patch1 -p1
+%patch2 -p1
for kernel_version in %{?kernel_versions} ; do
cp -a kernel _kmod_build_${kernel_version%%___*}
@@ -71,6 +73,9 @@ done
%changelog
+* Fri May 03 2019 Leigh Scott <leigh123linux(a)googlemail.com> - 3:390.116-3
+- Patch for 5.1rc kernel
+
* Tue Mar 05 2019 RPM Fusion Release Engineering <leigh123linux(a)gmail.com> -
3:390.116-2
- Rebuilt for
https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild