[arch-commits] Commit in nvidia/repos (8 files)
Thomas Bächler
thomas at nymeria.archlinux.org
Sun Jan 26 11:36:21 UTC 2014
Date: Sunday, January 26, 2014 @ 12:36:20
Author: thomas
Revision: 204744
archrelease: copy trunk to testing-i686, testing-x86_64
Added:
nvidia/repos/testing-i686/
nvidia/repos/testing-i686/PKGBUILD
(from rev 204743, nvidia/trunk/PKGBUILD)
nvidia/repos/testing-i686/nvidia.install
(from rev 204743, nvidia/trunk/nvidia.install)
nvidia/repos/testing-i686/nvidia_3.13_kernel.patch
(from rev 204743, nvidia/trunk/nvidia_3.13_kernel.patch)
nvidia/repos/testing-x86_64/
nvidia/repos/testing-x86_64/PKGBUILD
(from rev 204743, nvidia/trunk/PKGBUILD)
nvidia/repos/testing-x86_64/nvidia.install
(from rev 204743, nvidia/trunk/nvidia.install)
nvidia/repos/testing-x86_64/nvidia_3.13_kernel.patch
(from rev 204743, nvidia/trunk/nvidia_3.13_kernel.patch)
-----------------------------------------+
testing-i686/PKGBUILD | 52 ++++++++++++++++++++++++++++++
testing-i686/nvidia.install | 18 ++++++++++
testing-i686/nvidia_3.13_kernel.patch | 46 ++++++++++++++++++++++++++
testing-x86_64/PKGBUILD | 52 ++++++++++++++++++++++++++++++
testing-x86_64/nvidia.install | 18 ++++++++++
testing-x86_64/nvidia_3.13_kernel.patch | 46 ++++++++++++++++++++++++++
6 files changed, 232 insertions(+)
Copied: nvidia/repos/testing-i686/PKGBUILD (from rev 204743, nvidia/trunk/PKGBUILD)
===================================================================
--- testing-i686/PKGBUILD (rev 0)
+++ testing-i686/PKGBUILD 2014-01-26 11:36:20 UTC (rev 204744)
@@ -0,0 +1,52 @@
+# $Id$
+# Maintainer : Thomas Baechler <thomas at archlinux.org>
+
+pkgname=nvidia
+pkgver=331.38
+_extramodules=extramodules-3.13-ARCH
+pkgrel=3
+pkgdesc="NVIDIA drivers for linux"
+arch=('i686' 'x86_64')
+url="http://www.nvidia.com/"
+depends=('linux>=3.13' 'linux<3.14' "nvidia-libgl" "nvidia-utils=${pkgver}")
+makedepends=('linux-headers>=3.13' 'linux-headers<3.14')
+conflicts=('nvidia-96xx' 'nvidia-173xx')
+license=('custom')
+install=nvidia.install
+options=(!strip)
+source=('nvidia_3.13_kernel.patch')
+md5sums=('90fc2d263157fa672fc8d1eb0309cb3a')
+
+if [ "$CARCH" = "i686" ]; then
+ _arch='x86'
+ _pkg="NVIDIA-Linux-${_arch}-${pkgver}"
+ source+=("ftp://download.nvidia.com/XFree86/Linux-${_arch}/${pkgver}/${_pkg}.run")
+ md5sums+=('16aa229f7f118c8cafad6fb3f4ac082e')
+elif [ "$CARCH" = "x86_64" ]; then
+ _arch='x86_64'
+ _pkg="NVIDIA-Linux-${_arch}-${pkgver}-no-compat32"
+ source+=("ftp://download.nvidia.com/XFree86/Linux-${_arch}/${pkgver}/${_pkg}.run")
+ md5sums+=('f2059ae373665cb6c8fb826e1173b04d')
+fi
+
+prepare() {
+ cd "${srcdir}"
+ sh "${_pkg}.run" --extract-only
+ cd "${_pkg}"
+ patch -p1 -i "${srcdir}"/nvidia_3.13_kernel.patch
+}
+
+build() {
+ _kernver="$(cat /usr/lib/modules/${_extramodules}/version)"
+ cd "${srcdir}"/"${_pkg}"/kernel
+ make SYSSRC=/usr/lib/modules/"${_kernver}/build" module
+}
+
+package() {
+ install -D -m644 "${srcdir}/${_pkg}/kernel/nvidia.ko" \
+ "${pkgdir}/usr/lib/modules/${_extramodules}/nvidia.ko"
+ install -d -m755 "${pkgdir}/usr/lib/modprobe.d"
+ echo "blacklist nouveau" >> "${pkgdir}/usr/lib/modprobe.d/nvidia.conf"
+ sed -i -e "s/EXTRAMODULES='.*'/EXTRAMODULES='${_extramodules}'/" "${startdir}/nvidia.install"
+ gzip "${pkgdir}/usr/lib/modules/${_extramodules}/nvidia.ko"
+}
Copied: nvidia/repos/testing-i686/nvidia.install (from rev 204743, nvidia/trunk/nvidia.install)
===================================================================
--- testing-i686/nvidia.install (rev 0)
+++ testing-i686/nvidia.install 2014-01-26 11:36:20 UTC (rev 204744)
@@ -0,0 +1,18 @@
+post_install() {
+ EXTRAMODULES='extramodules-3.12-ARCH'
+ depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
+ echo 'In order to use nvidia module, reboot the system.'
+}
+
+post_upgrade() {
+ EXTRAMODULES='extramodules-3.12-ARCH'
+ depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
+ if [ "$(vercmp $2 310.19-2)" -lt 0 ]; then
+ echo 'If your card is from the 7xxx series or earlier, install nvidia-304xx'
+ fi
+}
+
+post_remove() {
+ EXTRAMODULES='extramodules-3.12-ARCH'
+ depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
+}
Copied: nvidia/repos/testing-i686/nvidia_3.13_kernel.patch (from rev 204743, nvidia/trunk/nvidia_3.13_kernel.patch)
===================================================================
--- testing-i686/nvidia_3.13_kernel.patch (rev 0)
+++ testing-i686/nvidia_3.13_kernel.patch 2014-01-26 11:36:20 UTC (rev 204744)
@@ -0,0 +1,46 @@
+--- a/kernel/nv-acpi.c
++++ b/kernel/nv-acpi.c
+@@ -15,6 +15,10 @@
+ #include "nv-linux.h"
+ #include "nv-reg.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)
+ static RM_STATUS nv_acpi_extract_integer (const union acpi_object *, void *, NvU32, NvU32 *);
+ static RM_STATUS nv_acpi_extract_buffer (const union acpi_object *, void *, NvU32, NvU32 *);
+@@ -303,7 +307,10 @@ static int nv_acpi_remove(struct acpi_de
+
+ if (pNvAcpiObject->notify_handler_installed)
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
++ /* beginning with 3.13, acpi_remove_notify_handler() waits for events to finish */
+ NV_ACPI_OS_WAIT_EVENTS_COMPLETE();
++#endif
+
+ // remove event notifier
+ status = acpi_remove_notify_handler(device->handle, ACPI_DEVICE_NOTIFY, nv_acpi_event);
+--- a/kernel/uvm/nvidia_uvm_linux.h
++++ b/kernel/uvm/nvidia_uvm_linux.h
+@@ -405,11 +405,17 @@ typedef void irqreturn_t;
+ // not require the RCU's read lock on current->cred.
+ //
+ //
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
++#define NV_KUID_TO_UID(value) (__kuid_val(value))
++#else
++#define NV_KUID_TO_UID(value) (value)
++#endif
++
+ #if defined(NV_TASK_STRUCT_HAS_CRED)
+ #define NV_CURRENT_EUID() \
+- (((typeof(*current->cred) __force __kernel *)current->cred)->euid)
++ NV_KUID_TO_UID(((typeof(*current->cred) __force __kernel *)current->cred)->euid)
+ #else
+-#define NV_CURRENT_EUID() (current->euid)
++#define NV_CURRENT_EUID() NV_KUID_TO_UID(current->euid)
+ #endif
+
+ #define NV_ATOMIC_SET(data,val) atomic_set(&(data), (val))
Copied: nvidia/repos/testing-x86_64/PKGBUILD (from rev 204743, nvidia/trunk/PKGBUILD)
===================================================================
--- testing-x86_64/PKGBUILD (rev 0)
+++ testing-x86_64/PKGBUILD 2014-01-26 11:36:20 UTC (rev 204744)
@@ -0,0 +1,52 @@
+# $Id$
+# Maintainer : Thomas Baechler <thomas at archlinux.org>
+
+pkgname=nvidia
+pkgver=331.38
+_extramodules=extramodules-3.13-ARCH
+pkgrel=3
+pkgdesc="NVIDIA drivers for linux"
+arch=('i686' 'x86_64')
+url="http://www.nvidia.com/"
+depends=('linux>=3.13' 'linux<3.14' "nvidia-libgl" "nvidia-utils=${pkgver}")
+makedepends=('linux-headers>=3.13' 'linux-headers<3.14')
+conflicts=('nvidia-96xx' 'nvidia-173xx')
+license=('custom')
+install=nvidia.install
+options=(!strip)
+source=('nvidia_3.13_kernel.patch')
+md5sums=('90fc2d263157fa672fc8d1eb0309cb3a')
+
+if [ "$CARCH" = "i686" ]; then
+ _arch='x86'
+ _pkg="NVIDIA-Linux-${_arch}-${pkgver}"
+ source+=("ftp://download.nvidia.com/XFree86/Linux-${_arch}/${pkgver}/${_pkg}.run")
+ md5sums+=('16aa229f7f118c8cafad6fb3f4ac082e')
+elif [ "$CARCH" = "x86_64" ]; then
+ _arch='x86_64'
+ _pkg="NVIDIA-Linux-${_arch}-${pkgver}-no-compat32"
+ source+=("ftp://download.nvidia.com/XFree86/Linux-${_arch}/${pkgver}/${_pkg}.run")
+ md5sums+=('f2059ae373665cb6c8fb826e1173b04d')
+fi
+
+prepare() {
+ cd "${srcdir}"
+ sh "${_pkg}.run" --extract-only
+ cd "${_pkg}"
+ patch -p1 -i "${srcdir}"/nvidia_3.13_kernel.patch
+}
+
+build() {
+ _kernver="$(cat /usr/lib/modules/${_extramodules}/version)"
+ cd "${srcdir}"/"${_pkg}"/kernel
+ make SYSSRC=/usr/lib/modules/"${_kernver}/build" module
+}
+
+package() {
+ install -D -m644 "${srcdir}/${_pkg}/kernel/nvidia.ko" \
+ "${pkgdir}/usr/lib/modules/${_extramodules}/nvidia.ko"
+ install -d -m755 "${pkgdir}/usr/lib/modprobe.d"
+ echo "blacklist nouveau" >> "${pkgdir}/usr/lib/modprobe.d/nvidia.conf"
+ sed -i -e "s/EXTRAMODULES='.*'/EXTRAMODULES='${_extramodules}'/" "${startdir}/nvidia.install"
+ gzip "${pkgdir}/usr/lib/modules/${_extramodules}/nvidia.ko"
+}
Copied: nvidia/repos/testing-x86_64/nvidia.install (from rev 204743, nvidia/trunk/nvidia.install)
===================================================================
--- testing-x86_64/nvidia.install (rev 0)
+++ testing-x86_64/nvidia.install 2014-01-26 11:36:20 UTC (rev 204744)
@@ -0,0 +1,18 @@
+post_install() {
+ EXTRAMODULES='extramodules-3.12-ARCH'
+ depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
+ echo 'In order to use nvidia module, reboot the system.'
+}
+
+post_upgrade() {
+ EXTRAMODULES='extramodules-3.12-ARCH'
+ depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
+ if [ "$(vercmp $2 310.19-2)" -lt 0 ]; then
+ echo 'If your card is from the 7xxx series or earlier, install nvidia-304xx'
+ fi
+}
+
+post_remove() {
+ EXTRAMODULES='extramodules-3.12-ARCH'
+ depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
+}
Copied: nvidia/repos/testing-x86_64/nvidia_3.13_kernel.patch (from rev 204743, nvidia/trunk/nvidia_3.13_kernel.patch)
===================================================================
--- testing-x86_64/nvidia_3.13_kernel.patch (rev 0)
+++ testing-x86_64/nvidia_3.13_kernel.patch 2014-01-26 11:36:20 UTC (rev 204744)
@@ -0,0 +1,46 @@
+--- a/kernel/nv-acpi.c
++++ b/kernel/nv-acpi.c
+@@ -15,6 +15,10 @@
+ #include "nv-linux.h"
+ #include "nv-reg.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)
+ static RM_STATUS nv_acpi_extract_integer (const union acpi_object *, void *, NvU32, NvU32 *);
+ static RM_STATUS nv_acpi_extract_buffer (const union acpi_object *, void *, NvU32, NvU32 *);
+@@ -303,7 +307,10 @@ static int nv_acpi_remove(struct acpi_de
+
+ if (pNvAcpiObject->notify_handler_installed)
+ {
++#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 13, 0)
++ /* beginning with 3.13, acpi_remove_notify_handler() waits for events to finish */
+ NV_ACPI_OS_WAIT_EVENTS_COMPLETE();
++#endif
+
+ // remove event notifier
+ status = acpi_remove_notify_handler(device->handle, ACPI_DEVICE_NOTIFY, nv_acpi_event);
+--- a/kernel/uvm/nvidia_uvm_linux.h
++++ b/kernel/uvm/nvidia_uvm_linux.h
+@@ -405,11 +405,17 @@ typedef void irqreturn_t;
+ // not require the RCU's read lock on current->cred.
+ //
+ //
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
++#define NV_KUID_TO_UID(value) (__kuid_val(value))
++#else
++#define NV_KUID_TO_UID(value) (value)
++#endif
++
+ #if defined(NV_TASK_STRUCT_HAS_CRED)
+ #define NV_CURRENT_EUID() \
+- (((typeof(*current->cred) __force __kernel *)current->cred)->euid)
++ NV_KUID_TO_UID(((typeof(*current->cred) __force __kernel *)current->cred)->euid)
+ #else
+-#define NV_CURRENT_EUID() (current->euid)
++#define NV_CURRENT_EUID() NV_KUID_TO_UID(current->euid)
+ #endif
+
+ #define NV_ATOMIC_SET(data,val) atomic_set(&(data), (val))
More information about the arch-commits
mailing list