From 370863e5a6091fbc1f6181f3f59cce2b86047070 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20R=C4=99korajski?= Date: Thu, 16 Nov 2017 21:09:46 +0100 Subject: [PATCH] - removed obsolete patches - fixed build fix kernel 4.14 - rel 1 --- kernel-4.14.patch | 37 ++++ linux-4.10.patch | 38 ---- linux-4.11.patch | 233 --------------------- linux-4.12.patch | 95 --------- xorg-driver-video-nvidia-legacy-340xx.spec | 8 +- 5 files changed, 39 insertions(+), 372 deletions(-) create mode 100644 kernel-4.14.patch delete mode 100644 linux-4.10.patch delete mode 100644 linux-4.11.patch delete mode 100644 linux-4.12.patch diff --git a/kernel-4.14.patch b/kernel-4.14.patch new file mode 100644 index 0000000..9aae52c --- /dev/null +++ b/kernel-4.14.patch @@ -0,0 +1,37 @@ +From 5c9e8a994fe8529388ab159e0aa371c75bc3d17b Mon Sep 17 00:00:00 2001 +From: MilhouseVH +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 index 76f5274..0000000 --- a/linux-4.10.patch +++ /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 /* CPU hotplug support */ - #include /* 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 index d619a9e..0000000 --- a/linux-4.11.patch +++ /dev/null @@ -1,233 +0,0 @@ ---- kernel/nv-linux.h -+++ kernel/nv-linux.h -@@ -2082,6 +2082,8 @@ static inline NvU64 nv_node_end_pfn(int nid) - * 2016 Dec 14:5b56d49fc31dbb0487e14ead790fc81ca9fb2c99 - */ - -+#include -+ - #if defined(NV_GET_USER_PAGES_REMOTE_PRESENT) - #if defined(NV_GET_USER_PAGES_HAS_WRITE_AND_FORCE_ARGS) - #define NV_GET_USER_PAGES get_user_pages -@@ -2129,8 +2131,13 @@ static inline NvU64 nv_node_end_pfn(int nid) - - #else - -+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) - return get_user_pages_remote(tsk, mm, start, nr_pages, flags, - pages, vmas); -+#else -+ return get_user_pages_remote(tsk, mm, start, nr_pages, flags, -+ pages, vmas, NULL); -+#endif - - #endif - ---- kernel/nv-pat.c -+++ kernel/nv-pat.c -@@ -203,6 +203,7 @@ void nv_disable_pat_support(void) - } - - #if defined(NV_ENABLE_PAT_SUPPORT) && defined(NV_ENABLE_HOTPLUG_CPU) -+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) - static int - nvidia_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu) - { -@@ -234,6 +235,34 @@ static struct notifier_block nv_hotcpu_nfb = { - .notifier_call = nvidia_cpu_callback, - .priority = 0 - }; -+#else -+static int nvidia_cpu_online(unsigned int hcpu) -+{ -+ unsigned int cpu = get_cpu(); -+ if (cpu == hcpu) -+ nv_setup_pat_entries(NULL); -+ else -+ NV_SMP_CALL_FUNCTION(nv_setup_pat_entries, (void *)(long int)hcpu, 1); -+ -+ put_cpu(); -+ -+ return 0; -+} -+ -+static int nvidia_cpu_down_prep(unsigned int hcpu) -+{ -+ unsigned int cpu = get_cpu(); -+ if (cpu == hcpu) -+ nv_restore_pat_entries(NULL); -+ else -+ NV_SMP_CALL_FUNCTION(nv_restore_pat_entries, (void *)(long int)hcpu, 1); -+ -+ put_cpu(); -+ -+ return 0; -+} -+#endif -+ - #endif - - int nv_init_pat_support(nv_stack_t *sp) -@@ -255,7 +284,14 @@ int nv_init_pat_support(nv_stack_t *sp) - #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, 11, 0) - if (register_hotcpu_notifier(&nv_hotcpu_nfb) != 0) -+#else -+ if (cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, -+ "gpu/nvidia:online", -+ nvidia_cpu_online, -+ nvidia_cpu_down_prep) != 0) -+#endif - { - nv_disable_pat_support(); - nv_printf(NV_DBG_ERRORS, -@@ -280,7 +316,11 @@ void nv_teardown_pat_support(void) - { - nv_disable_pat_support(); - #if defined(NV_ENABLE_PAT_SUPPORT) && defined(NV_ENABLE_HOTPLUG_CPU) -+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) - unregister_hotcpu_notifier(&nv_hotcpu_nfb); -+#else -+ cpuhp_remove_state_nocalls(CPUHP_AP_ONLINE_DYN); -+#endif - #endif - } - } ---- kernel/uvm/nvidia_uvm_lite.c -+++ kernel/uvm/nvidia_uvm_lite.c -@@ -820,7 +820,11 @@ done: - #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) - unsigned long vaddr = (unsigned long)vmf->virtual_address; -+#else -+ unsigned long vaddr = (unsigned long)vmf->address; -+#endif - struct page *page = NULL; - int retval; - ---- 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,11 @@ - return -ENODEV; - } - -+#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,11 @@ - { - BUG_ON(nvl->drm != dev); - nvl->drm = NULL; -+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) - return 0; -+#else -+ return; -+#endif - } - } - -@@ -64,7 +64,11 @@ - } - } - -+#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,9 @@ - #include /* mdelay, udelay */ - - #include /* suser(), capable() replacement */ -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) -+#include -+#endif - #include /* module_param() */ - #if !defined(NV_VMWARE) - #include /* flush_tlb(), flush_tlb_all() */ -@@ -362,17 +363,19 @@ - void address_space_init_once(struct address_space *mapping); - #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,11 @@ - } - - #if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT) -+#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,11 @@ - struct page *page = NULL; - int retval; - -+#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,11 @@ - // it's dealing with anonymous mapping (see handle_pte_fault). - // - #if defined(NV_VM_OPERATIONS_STRUCT_HAS_FAULT) -+#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; ---- kernel/nv-drm.c -+++ kernel/nv-drm.c -@@ -115,7 +115,11 @@ static const struct file_operations nv_drm_fops = { - }; - - static struct drm_driver nv_drm_driver = { -+#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, diff --git a/linux-4.12.patch b/linux-4.12.patch deleted file mode 100644 index 87c50d6..0000000 --- a/linux-4.12.patch +++ /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 -+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) -+ #include -+ #else -+ #include -+ #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 -+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) -+ #include -+ #else -+ #include -+ #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 -+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) -+ #include -+ #else -+ #include -+ #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 -+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) -+ #include -+ #else -+ #include -+ #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 -+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) -+ #include -+ #else -+ #include -+ #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 -+ #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) -+ #include -+ #else -+ #include -+ #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 -+#endif -+ - static inline void nv_set_contig_memory_uc(nv_pte_t *page_ptr, NvU32 num_pages) - { - if (nv_update_memory_types) diff --git a/xorg-driver-video-nvidia-legacy-340xx.spec b/xorg-driver-video-nvidia-legacy-340xx.spec index b03832e..fa77778 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 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 -- 2.44.0