[packages/xorg-driver-video-nvidia-legacy-390xx] - fix building with kernel 5.1 - rel 2
baggins
baggins at pld-linux.org
Tue May 7 20:49:18 CEST 2019
commit 79331cf5ac6d20b8d084871e70269eaf27f60978
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Tue May 7 20:48:59 2019 +0200
- fix building with kernel 5.1
- rel 2
kernel-5.1.patch | 132 +++++++++++++++++++++++++++++
xorg-driver-video-nvidia-legacy-390xx.spec | 4 +-
2 files changed, 135 insertions(+), 1 deletion(-)
---
diff --git a/xorg-driver-video-nvidia-legacy-390xx.spec b/xorg-driver-video-nvidia-legacy-390xx.spec
index 6575009..d0784e6 100644
--- a/xorg-driver-video-nvidia-legacy-390xx.spec
+++ b/xorg-driver-video-nvidia-legacy-390xx.spec
@@ -33,7 +33,7 @@ exit 1
%define no_install_post_check_so 1
-%define rel 1
+%define rel 2
%define pname xorg-driver-video-nvidia-legacy-390xx
Summary: Linux Drivers for nVidia GeForce/Quadro Chips
Summary(hu.UTF-8): Linux meghajtók nVidia GeForce/Quadro chipekhez
@@ -55,6 +55,7 @@ Source4: 10-nvidia.conf
Source5: 10-nvidia-modules.conf
Patch0: X11-driver-nvidia-GL.patch
Patch1: X11-driver-nvidia-desktop.patch
+Patch2: kernel-5.1.patch
URL: http://www.nvidia.com/object/unix.html
BuildRequires: rpmbuild(macros) >= 1.701
%{?with_kernel:%{expand:%buildrequires_kernel kernel%%{_alt_kernel}-module-build >= 3:2.6.20.2}}
@@ -268,6 +269,7 @@ rm -rf NVIDIA-Linux-x86*-%{version}*
%endif
%patch0 -p1
%patch1 -p1
+%patch2 -p1
echo 'EXTRA_CFLAGS += -Wno-pointer-arith -Wno-sign-compare -Wno-unused' >> kernel/Makefile.kbuild
%build
diff --git a/kernel-5.1.patch b/kernel-5.1.patch
new file mode 100644
index 0000000..cc43612
--- /dev/null
+++ b/kernel-5.1.patch
@@ -0,0 +1,132 @@
+--- NVIDIA-Linux-x86_64-390.116-no-compat32/kernel/common/inc/nv-list-helpers.h~ 2019-01-27 17:12:19.000000000 +0100
++++ NVIDIA-Linux-x86_64-390.116-no-compat32/kernel/common/inc/nv-list-helpers.h 2019-05-07 19:39:34.895403211 +0200
+@@ -23,6 +23,7 @@
+ #ifndef __NV_LIST_HELPERS_H__
+ #define __NV_LIST_HELPERS_H__
+
++#include <linux/version.h>
+ #include <linux/list.h>
+ #include "conftest.h"
+
+@@ -91,10 +91,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__
+--- NVIDIA-Linux-x86_64-390.116-no-compat32/kernel/nvidia-uvm/uvm8.c.orig 2019-01-27 17:12:22.000000000 +0100
++++ NVIDIA-Linux-x86_64-390.116-no-compat32/kernel/nvidia-uvm/uvm8.c 2019-05-07 20:36:42.676844249 +0200
+@@ -166,13 +166,21 @@
+ // If a fault handler is not set, paths like handle_pte_fault in older kernels
+ // assume the memory is anonymous. That would make debugging this failure harder
+ // so we force it to fail instead.
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
++static vm_fault_t uvm_vm_fault_sigbus(struct vm_area_struct *vma, struct vm_fault *vmf)
++#else
+ static int uvm_vm_fault_sigbus(struct vm_area_struct *vma, struct vm_fault *vmf)
++#endif
+ {
+ UVM_DBG_PRINT_RL("Fault to address 0x%lx in disabled vma\n", nv_page_fault_va(vmf));
+ return VM_FAULT_SIGBUS;
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
++static vm_fault_t uvm_vm_fault_sigbus_wrapper(struct vm_fault *vmf)
++#else
+ static int 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 +515,11 @@
+ }
+ }
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
++static vm_fault_t uvm_vm_fault_wrapper(struct vm_fault *vmf)
++#else
+ static int 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);
+--- NVIDIA-Linux-x86_64-390.116-no-compat32/kernel/nvidia-drm/nvidia-drm-drv.c.orig 2019-01-27 17:12:27.000000000 +0100
++++ NVIDIA-Linux-x86_64-390.116-no-compat32/kernel/nvidia-drm/nvidia-drm-drv.c 2019-05-07 20:39:24.748960946 +0200
+@@ -55,6 +55,11 @@
+ #include <drm/drm_atomic_helper.h>
+ #endif
+
++#include <linux/version.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
++#include <drm/drm_probe_helper.h>
++#endif
++
+ static struct nv_drm_device *dev_list = NULL;
+
+ #if defined(NV_DRM_ATOMIC_MODESET_AVAILABLE)
+--- NVIDIA-Linux-x86_64-390.116-no-compat32/kernel/nvidia-drm/nvidia-drm-encoder.c~ 2019-01-27 17:12:27.000000000 +0100
++++ NVIDIA-Linux-x86_64-390.116-no-compat32/kernel/nvidia-drm/nvidia-drm-encoder.c 2019-05-07 20:42:06.361103325 +0200
+@@ -36,6 +36,11 @@
+ #include <drm/drm_atomic.h>
+ #include <drm/drm_atomic_helper.h>
+
++#include <linux/version.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
++#include <drm/drm_probe_helper.h>
++#endif
++
+ static void nv_drm_encoder_destroy(struct drm_encoder *encoder)
+ {
+ struct nv_drm_encoder *nv_encoder = to_nv_encoder(encoder);
+--- NVIDIA-Linux-x86_64-390.116-no-compat32/kernel/nvidia-drm/nvidia-drm-connector.c~ 2019-01-27 17:12:27.000000000 +0100
++++ NVIDIA-Linux-x86_64-390.116-no-compat32/kernel/nvidia-drm/nvidia-drm-connector.c 2019-05-07 20:43:20.487229513 +0200
+@@ -35,6 +35,11 @@
+ #include <drm/drm_atomic.h>
+ #include <drm/drm_atomic_helper.h>
+
++#include <linux/version.h>
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
++#include <drm/drm_probe_helper.h>
++#endif
++
+ static void nv_drm_connector_destroy(struct drm_connector *connector)
+ {
+ struct nv_drm_connector *nv_connector = to_nv_connector(connector);
+--- NVIDIA-Linux-x86_64-390.116-no-compat32/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c~ 2019-01-27 17:12:27.000000000 +0100
++++ NVIDIA-Linux-x86_64-390.116-no-compat32/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c 2019-05-07 20:45:43.466195062 +0200
+@@ -19,6 +19,7 @@
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
++#include <linux/version.h>
+
+ #include "nvidia-drm-conftest.h"
+
+@@ -268,12 +268,20 @@
+ */
+
+ #if defined(NV_VM_OPS_FAULT_REMOVED_VMA_ARG)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
++static vm_fault_t nv_drm_vma_fault(struct vm_fault *vmf)
++#else
+ static int nv_drm_vma_fault(struct vm_fault *vmf)
++#endif
+ {
+ return __nv_drm_vma_fault(vmf->vma, vmf);
+ }
+ #else
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 1, 0)
++static vm_fault_t nv_drm_vma_fault(struct vm_area_struct *vma,
++#else
+ static int nv_drm_vma_fault(struct vm_area_struct *vma,
++#endif
+ struct vm_fault *vmf)
+ {
+ return __nv_drm_vma_fault(vma, vmf);
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/xorg-driver-video-nvidia-legacy-390xx.git/commitdiff/79331cf5ac6d20b8d084871e70269eaf27f60978
More information about the pld-cvs-commit
mailing list