Update nvidia-drd to 334.21-4

This commit is contained in:
Tom Willemse 2014-04-05 15:58:06 +02:00
parent 1bd2915aab
commit bee882c367
4 changed files with 36 additions and 61 deletions

View file

@ -1,43 +1,52 @@
# $Id: PKGBUILD 206648 2014-03-04 03:14:42Z svenstaro $
# $Id: PKGBUILD 209728 2014-04-01 21:47:44Z thomas $
# Maintainer : Thomas Baechler <thomas@archlinux.org>
pkgname=nvidia-drd
pkgver=334.21
_extramodules=extramodules-3.13-drd
pkgrel=1
_extramodules=extramodules-3.14-drd
pkgrel=4
pkgdesc="NVIDIA drivers for linux"
arch=('i686' 'x86_64')
url="http://www.nvidia.com/"
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')
depends=('linux-drd>=3.14' 'linux-drd<3.15' "nvidia-libgl" "nvidia-utils=${pkgver}")
makedepends=('linux-drd-headers>=3.14' 'linux-drd-headers<3.15')
conflicts=('nvidia-96xx' 'nvidia-173xx')
license=('custom')
install=nvidia.install
options=(!strip)
source=("ftp://download.nvidia.com/XFree86/Linux-x86/${pkgver}/NVIDIA-Linux-x86-${pkgver}.run"
"ftp://download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/NVIDIA-Linux-x86_64-${pkgver}-no-compat32.run")
_pkg="NVIDIA-Linux-x86_64-${pkgver}-no-compat32"
"ftp://download.nvidia.com/XFree86/Linux-x86_64/${pkgver}/NVIDIA-Linux-x86_64-${pkgver}-no-compat32.run"
'nvidia-3.14.patch')
md5sums=('3b2736dd6ed7e24f71004bad0e55e32e'
'f96b6708702830fe647a7d11832c514e'
'08810729376eb0f829dedaf00d1c5915')
[[ "$CARCH" = "i686" ]] && _pkg="NVIDIA-Linux-x86-${pkgver}"
[[ "$CARCH" = "x86_64" ]] && _pkg="NVIDIA-Linux-x86_64-${pkgver}-no-compat32"
prepare() {
cd "${srcdir}"
sh "${_pkg}.run" --extract-only
cd "${_pkg}"
# patches here
patch -p1 -i "${srcdir}/nvidia-3.14.patch"
}
build() {
_kernver="$(cat /usr/lib/modules/${_extramodules}/version)"
cd "${srcdir}"/"${_pkg}"/kernel
cd "${_pkg}"/kernel
make SYSSRC=/usr/lib/modules/"${_kernver}/build" module
cd uvm
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 -m644 "${srcdir}/${_pkg}/kernel/uvm/nvidia-uvm.ko" \
"${pkgdir}/usr/lib/modules/${_extramodules}/nvidia-uvm.ko"
gzip "${pkgdir}/usr/lib/modules/${_extramodules}/"*.ko
install -d -m755 "${pkgdir}/usr/lib/modprobe.d"
echo "blacklist nouveau" >> "${pkgdir}/usr/lib/modprobe.d/nvidia-drd.conf"
sed -i -e "s/EXTRAMODULES='.*'/EXTRAMODULES='${_extramodules}'/" "${startdir}/nvidia.install"
gzip "${pkgdir}/usr/lib/modules/${_extramodules}/nvidia.ko"
}
md5sums=('3b2736dd6ed7e24f71004bad0e55e32e'
'f96b6708702830fe647a7d11832c514e')

View file

@ -0,0 +1,12 @@
--- a/kernel/nv-linux.h 2014-01-09 04:49:25.000000000 +0200
+++ b/kernel/nv-linux.h 2014-02-05 16:46:55.552408568 +0200
@@ -273,8 +273,7 @@
#endif
#if !defined(NV_VMWARE) && 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

View file

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

View file

@ -1,46 +0,0 @@
--- 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))