nvidia340: add patch to add DRIVER_LEGACY to nv-drm.c (#5575)

The nvidia340 legacy driver fails to load on the 4.9 kernel.
This commit adds a patch written by ejmarkow, taken from
https://devtalk.nvidia.com/default/topic/982052/linux/latest-nvidia-driver-340-101-builds-compiles-properly-but-fails-to-load-has-errors-with-linux-kernel-4-9-resolved-with-patch-/
that adds DRIVER_LEGACY to the driver features in nv-drm.c.
This commit is contained in:
Helmut Pozimski 2017-01-23 12:47:42 +01:00 committed by Alessio Sergi
parent d69de20681
commit 08b9d48fa7
2 changed files with 18 additions and 1 deletions

View file

@ -0,0 +1,14 @@
--- kernel/nv-drm.c 2016-12-15 12:41:26.000000000 +0100
+++ kernel/nv-drm.c 2016-12-15 12:58:48.000000000 +0100
@@ -115,7 +115,11 @@
};
static struct drm_driver nv_drm_driver = {
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0)
+ .driver_features = DRIVER_GEM | DRIVER_PRIME | DRIVER_LEGACY,
+#else
.driver_features = DRIVER_GEM | DRIVER_PRIME,
+#endif
.load = nv_drm_load,
.unload = nv_drm_unload,
.fops = &nv_drm_fops,

View file

@ -4,7 +4,7 @@ _desc="NVIDIA drivers (GeForce 8, 9, 9M, 100, 100M, 200, 300 series)"
pkgname=nvidia340 pkgname=nvidia340
version=340.101 version=340.101
revision=1 revision=2
maintainer="Juan RP <xtraeme@voidlinux.eu>" maintainer="Juan RP <xtraeme@voidlinux.eu>"
license="Proprietary NVIDIA license" license="Proprietary NVIDIA license"
homepage="http://www.nvidia.com" homepage="http://www.nvidia.com"
@ -37,9 +37,12 @@ do_extract() {
./${_pkg}.run --extract-only ./${_pkg}.run --extract-only
rm -f ${_pkg}.run rm -f ${_pkg}.run
} }
do_configure() { do_configure() {
cd ${_pkg} cd ${_pkg}
patch -p0 < ${FILESDIR}/patch_nv1.diff
} }
do_install() { do_install() {
cd ${_pkg} cd ${_pkg}