From 08b9d48fa70647cbdb42fc11c94f9fae6eaefa4e Mon Sep 17 00:00:00 2001 From: Helmut Pozimski Date: Mon, 23 Jan 2017 12:47:42 +0100 Subject: [PATCH] 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. --- srcpkgs/nvidia340/files/patch_nv1.diff | 14 ++++++++++++++ srcpkgs/nvidia340/template | 5 ++++- 2 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 srcpkgs/nvidia340/files/patch_nv1.diff diff --git a/srcpkgs/nvidia340/files/patch_nv1.diff b/srcpkgs/nvidia340/files/patch_nv1.diff new file mode 100644 index 0000000000..b6dc35a2e7 --- /dev/null +++ b/srcpkgs/nvidia340/files/patch_nv1.diff @@ -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, diff --git a/srcpkgs/nvidia340/template b/srcpkgs/nvidia340/template index ca185fc5df..9b91bec5b2 100644 --- a/srcpkgs/nvidia340/template +++ b/srcpkgs/nvidia340/template @@ -4,7 +4,7 @@ _desc="NVIDIA drivers (GeForce 8, 9, 9M, 100, 100M, 200, 300 series)" pkgname=nvidia340 version=340.101 -revision=1 +revision=2 maintainer="Juan RP " license="Proprietary NVIDIA license" homepage="http://www.nvidia.com" @@ -37,9 +37,12 @@ do_extract() { ./${_pkg}.run --extract-only rm -f ${_pkg}.run } + do_configure() { cd ${_pkg} + patch -p0 < ${FILESDIR}/patch_nv1.diff } + do_install() { cd ${_pkg}