summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorBalló György2015-07-03 17:00:41 +0200
committerBalló György2015-07-03 17:00:41 +0200
commitb65b3a680306522d56cfbcfaf188df12d30310bf (patch)
tree6f6bee12dc3801948d4c62125579166d8db61578
downloadaur-b65b3a680306522d56cfbcfaf188df12d30310bf.tar.gz
upgpkg: nvidia-173xx-dkms 173.14.39-5
Initial commit
-rw-r--r--.SRCINFO31
-rw-r--r--PKGBUILD59
-rw-r--r--dkms.conf7
-rw-r--r--linux-3.14.patch132
-rw-r--r--linux-3.17.patch30
-rw-r--r--linux-3.19.patch21
-rw-r--r--linux-4.0.patch29
-rw-r--r--nvidia-dkms.install15
8 files changed, 324 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..253d38f29e4f
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,31 @@
+pkgbase = nvidia-173xx-dkms
+ pkgdesc = NVIDIA kernel module sources (DKMS), 173xx branch
+ pkgver = 173.14.39
+ pkgrel = 5
+ url = http://www.nvidia.com/
+ install = nvidia-dkms.install
+ arch = i686
+ arch = x86_64
+ license = custom
+ depends = dkms
+ depends = nvidia-173xx-utils=173.14.39
+ optdepends = linux-headers: build the module for Arch kernel
+ optdepends = linux-lts-headers: build the module for LTS Arch kernel
+ provides = nvidia=173.14.39
+ provides = nvidia-dkms
+ conflicts = nvidia
+ options = !strip
+ source = http://us.download.nvidia.com/XFree86/Linux-/173.14.39/NVIDIA-Linux--173.14.39-pkg0.run
+ source = linux-3.14.patch
+ source = linux-3.17.patch
+ source = linux-3.19.patch
+ source = linux-4.0.patch
+ source = dkms.conf
+ md5sums = 6dfb34d8fdf35c1637932f95d2216c46
+ md5sums = a2042d1f47d3f7c8b380237bd0b35863
+ md5sums = be7d8583f27021dde68e87239d547457
+ md5sums = c84147f5645290b6d840e987e5413536
+ md5sums = d784fa643442852babc56f60705387a4
+
+pkgname = nvidia-173xx-dkms
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..c2b94a46a966
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,59 @@
+# $Id$
+# Maintainer: Balló György <ballogyor+arch at gmail dot com>
+# Contributor: Maxime Gauduin <alucryd@gmail.com>
+# Contributor: Thomas Baechler <thomas@archlinux.org>
+
+pkgname=nvidia-173xx-dkms
+pkgver=173.14.39
+pkgrel=5
+pkgdesc="NVIDIA kernel module sources (DKMS), 173xx branch"
+arch=('i686' 'x86_64')
+[ "$CARCH" = "i686" ] && _arch=x86
+[ "$CARCH" = "x86_64" ] && _arch=x86_64
+_pkg=NVIDIA-Linux-${_arch}-${pkgver}-pkg0
+url="http://www.nvidia.com/"
+depends=('dkms' "nvidia-173xx-utils=${pkgver}")
+optdepends=('linux-headers: build the module for Arch kernel'
+ 'linux-lts-headers: build the module for LTS Arch kernel')
+provides=("nvidia=${pkgver}" 'nvidia-dkms')
+conflicts=('nvidia')
+license=('custom')
+install=nvidia-dkms.install
+source=("http://us.download.nvidia.com/XFree86/Linux-${_arch}/${pkgver}/${_pkg}.run"
+ linux-3.14.patch
+ linux-3.17.patch
+ linux-3.19.patch
+ linux-4.0.patch
+ dkms.conf)
+options=(!strip)
+[ "$CARCH" = "i686" ] && md5sums=('5b423543428554ef33a200fbbe3cb9fc')
+[ "$CARCH" = "x86_64" ] && md5sums=('0799f194869e40141c7bac8a71762db6')
+md5sums+=('6dfb34d8fdf35c1637932f95d2216c46'
+ 'a2042d1f47d3f7c8b380237bd0b35863'
+ 'be7d8583f27021dde68e87239d547457'
+ 'c84147f5645290b6d840e987e5413536'
+ 'd784fa643442852babc56f60705387a4')
+
+prepare() {
+ if [[ -d ${_pkg} ]] ; then
+ rm -rf ${_pkg}
+ fi
+
+ sh ${_pkg}.run --extract-only
+
+ cd ${_pkg}/usr/src/nv
+ patch -p1 -i "$srcdir/linux-3.14.patch"
+ patch -p1 -i "$srcdir/linux-3.17.patch"
+ patch -p1 -i "$srcdir/linux-3.19.patch"
+ patch -p1 -i "$srcdir/linux-4.0.patch"
+}
+
+package() {
+ cd ${_pkg}/usr/src/nv
+
+ install -dm 755 "${pkgdir}"/usr/{lib/modprobe.d,share/licenses,src}
+ cp -dr --no-preserve=ownership . "${pkgdir}"/usr/src/nvidia-${pkgver}
+ install -m644 "${srcdir}"/dkms.conf "${pkgdir}"/usr/src/nvidia-${pkgver}/dkms.conf
+ echo 'blacklist nouveau' > "${pkgdir}"/usr/lib/modprobe.d/nvidia.conf
+ ln -s nvidia-173xx "${pkgdir}"/usr/share/licenses/${pkgname}
+}
diff --git a/dkms.conf b/dkms.conf
new file mode 100644
index 000000000000..e6d69e654065
--- /dev/null
+++ b/dkms.conf
@@ -0,0 +1,7 @@
+PACKAGE_NAME="nvidia"
+PACKAGE_VERSION="173.14.39"
+BUILT_MODULE_NAME[0]="$PACKAGE_NAME"
+DEST_MODULE_LOCATION[0]="/kernel/drivers/video"
+MAKE[0]="make module SYSSRC=${kernel_source_dir}"
+CLEAN="make clean"
+AUTOINSTALL="yes"
diff --git a/linux-3.14.patch b/linux-3.14.patch
new file mode 100644
index 000000000000..20fbba939fa3
--- /dev/null
+++ b/linux-3.14.patch
@@ -0,0 +1,132 @@
+diff -pur 1/conftest.sh 2/conftest.sh
+--- 1/conftest.sh 2013-11-28 03:16:46.000000000 +0400
++++ 2/conftest.sh 2014-04-10 09:51:13.880164860 +0400
+@@ -992,61 +992,6 @@ compile_test() {
+ fi
+ ;;
+
+- acpi_os_wait_events_complete)
+- #
+- # Determine if the acpi_os_wait_events_complete() function
+- # is present and how many arguments it takes.
+- #
+- echo "$CONFTEST_PREAMBLE
+- #include <linux/acpi.h>
+- void conftest_acpi_os_wait_events_complete(void) {
+- acpi_os_wait_events_complete(NULL, NULL);
+- }" > conftest$$.c
+-
+- $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
+- rm -f conftest$$.c
+-
+- if [ -f conftest$$.o ]; then
+- rm -f conftest$$.o
+- echo "#undef NV_ACPI_OS_WAIT_EVENTS_COMPLETE_PRESENT" >> conftest.h
+- return
+- fi
+-
+- echo "$CONFTEST_PREAMBLE
+- #include <linux/acpi.h>
+- void conftest_acpi_os_wait_events_complete(void) {
+- acpi_os_wait_events_complete(NULL);
+- }" > conftest$$.c
+-
+- $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
+- rm -f conftest$$.c
+-
+- if [ -f conftest$$.o ]; then
+- rm -f conftest$$.o
+- echo "#define NV_ACPI_OS_WAIT_EVENTS_COMPLETE_PRESENT" >> conftest.h
+- echo "#define NV_ACPI_OS_WAIT_EVENTS_COMPLETE_ARGUMENT_COUNT 1" >> conftest.h
+- return
+- fi
+-
+- echo "$CONFTEST_PREAMBLE
+- #include <linux/acpi.h>
+- void conftest_acpi_os_wait_events_complete(void) {
+- acpi_os_wait_events_complete();
+- }" > conftest$$.c
+-
+- $CC $CFLAGS -c conftest$$.c > /dev/null 2>&1
+- rm -f conftest$$.c
+-
+- if [ -f conftest$$.o ]; then
+- rm -f conftest$$.o
+- echo "#define NV_ACPI_OS_WAIT_EVENTS_COMPLETE_PRESENT" >> conftest.h
+- echo "#define NV_ACPI_OS_WAIT_EVENTS_COMPLETE_ARGUMENT_COUNT 0" >> conftest.h
+- return
+- else
+- echo "#error acpi_os_wait_events_complete() conftest failed!" >> conftest.h
+- fi
+- ;;
+-
+ ioremap_cache)
+ #
+ # Determine if the ioremap_cache() function is present.
+diff -pur 1/Makefile.kbuild 2/Makefile.kbuild
+--- 1/Makefile.kbuild 2013-11-28 03:16:46.000000000 +0400
++++ 2/Makefile.kbuild 2014-04-10 09:50:35.116646401 +0400
+@@ -163,7 +163,6 @@ COMPILE_TESTS = \
+ ioremap_wc \
+ proc_dir_entry \
+ acpi_walk_namespace \
+- acpi_os_wait_events_complete \
+ agp_memory \
+ scatterlist \
+ file_operations \
+diff -pur 1/nvacpi.c 2/nvacpi.c
+--- 1/nvacpi.c 2013-11-28 03:16:46.000000000 +0400
++++ 2/nvacpi.c 2014-04-10 10:30:55.538227542 +0400
+@@ -14,6 +14,10 @@
+ #include "os-interface.h"
+ #include "nv-linux.h"
+
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 13, 0) && defined(ACPI_HANDLE)
++#define DEVICE_ACPI_HANDLE(a) ACPI_HANDLE(a)
++#endif
++
+ #if defined(NV_LINUX_ACPI_EVENTS_SUPPORTED)
+
+ /*
+@@ -259,8 +263,6 @@ static int nv_acpi_remove(struct acpi_de
+
+ if (pNvAcpiObject->notify_handler_installed)
+ {
+- NV_ACPI_OS_WAIT_EVENTS_COMPLETE();
+-
+ // remove event notifier
+ status = acpi_remove_notify_handler(device->handle, ACPI_DEVICE_NOTIFY, nv_acpi_event);
+ }
+diff -pur 1/nv-linux.h 2/nv-linux.h
+--- 1/nv-linux.h 2013-11-28 03:16:46.000000000 +0400
++++ 2/nv-linux.h 2014-04-10 10:21:08.848753758 +0400
+@@ -206,8 +206,7 @@ extern int nv_pat_mode;
+ #endif
+
+ #if defined(CONFIG_ACPI)
+-#include <acpi/acpi.h>
+-#include <acpi/acpi_drivers.h>
++#include <linux/acpi.h>
+ #if defined(NV_ACPI_DEVICE_OPS_HAS_MATCH) || defined(ACPI_VIDEO_HID)
+ #define NV_LINUX_ACPI_EVENTS_SUPPORTED 1
+ #endif
+@@ -225,19 +224,6 @@ extern int nv_pat_mode;
+ #error "NV_ACPI_WALK_NAMESPACE_ARGUMENT_COUNT value unrecognized!"
+ #endif
+
+-#if defined(NV_LINUX_ACPI_EVENTS_SUPPORTED)
+-#if defined(KERNEL_2_4) || \
+- (NV_ACPI_OS_WAIT_EVENTS_COMPLETE_ARGUMENT_COUNT == 1)
+-#define NV_ACPI_OS_WAIT_EVENTS_COMPLETE() \
+- acpi_os_wait_events_complete(NULL)
+-#elif (NV_ACPI_OS_WAIT_EVENTS_COMPLETE_ARGUMENT_COUNT == 0)
+-#define NV_ACPI_OS_WAIT_EVENTS_COMPLETE() \
+- acpi_os_wait_events_complete()
+-#else
+-#error "NV_ACPI_OS_WAIT_EVENTS_COMPLETE_ARGUMENT_COUNT value unrecognized!"
+-#endif
+-#endif
+-
+ #if defined(CONFIG_PREEMPT_RT)
+ typedef atomic_spinlock_t nv_spinlock_t;
+ #define NV_SPIN_LOCK_INIT(lock) atomic_spin_lock_init(lock)
diff --git a/linux-3.17.patch b/linux-3.17.patch
new file mode 100644
index 000000000000..eb16ee970828
--- /dev/null
+++ b/linux-3.17.patch
@@ -0,0 +1,30 @@
+diff -Naur nv.orig/conftest.sh nv/conftest.sh
+--- nv.orig/conftest.sh 2015-01-02 18:00:55.768624000 +0100
++++ nv/conftest.sh 2015-01-02 18:01:36.289567499 +0100
+@@ -943,7 +943,7 @@
+ # and how many arguments it takes.
+ #
+ echo "$CONFTEST_PREAMBLE
+- #include <acpi/acpi.h>
++ #include <linux/acpi.h>
+ void conftest_acpi_walk_namespace(void) {
+ acpi_walk_namespace();
+ }" > conftest$$.c
+@@ -958,7 +958,7 @@
+ fi
+
+ echo "$CONFTEST_PREAMBLE
+- #include <acpi/acpi.h>
++ #include <linux/acpi.h>
+ void conftest_acpi_walk_namespace(void) {
+ acpi_walk_namespace(0, NULL, 0, NULL, NULL, NULL, NULL);
+ }" > conftest$$.c
+@@ -974,7 +974,7 @@
+ fi
+
+ echo "$CONFTEST_PREAMBLE
+- #include <acpi/acpi.h>
++ #include <linux/acpi.h>
+ void conftest_acpi_walk_namespace(void) {
+ acpi_walk_namespace(0, NULL, 0, NULL, NULL, NULL);
+ }" > conftest$$.c
diff --git a/linux-3.19.patch b/linux-3.19.patch
new file mode 100644
index 000000000000..1ac35bf3b4a4
--- /dev/null
+++ b/linux-3.19.patch
@@ -0,0 +1,21 @@
+diff -Naur nv.orig/nv.c nv/nv.c
+--- nv.orig/nv.c 2013-11-27 23:47:09.000000000 +0100
++++ nv/nv.c 2015-04-16 13:24:47.058286851 +0200
+@@ -2746,7 +2746,7 @@
+ unsigned long i_arg
+ )
+ {
+- return nv_kern_ioctl(file->f_dentry->d_inode, file, cmd, i_arg);
++ return nv_kern_ioctl(file->f_path.dentry->d_inode, file, cmd, i_arg);
+ }
+
+ long nv_kern_compat_ioctl(
+@@ -2755,7 +2755,7 @@
+ unsigned long i_arg
+ )
+ {
+- return nv_kern_ioctl(file->f_dentry->d_inode, file, cmd, i_arg);
++ return nv_kern_ioctl(file->f_path.dentry->d_inode, file, cmd, i_arg);
+ }
+
+ /*
diff --git a/linux-4.0.patch b/linux-4.0.patch
new file mode 100644
index 000000000000..0e023c54a231
--- /dev/null
+++ b/linux-4.0.patch
@@ -0,0 +1,29 @@
+diff -Naur nv.orig/nv.c nv/nv.c
+--- nv.orig/nv.c 2015-04-16 13:40:32.359209000 +0200
++++ nv/nv.c 2015-04-16 13:43:35.743919299 +0200
+@@ -841,8 +841,13 @@
+ unsigned long cr0 = read_cr0();
+ write_cr0(((cr0 & (0xdfffffff)) | 0x40000000));
+ wbinvd();
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)
++ *cr4 = __read_cr4();
++ if (*cr4 & 0x80) __write_cr4(*cr4 & ~0x80);
++#else
+ *cr4 = read_cr4();
+ if (*cr4 & 0x80) write_cr4(*cr4 & ~0x80);
++#endif
+ __flush_tlb();
+ }
+
+@@ -852,7 +857,11 @@
+ wbinvd();
+ __flush_tlb();
+ write_cr0((cr0 & 0x9fffffff));
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,0,0)
++ if (cr4 & 0x80) __write_cr4(cr4);
++#else
+ if (cr4 & 0x80) write_cr4(cr4);
++#endif
+ }
+
+ static int __determine_pat_mode()
diff --git a/nvidia-dkms.install b/nvidia-dkms.install
new file mode 100644
index 000000000000..69b49d841275
--- /dev/null
+++ b/nvidia-dkms.install
@@ -0,0 +1,15 @@
+post_install() {
+ dkms install -m nvidia/${1%-*}
+}
+
+pre_upgrade() {
+ pre_remove ${2}
+}
+
+post_upgrade() {
+ post_install ${1}
+}
+
+pre_remove() {
+ dkms remove -m nvidia/${1%-*} --all
+}