diff options
author | Matteo Bernardini <ponce@slackbuilds.org> | 2021-06-17 17:32:54 +0200 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2021-06-23 01:14:04 +0700 |
commit | c251ff3cbfce7fa49f6216b157f83e3b43fdb12e (patch) | |
tree | 79e1f54aa36b0bd977232dbe13a69f036be26afa /system | |
parent | 5def3310b3717ad88026799dc1926a0766229d85 (diff) | |
download | slackbuilds-c251ff3cbfce7fa49f6216b157f83e3b43fdb12e.tar.gz |
system/nvidia-legacy390-kernel: Patch for kernel 5.12.x.
Signed-off-by: Matteo Bernardini <ponce@slackbuilds.org>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system')
-rw-r--r-- | system/nvidia-legacy390-kernel/kernel-5.12.patch | 47 | ||||
-rw-r--r-- | system/nvidia-legacy390-kernel/nvidia-legacy390-kernel.SlackBuild | 2 |
2 files changed, 49 insertions, 0 deletions
diff --git a/system/nvidia-legacy390-kernel/kernel-5.12.patch b/system/nvidia-legacy390-kernel/kernel-5.12.patch new file mode 100644 index 0000000000..8413156bf4 --- /dev/null +++ b/system/nvidia-legacy390-kernel/kernel-5.12.patch @@ -0,0 +1,47 @@ +Taken from https://build.opensuse.org/package/view_file/X11:Drivers:Video/nvidia-gfxG04/kernel-5.12.patch +Credit to Larry Finger <Larry.Finger@lwfinger.net> +390.143 refresh and version check by JF + +Index: NVIDIA-Linux-x86_64-390.143-no-compat32/kernel/nvidia-drm/nvidia-drm-drv.c +=================================================================== +--- NVIDIA-Linux-x86_64-390.143-no-compat32.orig/kernel/nvidia-drm/nvidia-drm-drv.c ++++ NVIDIA-Linux-x86_64-390.143-no-compat32/kernel/nvidia-drm/nvidia-drm-drv.c +@@ -20,6 +20,8 @@ + * DEALINGS IN THE SOFTWARE. + */ + ++#include <linux/version.h> ++ + #include "nvidia-drm-conftest.h" /* NV_DRM_AVAILABLE and NV_DRM_DRM_GEM_H_PRESENT */ + + #include "nvidia-drm-priv.h" +@@ -737,6 +737,17 @@ static struct drm_driver nv_drm_driver = + #endif + }; + ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 12, 0) ++/* Starting with kernel 5.12, drm_gem_dumb_destroy() is no longer exported. ++ * For that reason, we need to supply a replacement version. ++ */ ++int replace_dumb_destroy(struct drm_file *file, ++ struct drm_device *dev, ++ u32 handle) ++{ ++ return drm_gem_handle_delete(file, handle); ++} ++#endif + + /* + * Update the global nv_drm_driver for the intended features. +@@ -760,7 +767,11 @@ static void nv_drm_update_drm_driver_fea + + nv_drm_driver.dumb_create = nv_drm_dumb_create; + nv_drm_driver.dumb_map_offset = nv_drm_dumb_map_offset; ++#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 12, 0) + nv_drm_driver.dumb_destroy = nv_drm_dumb_destroy; ++#else ++ nv_drm_driver.dumb_destroy = replace_dumb_destroy; ++#endif + + #if defined(NV_DRM_DRIVER_HAS_GEM_PRIME_CALLBACKS) + nv_drm_driver.gem_vm_ops = &nv_drm_gem_vma_ops; diff --git a/system/nvidia-legacy390-kernel/nvidia-legacy390-kernel.SlackBuild b/system/nvidia-legacy390-kernel/nvidia-legacy390-kernel.SlackBuild index 7e7ecd9e18..0b28ef93c8 100644 --- a/system/nvidia-legacy390-kernel/nvidia-legacy390-kernel.SlackBuild +++ b/system/nvidia-legacy390-kernel/nvidia-legacy390-kernel.SlackBuild @@ -77,6 +77,8 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; +patch -p1 < $CWD/kernel-5.12.patch + (cd kernel || exit 1 make SYSSRC=$KERNELPATH module || exit 1 ) |