Update nvidia-drd

This commit is contained in:
Tom Willemse 2014-02-02 14:23:27 +01:00
parent c6f9b45fdb
commit cb97276bfb
3 changed files with 58 additions and 9 deletions

View file

@ -1,19 +1,20 @@
# $Id: PKGBUILD 199771 2013-11-15 21:40:40Z svenstaro $
# $Id: PKGBUILD 204744 2014-01-26 11:36:20Z thomas $
# Maintainer : Thomas Baechler <thomas@archlinux.org>
pkgname=nvidia-drd
pkgver=331.38
_extramodules=extramodules-3.12-drd
pkgrel=1
_extramodules=extramodules-3.13-drd
pkgrel=3
pkgdesc="NVIDIA drivers for linux"
arch=('i686' 'x86_64')
url="http://www.nvidia.com/"
depends=('linux-drd>=3.12' 'linux-drd<3.13' "nvidia-libgl" "nvidia-utils=${pkgver}")
makedepends=('linux-drd-headers>=3.12' 'linux-drd-headers<3.13')
depends=('linux-drd>=3.13' 'linux-drd<3.14' "nvidia-libgl" "nvidia-utils=${pkgver}")
makedepends=('linux-drd-headers>=3.13' 'linux-drd-headers<3.14')
conflicts=('nvidia-96xx' 'nvidia-173xx')
license=('custom')
install=nvidia.install
options=(!strip)
source=('nvidia_3.13_kernel.patch')
_arch='x86_64'
_pkg="NVIDIA-Linux-${_arch}-${pkgver}-no-compat32"
@ -23,6 +24,7 @@ prepare() {
cd "${srcdir}"
sh "${_pkg}.run" --extract-only
cd "${_pkg}"
patch -p1 -i "${srcdir}"/nvidia_3.13_kernel.patch
}
build() {
@ -39,4 +41,5 @@ package() {
sed -i -e "s/EXTRAMODULES='.*'/EXTRAMODULES='${_extramodules}'/" "${startdir}/nvidia.install"
gzip "${pkgdir}/usr/lib/modules/${_extramodules}/nvidia.ko"
}
md5sums=('f2059ae373665cb6c8fb826e1173b04d')
md5sums=('90fc2d263157fa672fc8d1eb0309cb3a'
'f2059ae373665cb6c8fb826e1173b04d')

View file

@ -1,11 +1,11 @@
post_install() {
EXTRAMODULES='extramodules-3.12-drd'
EXTRAMODULES='extramodules-3.13-drd'
depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
echo 'In order to use nvidia module, reboot the system.'
}
post_upgrade() {
EXTRAMODULES='extramodules-3.12-drd'
EXTRAMODULES='extramodules-3.13-drd'
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'
@ -13,6 +13,6 @@ post_upgrade() {
}
post_remove() {
EXTRAMODULES='extramodules-3.12-drd'
EXTRAMODULES='extramodules-3.13-drd'
depmod $(cat /usr/lib/modules/$EXTRAMODULES/version)
}

View file

@ -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))