[packages/xorg-driver-video-nvidia-legacy-304xx] - removed obsolete patches - fixed build with kernel 4.14 - rel 1

baggins baggins at pld-linux.org
Thu Nov 16 21:04:56 CET 2017


commit d5c3d152e2eafa19540d31a07cf6de2a3f7ce0bd
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Thu Nov 16 21:04:25 2017 +0100

    - removed obsolete patches
    - fixed build with kernel 4.14
    - rel 1

 kernel-4.14.patch                          |  37 ++++++++
 linux-4.10.patch                           |  38 --------
 linux-4.11.patch                           | 135 -----------------------------
 xorg-driver-video-nvidia-legacy-304xx.spec |  12 ++-
 4 files changed, 42 insertions(+), 180 deletions(-)
---
diff --git a/xorg-driver-video-nvidia-legacy-304xx.spec b/xorg-driver-video-nvidia-legacy-304xx.spec
index 9eefc1e..2cec35e 100644
--- a/xorg-driver-video-nvidia-legacy-304xx.spec
+++ b/xorg-driver-video-nvidia-legacy-304xx.spec
@@ -25,7 +25,7 @@ exit 1
 
 %define		no_install_post_check_so 1
 
-%define		rel	0.1
+%define		rel	1
 %define		mname	nvidia-legacy-304xx
 %define		pname	xorg-driver-video-%{mname}
 Summary:	Linux Drivers for nVidia GeForce/Quadro Chips
@@ -48,9 +48,8 @@ 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:		linux-4.12.patch
+Patch4:		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}}
@@ -251,9 +250,8 @@ rm -rf NVIDIA-Linux-x86*-%{version}*
 %patch0 -p1
 %patch1 -p1
 %patch2 -p1
-%patch3 -p1
-%patch4 -p0
-%patch5 -p0
+%patch3 -p0
+%patch4 -p1
 
 %build
 %{?with_kernel:%{expand:%build_kernel_packages}}
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 <milhouseVH.github at 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
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 <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
index a6317c2..0000000
--- a/linux-4.11.patch
+++ /dev/null
@@ -1,135 +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 <linux/version.h>
-+
- #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/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 @@
-     {
-         if (nvl->dev == dev->pdev)
-         {
-+#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(
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/xorg-driver-video-nvidia-legacy-304xx.git/commitdiff/d5c3d152e2eafa19540d31a07cf6de2a3f7ce0bd



More information about the pld-cvs-commit mailing list