[packages/xorg-driver-video-nvidia-legacy-340xx] - fix patch for 4.11 - rel 3
baggins
baggins at pld-linux.org
Fri May 12 21:41:08 CEST 2017
commit dbc180853c8396761dd99ed7fdcde0c1a47dbd52
Author: Jan Rękorajski <baggins at pld-linux.org>
Date: Fri May 12 21:39:46 2017 +0200
- fix patch for 4.11
- rel 3
linux-4.11.patch | 86 +++++++++++++++++++-----------
xorg-driver-video-nvidia-legacy-340xx.spec | 2 +-
2 files changed, 55 insertions(+), 33 deletions(-)
---
diff --git a/xorg-driver-video-nvidia-legacy-340xx.spec b/xorg-driver-video-nvidia-legacy-340xx.spec
index 9de0c05..2f93828 100644
--- a/xorg-driver-video-nvidia-legacy-340xx.spec
+++ b/xorg-driver-video-nvidia-legacy-340xx.spec
@@ -25,7 +25,7 @@ exit 1
%define no_install_post_check_so 1
-%define rel 2
+%define rel 3
%define pname xorg-driver-video-nvidia-legacy-340xx
Summary: Linux Drivers for nVidia GeForce/Quadro Chips
Summary(hu.UTF-8): Linux meghajtók nVidia GeForce/Quadro chipekhez
diff --git a/linux-4.11.patch b/linux-4.11.patch
index a6b3fb0..d619a9e 100644
--- a/linux-4.11.patch
+++ b/linux-4.11.patch
@@ -13,7 +13,7 @@
#else
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
return get_user_pages_remote(tsk, mm, start, nr_pages, flags,
pages, vmas);
+#else
@@ -29,7 +29,7 @@
}
#if defined(NV_ENABLE_PAT_SUPPORT) && defined(NV_ENABLE_HOTPLUG_CPU)
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
static int
nvidia_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
{
@@ -72,7 +72,7 @@
#if defined(NV_ENABLE_PAT_SUPPORT) && defined(NV_ENABLE_HOTPLUG_CPU)
if (nv_pat_mode == NV_PAT_MODE_BUILTIN)
{
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
if (register_hotcpu_notifier(&nv_hotcpu_nfb) != 0)
+#else
+ if (cpuhp_setup_state(CPUHP_AP_ONLINE_DYN,
@@ -87,7 +87,7 @@
{
nv_disable_pat_support();
#if defined(NV_ENABLE_PAT_SUPPORT) && defined(NV_ENABLE_HOTPLUG_CPU)
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
unregister_hotcpu_notifier(&nv_hotcpu_nfb);
+#else
+ cpuhp_remove_state_nocalls(CPUHP_AP_ONLINE_DYN);
@@ -101,7 +101,7 @@
#if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)
{
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
unsigned long vaddr = (unsigned long)vmf->virtual_address;
+#else
+ unsigned long vaddr = (unsigned long)vmf->address;
@@ -111,87 +111,109 @@
--- kernel/nv-drm.c 2017-03-31 03:42:21.000000000 +0200
+++ kernel/nv-drm.c 2017-04-06 23:53:14.273356795 +0200
-@@ -48,7 +48,7 @@
+@@ -48,7 +48,11 @@
return -ENODEV;
}
--static int nv_drm_unload(
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
+ static int nv_drm_unload(
++#else
+static void nv_drm_unload(
++#endif
struct drm_device *dev
)
{
-@@ -60,7 +60,7 @@
+@@ -60,7 +60,11 @@
{
BUG_ON(nvl->drm != dev);
nvl->drm = NULL;
-- return 0;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
+ return 0;
++#else
+ return;
++#endif
}
}
-@@ -64,7 +64,7 @@
+@@ -64,7 +64,11 @@
}
}
-- return -ENODEV;
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
+ return -ENODEV;
++#else
+ return;
++#endif
}
static void nv_gem_free(
--- kernel/uvm/nvidia_uvm_linux.h 2017-03-31 03:42:21.000000000 +0200
+++ kernel/uvm/nvidia_uvm_linux.h 2017-04-06 23:53:14.273356795 +0200
-@@ -124,6 +124,7 @@
+@@ -124,6 +124,9 @@
#include <linux/delay.h> /* mdelay, udelay */
#include <linux/sched.h> /* suser(), capable() replacement */
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
+#include <linux/sched/signal.h>
++#endif
#include <linux/moduleparam.h> /* module_param() */
#if !defined(NV_VMWARE)
#include <asm/tlbflush.h> /* flush_tlb(), flush_tlb_all() */
-@@ -362,17 +363,6 @@
+@@ -362,17 +363,19 @@
void address_space_init_once(struct address_space *mapping);
#endif
--#if !defined(NV_FATAL_SIGNAL_PENDING_PRESENT)
-- static inline int __fatal_signal_pending(struct task_struct *p)
-- {
-- return unlikely(sigismember(&p->pending.signal, SIGKILL));
-- }
--
-- static inline int fatal_signal_pending(struct task_struct *p)
-- {
-- return signal_pending(p) && __fatal_signal_pending(p);
-- }
--#endif
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
+ #if !defined(NV_FATAL_SIGNAL_PENDING_PRESENT)
+ static inline int __fatal_signal_pending(struct task_struct *p)
+ {
+ return unlikely(sigismember(&p->pending.signal, SIGKILL));
+ }
+
+ static inline int fatal_signal_pending(struct task_struct *p)
+ {
+ return signal_pending(p) && __fatal_signal_pending(p);
+ }
+ #endif
++#endif
//
// Before the current->cred structure was introduced, current->euid,
--- kernel/uvm/nvidia_uvm_lite.c 2017-03-31 03:42:21.000000000 +0200
+++ kernel/uvm/nvidia_uvm_lite.c 2017-04-06 23:53:14.273356795 +0200
-@@ -818,7 +818,7 @@
+@@ -818,7 +818,11 @@
}
#if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
--int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)
++#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
{
unsigned long vaddr = (unsigned long)vmf->virtual_address;
struct page *page = NULL;
-@@ -828,7 +828,7 @@
+@@ -828,7 +828,11 @@
struct page *page = NULL;
int retval;
-- retval = _fault_common(vma, vaddr, &page, vmf->flags);
++#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 +866,7 @@
+@@ -866,7 +866,11 @@
// it's dealing with anonymous mapping (see handle_pte_fault).
//
#if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)
--int _sigbus_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
++#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;
@@ -201,11 +223,11 @@
};
static struct drm_driver nv_drm_driver = {
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)
+ .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,
\ No newline at end of file
+ .fops = &nv_drm_fops,
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/xorg-driver-video-nvidia-legacy-340xx.git/commitdiff/dbc180853c8396761dd99ed7fdcde0c1a47dbd52
More information about the pld-cvs-commit
mailing list