diff options
author | sirlucjan | 2017-04-20 17:14:37 +0200 |
---|---|---|
committer | sirlucjan | 2017-04-20 17:14:37 +0200 |
commit | db81a1de82f770cb6949d6e0fcadd5059da01686 (patch) | |
tree | b0c1fe0fcbf8e3fa1c638c61b78e58d0ec1062fc | |
parent | 122cd89575dad3a49e7d0abbc8270eb50d714457 (diff) | |
download | aur-db81a1de82f770cb6949d6e0fcadd5059da01686.tar.gz |
Bump to 4.10-series
-rw-r--r-- | .SRCINFO | 16 | ||||
-rw-r--r-- | PKGBUILD | 18 | ||||
-rw-r--r-- | disable-mtrr.patch | 24 | ||||
-rw-r--r-- | drm-driver-legacy.patch | 20 | ||||
-rw-r--r-- | kernel_4.10.patch | 105 | ||||
-rw-r--r-- | nvidia-304xx-lqx.install | 2 |
6 files changed, 120 insertions, 65 deletions
@@ -1,25 +1,23 @@ pkgbase = nvidia-304xx-lqx pkgdesc = NVIDIA 304xx drivers for linux-lqx. pkgver = 304.135 - pkgrel = 1 + pkgrel = 2 url = http://www.nvidia.com/ install = nvidia-304xx-lqx.install arch = i686 arch = x86_64 license = custom - makedepends = linux-lqx-headers>=4.9 - makedepends = linux-lqx-headers<4.10 - depends = linux-lqx>=4.9 - depends = linux-lqx<4.10 + makedepends = linux-lqx-headers>=4.10 + makedepends = linux-lqx-headers<4.11 + depends = linux-lqx>=4.10 + depends = linux-lqx<4.11 depends = nvidia-304xx-libgl depends = nvidia-304xx-utils=304.135 conflicts = nvidia-lqx conflicts = nvidia-340xx-lqx options = !strip - source = disable-mtrr.patch - source = drm-driver-legacy.patch - md5sums = c4becf1145a139cc0121be9ad340bcd8 - md5sums = a5328715e210e36e5d9bbed0f9e55223 + source = kernel_4.10.patch + md5sums = a8d331a75fbc541f1730e95b95e9ef14 source_i686 = ftp://download.nvidia.com/XFree86/Linux-x86/304.135/NVIDIA-Linux-x86-304.135.run md5sums_i686 = 0e2082ae8490b135eb306befe6db56e1 source_x86_64 = ftp://download.nvidia.com/XFree86/Linux-x86_64/304.135/NVIDIA-Linux-x86_64-304.135-no-compat32.run @@ -4,24 +4,22 @@ pkgname=nvidia-304xx-lqx pkgver=304.135 -_extramodules=extramodules-4.9-lqx -pkgrel=1 +_extramodules=extramodules-4.10-lqx +pkgrel=2 _pkgdesc="NVIDIA 304xx drivers for linux-lqx." pkgdesc="$_pkgdesc" arch=('i686' 'x86_64') url="http://www.nvidia.com/" -depends=('linux-lqx>=4.9' 'linux-lqx<4.10' "nvidia-304xx-libgl" "nvidia-304xx-utils=${pkgver}") -makedepends=('linux-lqx-headers>=4.9' 'linux-lqx-headers<4.10') +depends=('linux-lqx>=4.10' 'linux-lqx<4.11' "nvidia-304xx-libgl" "nvidia-304xx-utils=${pkgver}") +makedepends=('linux-lqx-headers>=4.10' 'linux-lqx-headers<4.11') conflicts=('nvidia-lqx' 'nvidia-340xx-lqx') license=('custom') install=nvidia-304xx-lqx.install options=(!strip) -source=('disable-mtrr.patch' - 'drm-driver-legacy.patch') +source=('kernel_4.10.patch') source_i686=("ftp://download.nvidia.com/XFree86/Linux-x86/${pkgver}/NVIDIA-Linux-x86-${pkgver}.run") source_x86_64=("ftp://download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/NVIDIA-Linux-x86_64-${pkgver}-no-compat32.run") -md5sums=('c4becf1145a139cc0121be9ad340bcd8' - 'a5328715e210e36e5d9bbed0f9e55223') +md5sums=('a8d331a75fbc541f1730e95b95e9ef14') md5sums_i686=('0e2082ae8490b135eb306befe6db56e1') md5sums_x86_64=('8ee9bd0b020508bca9953181811422fa') @@ -34,9 +32,7 @@ prepare() { cd "${_pkg}" # patches here - # FS#47092 - #(cd kernel; patch -p1 --no-backup-if-mismatch -i "$srcdir"/disable-mtrr.patch) - (cd kernel; patch -p1 --no-backup-if-mismatch -i "$srcdir"/drm-driver-legacy.patch) + patch -Np1 --no-backup-if-mismatch -i ../kernel_4.10.patch } diff --git a/disable-mtrr.patch b/disable-mtrr.patch deleted file mode 100644 index 9be9e2c86270..000000000000 --- a/disable-mtrr.patch +++ /dev/null @@ -1,24 +0,0 @@ -Author: Luca Boccassi <luca.boccassi@gmail.com> -Description: Disable MTRR on kernel >= 4.3 - From kernel 4.3 and newer (commit 2baa891e42d84) mtrr_add and mtrr_del are no - longer exported. The Nvidia kernel shim still uses it as of 304.131, causing - the module to error out when loading. Disable MTRR if running on 4.3 or greater - until upstream fixes it. ---- a/nv-linux.h -+++ b/nv-linux.h -@@ -256,6 +256,15 @@ - #include <linux/seq_file.h> - #endif - -+/* -+ * As of version 304.131, os-agp.c and os-mtrr.c still use deprecated -+ * kernel APIs for mtrr which are no longer exported since 4.3, causing -+ * the module to error out when loaded. -+ */ -+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,3,0) -+#undef CONFIG_MTRR -+#endif -+ - #if !defined(NV_VMWARE) && defined(CONFIG_MTRR) - #include <asm/mtrr.h> - #endif diff --git a/drm-driver-legacy.patch b/drm-driver-legacy.patch deleted file mode 100644 index 32ac75ca4dfa..000000000000 --- a/drm-driver-legacy.patch +++ /dev/null @@ -1,20 +0,0 @@ -Author: Luca Boccassi <luca.boccassi@gmail.com> -Description: Fix kernel module load on 4.9 and greater - From kernel 4.9 and newer (commit fa5386459f06) non-modesetting drivers have - to use the DRM flag DRIVER_LEGACY. Without this flag the kernel module does - not load correctly. - ---- a/nv-drm.c -+++ b/nv-drm.c -@@ -71,7 +71,11 @@ - }; - - static struct drm_driver nv_drm_driver = { -+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0) - .driver_features = 0, -+#else -+ .driver_features = DRIVER_LEGACY, -+#endif - .load = nv_drm_load, - .unload = nv_drm_unload, - .fops = &nv_drm_fops, diff --git a/kernel_4.10.patch b/kernel_4.10.patch new file mode 100644 index 000000000000..1e987408ead0 --- /dev/null +++ b/kernel_4.10.patch @@ -0,0 +1,105 @@ +From d270372bf8abcf45409b30cdb33069280527b0ff Mon Sep 17 00:00:00 2001 +From: Alberto Milone <alberto.milone@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 + diff --git a/nvidia-304xx-lqx.install b/nvidia-304xx-lqx.install index a9808d69c8b5..609622529493 100644 --- a/nvidia-304xx-lqx.install +++ b/nvidia-304xx-lqx.install @@ -1,5 +1,5 @@ post_install() { - EXTRAMODULES='extramodules-4.9-lqx' + EXTRAMODULES='extramodules-4.10-lqx' depmod $(cat /usr/lib/modules/${EXTRAMODULES}/version) echo 'In order to use nvidia module, reboot the system.' } |