diff --git a/srcpkgs/nvidia304/files/drm-driver-legacy.patch b/srcpkgs/nvidia304/files/drm-driver-legacy.patch new file mode 100644 index 00000000000..a38e10ddbf2 --- /dev/null +++ b/srcpkgs/nvidia304/files/drm-driver-legacy.patch @@ -0,0 +1,20 @@ +Author: Luca Boccassi +Description: Fix kernel module load on 4.9 and greater + From kernel 4.9 and newer (commit fa5386459f06) non-modesetting drivers have + to use the DRM flag DRIVER_LEGACY. Without this flag the kernel module does + not load correctly. + +--- kernel/nv-drm.c ++++ kernel/nv-drm.c +@@ -71,7 +71,11 @@ + }; + + static struct drm_driver nv_drm_driver = { ++#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 9, 0) + .driver_features = 0, ++#else ++ .driver_features = DRIVER_LEGACY, ++#endif + .load = nv_drm_load, + .unload = nv_drm_unload, + .fops = &nv_drm_fops, diff --git a/srcpkgs/nvidia304/template b/srcpkgs/nvidia304/template index 9ee00b603ba..ceffe053fc4 100644 --- a/srcpkgs/nvidia304/template +++ b/srcpkgs/nvidia304/template @@ -3,7 +3,7 @@ _desc="NVIDIA drivers (For GeForce 5 FX, 6, 7, 8 series)" pkgname=nvidia304 version=304.135 -revision=2 +revision=3 maintainer="Juan RP " license="Proprietary NVIDIA license" homepage="http://www.nvidia.com" @@ -38,6 +38,7 @@ do_extract() { do_configure() { cd ${_pkg} patch -sNp0 -i ${FILESDIR}/disable-mtrr.patch + patch -sNp0 -i ${FILESDIR}/drm-driver-legacy.patch patch -sNp0 -i ${FILESDIR}/kernel_4.10.patch } do_install() {