- removed obsolete patches auto/th/xorg-driver-video-nvidia-legacy-340xx-340.104-1
authorJan Rękorajski <baggins@pld-linux.org>
Thu, 16 Nov 2017 20:09:46 +0000 (21:09 +0100)
committerJan Rękorajski <baggins@pld-linux.org>
Thu, 16 Nov 2017 20:09:46 +0000 (21:09 +0100)
- fixed build fix kernel 4.14
- rel 1

kernel-4.14.patch [new file with mode: 0644]
linux-4.10.patch [deleted file]
linux-4.11.patch [deleted file]
linux-4.12.patch [deleted file]
xorg-driver-video-nvidia-legacy-340xx.spec

diff --git a/kernel-4.14.patch b/kernel-4.14.patch
new file mode 100644 (file)
index 0000000..9aae52c
--- /dev/null
@@ -0,0 +1,37 @@
+From 5c9e8a994fe8529388ab159e0aa371c75bc3d17b Mon Sep 17 00:00:00 2001
+From: MilhouseVH <milhouseVH.github@nmacleod.com>
+Date: Thu, 21 Sep 2017 04:22:12 +0100
+Subject: [PATCH] drm/pci: drm_pci_init/exit now deprecated
+
+As per: https://github.com/torvalds/linux/commit/10631d724deff712343d96dd3017cd323349f761
+
+Use legacy variant, as pci_[un]register_driver currently fails.
+---
+ kernel/nv-drm.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/kernel/nv-drm.c b/kernel/nv-drm.c
+index 2aa7cc8..23df996 100644
+--- a/kernel/nv-drm.c
++++ b/kernel/nv-drm.c
+@@ -173,7 +173,7 @@ int __init nv_drm_init(
+ {
+     int ret = 0;
+ #if defined(NV_DRM_AVAILABLE)
+-    ret = drm_pci_init(&nv_drm_driver, pci_driver);
++    ret = drm_legacy_pci_init(&nv_drm_driver, pci_driver);
+ #endif
+     return ret;
+ }
+@@ -183,7 +183,7 @@ void nv_drm_exit(
+ )
+ {
+ #if defined(NV_DRM_AVAILABLE)
+-    drm_pci_exit(&nv_drm_driver, pci_driver);
++    drm_legacy_pci_exit(&nv_drm_driver, pci_driver);
+ #endif
+ }
+-- 
+2.7.4
+
diff --git a/linux-4.10.patch b/linux-4.10.patch
deleted file mode 100644 (file)
index 76f5274..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-diff --git a/kernel/nv-linux.h b/kernel/nv-linux.h
-index e7068e3..3ac3c0b 100644
---- a/kernel/nv-linux.h
-+++ b/kernel/nv-linux.h
-@@ -270,7 +270,7 @@ RM_STATUS nvos_forward_error_to_cray(struct pci_dev *, NvU32,
- extern int nv_pat_mode;
--#if !defined(NV_VMWARE) && defined(CONFIG_HOTPLUG_CPU)
-+#if !defined(NV_VMWARE) && defined(CONFIG_HOTPLUG_CPU) && (LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0))
- #define NV_ENABLE_HOTPLUG_CPU
- #include <linux/cpu.h>              /* CPU hotplug support              */
- #include <linux/notifier.h>         /* struct notifier_block, etc       */
-diff --git a/kernel/nv-pat.c b/kernel/nv-pat.c
-index a725533..91070e0 100644
---- a/kernel/nv-pat.c
-+++ b/kernel/nv-pat.c
-@@ -210,14 +210,20 @@ nvidia_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu
-     switch (action)
-     {
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
-         case CPU_DOWN_FAILED:
-+#endif
-         case CPU_ONLINE:
-             if (cpu == (NvUPtr)hcpu)
-                 nv_setup_pat_entries(NULL);
-             else
-                 NV_SMP_CALL_FUNCTION(nv_setup_pat_entries, hcpu, 1);
-             break;
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 0)
-         case CPU_DOWN_PREPARE:
-+#else
-+        case CPU_DOWN_PREPARE_FROZEN:
-+#endif
-             if (cpu == (NvUPtr)hcpu)
-                 nv_restore_pat_entries(NULL);
-             else
diff --git a/linux-4.11.patch b/linux-4.11.patch
deleted file mode 100644 (file)
index d619a9e..0000000
+++ /dev/null
@@ -1,233 +0,0 @@
---- kernel/nv-linux.h\r
-+++ kernel/nv-linux.h\r
-@@ -2082,6 +2082,8 @@ static inline NvU64 nv_node_end_pfn(int nid)\r
-  *    2016 Dec 14:5b56d49fc31dbb0487e14ead790fc81ca9fb2c99\r
-  */\r
-\r
-+#include <linux/version.h>\r
-+\r
- #if defined(NV_GET_USER_PAGES_REMOTE_PRESENT)\r
-     #if defined(NV_GET_USER_PAGES_HAS_WRITE_AND_FORCE_ARGS)\r
-         #define NV_GET_USER_PAGES           get_user_pages\r
-@@ -2129,8 +2131,13 @@ static inline NvU64 nv_node_end_pfn(int nid)\r
-\r
-         #else\r
-\r
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)\r
-                return get_user_pages_remote(tsk, mm, start, nr_pages, flags,\r
-                                             pages, vmas);\r
-+#else\r
-+               return get_user_pages_remote(tsk, mm, start, nr_pages, flags,\r
-+                                            pages, vmas, NULL);\r
-+#endif\r
-\r
-         #endif\r
-\r
---- kernel/nv-pat.c\r
-+++ kernel/nv-pat.c\r
-@@ -203,6 +203,7 @@ void nv_disable_pat_support(void)\r
- }\r
-\r
- #if defined(NV_ENABLE_PAT_SUPPORT) && defined(NV_ENABLE_HOTPLUG_CPU)\r
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)\r
- static int\r
- nvidia_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)\r
- {\r
-@@ -234,6 +235,34 @@ static struct notifier_block nv_hotcpu_nfb = {\r
-     .notifier_call = nvidia_cpu_callback,\r
-     .priority = 0\r
- };\r
-+#else\r
-+static int nvidia_cpu_online(unsigned int hcpu)\r
-+{\r
-+    unsigned int cpu = get_cpu();\r
-+    if (cpu == hcpu)\r
-+        nv_setup_pat_entries(NULL);\r
-+    else\r
-+        NV_SMP_CALL_FUNCTION(nv_setup_pat_entries, (void *)(long int)hcpu, 1);\r
-+\r
-+    put_cpu();\r
-+\r
-+    return 0;\r
-+}\r
-+\r
-+static int nvidia_cpu_down_prep(unsigned int hcpu)\r
-+{\r
-+    unsigned int cpu = get_cpu();\r
-+    if (cpu == hcpu)\r
-+        nv_restore_pat_entries(NULL);\r
-+    else\r
-+        NV_SMP_CALL_FUNCTION(nv_restore_pat_entries, (void *)(long int)hcpu, 1);\r
-+\r
-+    put_cpu();\r
-+\r
-+    return 0;\r
-+}\r
-+#endif\r
-+\r
- #endif\r
-\r
- int nv_init_pat_support(nv_stack_t *sp)\r
-@@ -255,7 +284,14 @@ int nv_init_pat_support(nv_stack_t *sp)\r
- #if defined(NV_ENABLE_PAT_SUPPORT) && defined(NV_ENABLE_HOTPLUG_CPU)\r
-         if (nv_pat_mode == NV_PAT_MODE_BUILTIN)\r
-         {\r
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)\r
-             if (register_hotcpu_notifier(&nv_hotcpu_nfb) != 0)\r
-+#else\r
-+            if (cpuhp_setup_state(CPUHP_AP_ONLINE_DYN,\r
-+                                  "gpu/nvidia:online",\r
-+                                  nvidia_cpu_online,\r
-+                                  nvidia_cpu_down_prep) != 0)\r
-+#endif\r
-             {\r
-                 nv_disable_pat_support();\r
-                 nv_printf(NV_DBG_ERRORS,\r
-@@ -280,7 +316,11 @@ void nv_teardown_pat_support(void)\r
-     {\r
-         nv_disable_pat_support();\r
- #if defined(NV_ENABLE_PAT_SUPPORT) && defined(NV_ENABLE_HOTPLUG_CPU)\r
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)\r
-         unregister_hotcpu_notifier(&nv_hotcpu_nfb);\r
-+#else\r
-+        cpuhp_remove_state_nocalls(CPUHP_AP_ONLINE_DYN);\r
-+#endif\r
- #endif\r
-     }\r
- }\r
---- kernel/uvm/nvidia_uvm_lite.c\r
-+++ kernel/uvm/nvidia_uvm_lite.c\r
-@@ -820,7 +820,11 @@ done:\r
- #if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)\r
- int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)\r
- {\r
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)\r
-     unsigned long vaddr = (unsigned long)vmf->virtual_address;\r
-+#else\r
-+    unsigned long vaddr = (unsigned long)vmf->address;\r
-+#endif\r
-     struct page *page = NULL;\r
-     int retval;\r
-\r
---- kernel/nv-drm.c    2017-03-31 03:42:21.000000000 +0200\r
-+++ kernel/nv-drm.c    2017-04-06 23:53:14.273356795 +0200\r
-@@ -48,7 +48,11 @@\r
-     return -ENODEV;\r
- }\r
-\r
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)\r
- static int nv_drm_unload(\r
-+#else\r
-+static void nv_drm_unload(\r
-+#endif\r
-     struct drm_device *dev\r
- )\r
- {\r
-@@ -60,7 +60,11 @@\r
-         {\r
-             BUG_ON(nvl->drm != dev);\r
-             nvl->drm = NULL;\r
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)\r
-             return 0;\r
-+#else\r
-+            return;\r
-+#endif\r
-         }\r
-     }\r
-\r
-@@ -64,7 +64,11 @@\r
-         }\r
-     }\r
-\r
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)\r
-     return -ENODEV;\r
-+#else\r
-+    return;\r
-+#endif\r
- }\r
-\r
- static void nv_gem_free(\r
---- kernel/uvm/nvidia_uvm_linux.h  2017-03-31 03:42:21.000000000 +0200\r
-+++ kernel/uvm/nvidia_uvm_linux.h  2017-04-06 23:53:14.273356795 +0200\r
-@@ -124,6 +124,9 @@\r
- #include <linux/delay.h>            /* mdelay, udelay                   */\r
-\r
- #include <linux/sched.h>            /* suser(), capable() replacement   */\r
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)\r
-+#include <linux/sched/signal.h>\r
-+#endif\r
- #include <linux/moduleparam.h>      /* module_param()                   */\r
- #if !defined(NV_VMWARE)\r
- #include <asm/tlbflush.h>           /* flush_tlb(), flush_tlb_all()     */\r
-@@ -362,17 +363,19 @@\r
-     void address_space_init_once(struct address_space *mapping);\r
- #endif\r
-\r
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)\r
- #if !defined(NV_FATAL_SIGNAL_PENDING_PRESENT)\r
-     static inline int __fatal_signal_pending(struct task_struct *p)\r
-     {\r
-         return unlikely(sigismember(&p->pending.signal, SIGKILL));\r
-     }\r
\r
-     static inline int fatal_signal_pending(struct task_struct *p)\r
-     {\r
-         return signal_pending(p) && __fatal_signal_pending(p);\r
-     }\r
- #endif\r
-+#endif\r
-\r
- //\r
- // Before the current->cred structure was introduced, current->euid,\r
---- kernel/uvm/nvidia_uvm_lite.c  2017-03-31 03:42:21.000000000 +0200\r
-+++ kernel/uvm/nvidia_uvm_lite.c  2017-04-06 23:53:14.273356795 +0200\r
-@@ -818,7 +818,11 @@\r
- }\r
-\r
- #if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)\r
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)\r
- int _fault(struct vm_area_struct *vma, struct vm_fault *vmf)\r
-+#else\r
-+int _fault(struct vm_fault *vmf)\r
-+#endif\r
- {\r
-     unsigned long vaddr = (unsigned long)vmf->virtual_address;\r
-     struct page *page = NULL;\r
-@@ -828,7 +828,11 @@\r
-     struct page *page = NULL;\r
-     int retval;\r
-\r
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)\r
-     retval = _fault_common(vma, vaddr, &page, vmf->flags);\r
-+#else\r
-+    retval = _fault_common(NULL, vaddr, &page, vmf->flags);\r
-+#endif\r
-\r
-     vmf->page = page;\r
-\r
-@@ -866,7 +866,11 @@\r
- // it's dealing with anonymous mapping (see handle_pte_fault).\r
- //\r
- #if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT)\r
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)\r
- int _sigbus_fault(struct vm_area_struct *vma, struct vm_fault *vmf)\r
-+#else\r
-+int _sigbus_fault(struct vm_fault *vmf)\r
-+#endif\r
- {\r
-     vmf->page = NULL;\r
-     return VM_FAULT_SIGBUS;\r
---- kernel/nv-drm.c\r
-+++ kernel/nv-drm.c\r
-@@ -115,7 +115,11 @@ static const struct file_operations nv_drm_fops = {\r
- };\r
-\r
- static struct drm_driver nv_drm_driver = {\r
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)\r
-+    .driver_features = DRIVER_GEM | DRIVER_PRIME | DRIVER_LEGACY,\r
-+#else\r
-     .driver_features = DRIVER_GEM | DRIVER_PRIME,\r
-+#endif\r
-     .load = nv_drm_load,\r
-     .unload = nv_drm_unload,\r
-     .fops = &nv_drm_fops,\r
diff --git a/linux-4.12.patch b/linux-4.12.patch
deleted file mode 100644 (file)
index 87c50d6..0000000
+++ /dev/null
@@ -1,95 +0,0 @@
---- kernel/conftest.sh.orig    2017-07-04 19:34:18.849964147 +0200
-+++ kernel/conftest.sh 2017-07-04 19:40:00.084349448 +0200
-@@ -362,7 +362,11 @@
-             # Determine if the set_memory_uc() function is present.
-             #
-             CODE="
--            #include <asm/cacheflush.h>
-+            #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
-+                #include <asm/set_memory.h>
-+            #else
-+                #include <asm/cacheflush.h>
-+            #endif
-             void conftest_set_memory_uc(void) {
-                 set_memory_uc();
-             }"
-@@ -375,7 +379,11 @@
-             # Determine if the set_memory_array_uc() function is present.
-             #
-             CODE="
--            #include <asm/cacheflush.h>
-+            #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
-+                #include <asm/set_memory.h>
-+            #else
-+                #include <asm/cacheflush.h>
-+            #endif
-             void conftest_set_memory_array_uc(void) {
-                 set_memory_array_uc();
-             }"
-@@ -388,7 +396,11 @@
-             # Determine if the set_pages_uc() function is present.
-             #
-             CODE="
--            #include <asm/cacheflush.h>
-+            #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
-+                #include <asm/set_memory.h>
-+            #else
-+                #include <asm/cacheflush.h>
-+            #endif
-             void conftest_set_pages_uc(void) {
-                 set_pages_uc();
-             }"
---- kernel/uvm/conftest.sh.orig        2017-07-04 19:41:43.317660686 +0200
-+++ kernel/uvm/conftest.sh     2017-07-04 19:40:23.248644401 +0200
-@@ -362,7 +362,11 @@
-             # Determine if the set_memory_uc() function is present.
-             #
-             CODE="
--            #include <asm/cacheflush.h>
-+            #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
-+                #include <asm/set_memory.h>
-+            #else
-+                #include <asm/cacheflush.h>
-+            #endif
-             void conftest_set_memory_uc(void) {
-                 set_memory_uc();
-             }"
-@@ -375,7 +379,11 @@
-             # Determine if the set_memory_array_uc() function is present.
-             #
-             CODE="
--            #include <asm/cacheflush.h>
-+            #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
-+                #include <asm/set_memory.h>
-+            #else
-+                #include <asm/cacheflush.h>
-+            #endif
-             void conftest_set_memory_array_uc(void) {
-                 set_memory_array_uc();
-             }"
-@@ -388,7 +396,11 @@
-             # Determine if the set_pages_uc() function is present.
-             #
-             CODE="
--            #include <asm/cacheflush.h>
-+            #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
-+                #include <asm/set_memory.h>
-+            #else
-+                #include <asm/cacheflush.h>
-+            #endif
-             void conftest_set_pages_uc(void) {
-                 set_pages_uc();
-             }"
---- kernel/nv-vm.c.orig        2017-07-04 20:01:37.098802679 +0200
-+++ kernel/nv-vm.c     2017-07-04 20:02:23.720384972 +0200
-@@ -13,6 +13,10 @@
- #include "nv.h"
- #include "nv-linux.h"
-+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
-+    #include <asm/set_memory.h>
-+#endif
-+
- static inline void nv_set_contig_memory_uc(nv_pte_t *page_ptr, NvU32 num_pages)
- {
-     if (nv_update_memory_types)
index b03832e..fa77778 100644 (file)
@@ -25,7 +25,7 @@ exit 1
 
 %define                no_install_post_check_so 1
 
-%define                rel     0.1
+%define                rel     1
 %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
@@ -48,9 +48,7 @@ Source5:      10-nvidia-modules.conf
 Patch0:                X11-driver-nvidia-GL.patch
 Patch1:                X11-driver-nvidia-desktop.patch
 Patch2:                linux-4.0.patch
-Patch3:                linux-4.10.patch
-Patch4:                linux-4.11.patch
-Patch5:                linux-4.12.patch
+Patch3:                kernel-4.14.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}}
@@ -254,8 +252,6 @@ rm -rf NVIDIA-Linux-x86*-%{version}*
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
-%patch4 -p0
-%patch5 -p0
 echo 'EXTRA_CFLAGS += -Wno-pointer-arith -Wno-sign-compare -Wno-unused' >> kernel/Makefile.kbuild
 
 %build
This page took 0.320214 seconds and 4 git commands to generate.