]> git.pld-linux.org Git - packages/xorg-driver-video-nvidia-legacy-304xx.git/commitdiff
- build fixes for kernel 4.11 auto/th/xorg-driver-video-nvidia-legacy-304xx-304.135-2
authorJan Rękorajski <baggins@pld-linux.org>
Wed, 10 May 2017 20:52:34 +0000 (22:52 +0200)
committerJan Rękorajski <baggins@pld-linux.org>
Wed, 10 May 2017 20:52:34 +0000 (22:52 +0200)
- rel 2

linux-4.11.patch [new file with mode: 0644]
xorg-driver-video-nvidia-legacy-304xx.spec

diff --git a/linux-4.11.patch b/linux-4.11.patch
new file mode 100644 (file)
index 0000000..04eb7f1
--- /dev/null
@@ -0,0 +1,126 @@
+--- 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, 10, 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, 10, 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, 10, 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, 10, 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/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,7 @@\r
+     return -ENODEV;\r
+ }\r
+\r
+-static int nv_drm_unload(\r
++static void nv_drm_unload(\r
+     struct drm_device *dev\r
+ )\r
+ {\r
+@@ -60,7 +60,7 @@\r
+     {\r
+         if (nvl->dev == dev->pdev)\r
+         {\r
+-            return 0;\r
++            return;\r
+         }\r
+     }\r
\r
+@@ -64,7 +64,7 @@\r
+         }\r
+     }\r
+\r
+-    return -ENODEV;\r
++    return;\r
+ }\r
+\r
+ static void nv_gem_free(\r
index 94ea8d441d3d8026c53691e1decec2618d6cc029..b0383365a655f3970ab7c2542ff980b5482e1e1f 100644 (file)
@@ -25,7 +25,7 @@ exit 1
 
 %define                no_install_post_check_so 1
 
-%define                rel     1
+%define                rel     2
 %define                mname   nvidia-legacy-304xx
 %define                pname   xorg-driver-video-%{mname}
 Summary:       Linux Drivers for nVidia GeForce/Quadro Chips
@@ -49,6 +49,7 @@ 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
 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}}
@@ -250,6 +251,7 @@ rm -rf NVIDIA-Linux-x86*-%{version}*
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p0
 
 %build
 %{?with_kernel:%{expand:%build_kernel_packages}}
This page took 0.048695 seconds and 4 git commands to generate.