[arch-commits] Commit in nvidia-304xx/trunk (3 files)

Jan Steffens heftig at archlinux.org
Sun Feb 26 22:23:36 UTC 2017


    Date: Sunday, February 26, 2017 @ 22:23:35
  Author: heftig
Revision: 289582

304.135-2

Added:
  nvidia-304xx/trunk/kernel_4.10.patch
Modified:
  nvidia-304xx/trunk/PKGBUILD
  nvidia-304xx/trunk/nvidia-304xx.install

----------------------+
 PKGBUILD             |   15 ++++---
 kernel_4.10.patch    |  105 +++++++++++++++++++++++++++++++++++++++++++++++++
 nvidia-304xx.install |    2 
 3 files changed, 115 insertions(+), 7 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2017-02-26 22:21:36 UTC (rev 289581)
+++ PKGBUILD	2017-02-26 22:23:35 UTC (rev 289582)
@@ -5,20 +5,22 @@
 pkgbase=nvidia-304xx
 pkgname=(nvidia-304xx nvidia-304xx-dkms)
 pkgver=304.135
-_extramodules=extramodules-4.9-ARCH
-pkgrel=1
+_extramodules=extramodules-4.10-ARCH
+pkgrel=2
 arch=('i686' 'x86_64')
 url="http://www.nvidia.com/"
-makedepends=('linux' 'linux-headers>=4.9' 'linux-headers<4.10')
+makedepends=('linux' 'linux-headers>=4.10' 'linux-headers<4.11')
 conflicts=('nvidia')
 license=('custom')
 options=('!strip')
 source=('disable-mtrr.patch'
-        'drm-driver-legacy.patch')
+        'drm-driver-legacy.patch'
+        'kernel_4.10.patch')
 source_i686+=("http://us.download.nvidia.com/XFree86/Linux-x86/${pkgver}/NVIDIA-Linux-x86-${pkgver}.run")
 source_x86_64+=("http://us.download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/NVIDIA-Linux-x86_64-${pkgver}-no-compat32.run")
 sha512sums=('54e8825e523f11706890e09e476498f3a30f75ce4e350ff2ff8a1e1c3af574d9ccfb8903543766b6863d94cdfbf46e68cd3d33380867dd976cafc8dd2dd78774'
-            'fa39dee5c9f1ea98286c87165f683ee194b2cb4056aa6b556e822b9ee760dcf3683ea001c3704e79b9ac9712314d7df5690dc7f68440cda7a96791f94425455d')
+            'fa39dee5c9f1ea98286c87165f683ee194b2cb4056aa6b556e822b9ee760dcf3683ea001c3704e79b9ac9712314d7df5690dc7f68440cda7a96791f94425455d'
+            '68dabbf6ad889c46bd0c01ebb697b80f4aa526ef1cdc53de008343a243adefc6ce7f2778be7005f2d79f3d23c0a3ff69f67ecdb9f97c0feb0ec99405a0c1046a')
 sha512sums_i686=('c2645cc9a6f23641d8b6da51e72e203980068c05e365fcc73b32322a6875ce95e81f4e0d893276e14e84e93464488539c16db6b3be04f5324cf7d7a12bb557f8')
 sha512sums_x86_64=('a5aa48baa75eb267bd193e59328aa5fbc15d41045bb7e97aa1b96b918b9e68a1c1bf95624d9d494336256e0af2c41e188d30fe91be4967084de3387f50d3805c')
 
@@ -30,6 +32,7 @@
     sh "${_pkg}.run" --extract-only
     cd "${_pkg}"
     # patches here
+    patch -Np1 --no-backup-if-mismatch -i ../kernel_4.10.patch
 
     # FS#47092
     #(cd kernel; patch -p1 --no-backup-if-mismatch -i "$srcdir"/disable-mtrr.patch)
@@ -46,7 +49,7 @@
 
 package_nvidia-304xx() {
     pkgdesc="NVIDIA drivers for linux, 304xx legacy branch"
-    depends=('linux>=4.9' 'linux<4.10' 'libgl' "nvidia-304xx-utils=${pkgver}")
+    depends=('linux>=4.10' 'linux<4.11' 'libgl' "nvidia-304xx-utils=${pkgver}")
 	conflicts+=('nvidia-304xx-dkms')
     install=nvidia-304xx.install
 

Added: kernel_4.10.patch
===================================================================
--- kernel_4.10.patch	                        (rev 0)
+++ kernel_4.10.patch	2017-02-26 22:23:35 UTC (rev 289582)
@@ -0,0 +1,105 @@
+From d270372bf8abcf45409b30cdb33069280527b0ff Mon Sep 17 00:00:00 2001
+From: Alberto Milone <alberto.milone at canonical.com>
+Date: Wed, 15 Feb 2017 18:01:02 +0100
+Subject: [PATCH 1/1] Add support for Linux 4.10
+
+---
+ nv-linux.h |  5 +++++
+ nv-pat.c   | 40 ++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 45 insertions(+)
+
+diff --git a/kernel/nv-linux.h b/kernel/nv-linux.h
+index b46e71f..3081c06 100644
+--- a/kernel/nv-linux.h
++++ b/kernel/nv-linux.h
+@@ -1895,8 +1895,13 @@ static inline NvU64 nv_node_end_pfn(int nid)
+ 
+         #else
+ 
++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 10, 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
+ 
+diff --git a/kernel/nv-pat.c b/kernel/nv-pat.c
+index e71e81c..d742789 100644
+--- a/kernel/nv-pat.c
++++ b/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, 10, 0)
+ static int
+ nv_kern_cpu_callback(struct notifier_block *nfb, unsigned long action, void *hcpu)
+ {
+@@ -234,6 +235,34 @@ static struct notifier_block nv_hotcpu_nfb = {
+     .notifier_call = nv_kern_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, 10, 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, 10, 0)
+         unregister_hotcpu_notifier(&nv_hotcpu_nfb);
++#else
++        cpuhp_remove_state_nocalls(CPUHP_AP_ONLINE_DYN);
++#endif
+ #endif
+     }
+ }
+-- 
+2.7.4
+

Modified: nvidia-304xx.install
===================================================================
--- nvidia-304xx.install	2017-02-26 22:21:36 UTC (rev 289581)
+++ nvidia-304xx.install	2017-02-26 22:23:35 UTC (rev 289582)
@@ -1,5 +1,5 @@
 post_install() {
-    EXTRAMODULES='extramodules-4.9-ARCH'
+    EXTRAMODULES='extramodules-4.10-ARCH'
     depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
     echo 'In order to use nvidia module, reboot the system.'
 }



More information about the arch-commits mailing list