Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Patchset for nvidia-340xx-rt (340.76-4) AUR4 package to fix build failure problem
--- kernel/nv-drm.c~ 2014-09-12 00:33:06.000000000 +0200
+++ kernel/nv-drm.c 2014-10-14 11:35:52.854400737 +0200
@@ -18,6 +18,11 @@
#include <drm/drmP.h>
+/* 3.18-rc0+ */
+#ifndef drm_gem_object
+#include <drm/drm_gem.h>
+#endif
+
extern nv_linux_state_t *nv_linux_devices;
struct nv_gem_object {
diff --git a/kernel/nv-drm.c~ b/kernel/nv-drm.c
index ecc982a..60d7aae 100644
--- kernel/nv-drm.c~
+++ kernel/nv-drm.c
@@ -129,6 +129,8 @@ static struct drm_driver nv_drm_driver = {
.gem_prime_vmap = nv_gem_prime_vmap,
.gem_prime_vunmap = nv_gem_prime_vunmap,
+ .set_busid = drm_pci_set_busid,
+
.name = "nvidia-drm",
.desc = "NVIDIA DRM driver",
.date = "20130102",
--- kernel/nv-pat.c~ 2015-02-22 20:39:43.889075396 -0800
+++ kernel/nv-pat.c 2015-02-22 20:29:33.519735577 -0800
@@ -35,8 +35,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();
}
@@ -46,7 +46,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 nv_determine_pat_mode(void)
diff --git a/nvidia.install b/nvidia.install
index dd197d6..84c8fc0 100644
--- a/nvidia.install
+++ b/nvidia.install
@@ -1,11 +1,11 @@
post_install() {
- EXTRAMODULES='extramodules-3.18-rt'
+ EXTRAMODULES='extramodules-4.0-rt'
depmod $(cat /lib/modules/$EXTRAMODULES/version)
echo 'In order to use nvidia module, reboot the system.'
}
post_upgrade() {
- EXTRAMODULES='extramodules-3.18-rt'
+ EXTRAMODULES='extramodules-4.0-rt'
depmod $(cat /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.18-rt'
+ EXTRAMODULES='extramodules-4.0-rt'
depmod $(cat /lib/modules/$EXTRAMODULES/version)
}
diff --git a/PKGBUILD b/PKGBUILD
index 005f950..e94aa07 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -6,7 +6,7 @@
pkgname=nvidia-340xx-rt
pkgver=340.76
-_extramodules=extramodules-3.18-rt
+_extramodules=extramodules-4.0-rt
_kernver="$(cat /lib/modules/${_extramodules}/version)"
pkgrel=4
pkgdesc="NVIDIA 340xx drivers for linux-rt."
@@ -31,9 +31,19 @@ elif [ "$CARCH" = "x86_64" ]; then
md5sums=(SKIP )
fi
-build() {
- cd "${srcdir}"
+source+=("nv-drm.patch"
+"nvidia-4.0.patch")
+md5sums+=('2365f1405f0c7bbb8f8cd7ebd5e4e301'
+ 'f42bdf589f52d4e6c38baa5bef15eef8')
+
+prepare() {
sh "${_pkg}.run" --extract-only
+ cd "${_pkg}"
+ patch -Np0 -i "$srcdir/nv-drm.patch"
+ patch -Np0 -i "$srcdir/nvidia-4.0.patch"
+}
+
+build() {
cd "${_pkg}/kernel"
# Build module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.