mirror of
https://github.com/void-linux/void-packages.git
synced 2025-06-08 16:13:50 +02:00
nvidia390: add patch for linux5.14
This commit is contained in:
parent
21133bed6b
commit
74f1623262
2 changed files with 83 additions and 1 deletions
77
srcpkgs/nvidia390/files/linux-5.14.patch
Normal file
77
srcpkgs/nvidia390/files/linux-5.14.patch
Normal file
|
@ -0,0 +1,77 @@
|
||||||
|
Taken from https://build.opensuse.org/package/view_file/X11:Drivers:Video/nvidia-gfxG04/kernel-5.14.patch?rev=233
|
||||||
|
Credit to Stefan Dirsch <sndirsch@suse.com>
|
||||||
|
|
||||||
|
--- a/VIDIA-Linux-x86_64-390.144-no-compat32/kernel/conftest.sh 2021-08-31 16:58:57.799629833 +0200
|
||||||
|
+++ b/NVIDIA-Linux-x86_64-390.144-no-compat32/kernel/conftest.sh 2021-08-31 18:00:09.257825534 +0200
|
||||||
|
@@ -4493,6 +4493,30 @@ compile_test() {
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
+ drm_device_has_pdev)
|
||||||
|
+ #
|
||||||
|
+ # Determine if the 'drm_device' structure has a 'pdev' field.
|
||||||
|
+ #
|
||||||
|
+ # Removed by commit b347e04452ff ("drm: Remove pdev field from
|
||||||
|
+ # struct drm_device") in v5.14-rc1.
|
||||||
|
+ #
|
||||||
|
+ CODE="
|
||||||
|
+ #if defined(NV_DRM_DRMP_H_PRESENT)
|
||||||
|
+ #include <drm/drmP.h>
|
||||||
|
+ #endif
|
||||||
|
+
|
||||||
|
+ #if defined(NV_DRM_DRM_DEVICE_H_PRESENT)
|
||||||
|
+ #include <drm/drm_device.h>
|
||||||
|
+ #endif
|
||||||
|
+
|
||||||
|
+ int conftest_drm_device_has_pdev(void) {
|
||||||
|
+ return offsetof(struct drm_device, pdev);
|
||||||
|
+ }"
|
||||||
|
+
|
||||||
|
+ compile_check_conftest "$CODE" "NV_DRM_DEVICE_HAS_PDEV" "" "types"
|
||||||
|
+ ;;
|
||||||
|
+
|
||||||
|
+
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
--- a/NVIDIA-Linux-x86_64-390.144-no-compat32/kernel/nvidia/nvlink_linux.c 2021-08-31 16:58:57.787629590 +0200
|
||||||
|
+++ b/NVIDIA-Linux-x86_64-390.144-no-compat32/kernel/nvidia/nvlink_linux.c 2021-08-31 17:51:49.207744327 +0200
|
||||||
|
@@ -597,7 +597,7 @@ void NVLINK_API_CALL nvlink_sleep(unsign
|
||||||
|
// the requested timeout has expired, loop until less
|
||||||
|
// than a jiffie of the desired delay remains.
|
||||||
|
//
|
||||||
|
- current->state = TASK_INTERRUPTIBLE;
|
||||||
|
+ set_current_state(TASK_INTERRUPTIBLE);
|
||||||
|
do
|
||||||
|
{
|
||||||
|
schedule_timeout(jiffies);
|
||||||
|
--- a/NVIDIA-Linux-x86_64-390.144-no-compat32/kernel/nvidia/os-interface.c 2021-08-31 16:58:57.787629590 +0200
|
||||||
|
+++ b/NVIDIA-Linux-x86_64-390.144-no-compat32/kernel/nvidia/os-interface.c 2021-08-31 17:51:58.043922420 +0200
|
||||||
|
@@ -580,7 +580,7 @@ NV_STATUS NV_API_CALL os_delay(NvU32 Mil
|
||||||
|
// the requested timeout has expired, loop until less
|
||||||
|
// than a jiffie of the desired delay remains.
|
||||||
|
//
|
||||||
|
- current->state = TASK_INTERRUPTIBLE;
|
||||||
|
+ set_current_state(TASK_INTERRUPTIBLE);
|
||||||
|
do
|
||||||
|
{
|
||||||
|
schedule_timeout(jiffies);
|
||||||
|
--- a/NVIDIA-Linux-x86_64-390.144-no-compat32/kernel/nvidia-drm/nvidia-drm-drv.c 2021-08-31 16:58:57.783629508 +0200
|
||||||
|
+++ b/NVIDIA-Linux-x86_64-390.144-no-compat32/kernel/nvidia-drm/nvidia-drm-drv.c 2021-08-31 17:56:41.345633279 +0200
|
||||||
|
@@ -811,7 +811,9 @@ static void nv_drm_register_drm_device(c
|
||||||
|
|
||||||
|
dev->dev_private = nv_dev;
|
||||||
|
nv_dev->dev = dev;
|
||||||
|
+#if defined(NV_DRM_DEVICE_HAS_PDEV)
|
||||||
|
dev->pdev = pdev;
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
/* Register DRM device to DRM sub-system */
|
||||||
|
|
||||||
|
--- a/NVIDIA-Linux-x86_64-390.144-no-compat32/kernel/nvidia-drm/nvidia-drm.Kbuild 2021-08-31 16:58:57.783629508 +0200
|
||||||
|
+++ b/NVIDIA-Linux-x86_64-390.144-no-compat32/kernel/nvidia-drm/nvidia-drm.Kbuild 2021-08-31 17:53:18.265539346 +0200
|
||||||
|
@@ -102,3 +102,4 @@ NV_CONFTEST_TYPE_COMPILE_TESTS += drm_dr
|
||||||
|
NV_CONFTEST_TYPE_COMPILE_TESTS += drm_crtc_atomic_check_has_atomic_state_arg
|
||||||
|
NV_CONFTEST_TYPE_COMPILE_TESTS += drm_gem_object_vmap_has_map_arg
|
||||||
|
NV_CONFTEST_TYPE_COMPILE_TESTS += drm_plane_atomic_check_has_atomic_state_arg
|
||||||
|
+NV_CONFTEST_TYPE_COMPILE_TESTS += drm_device_has_pdev
|
|
@ -4,7 +4,7 @@ _desc="NVIDIA drivers (GeForce 400, 500 series)"
|
||||||
|
|
||||||
pkgname=nvidia390
|
pkgname=nvidia390
|
||||||
version=390.144
|
version=390.144
|
||||||
revision=1
|
revision=2
|
||||||
maintainer="Andrew Benson <abenson+void@gmail.com>"
|
maintainer="Andrew Benson <abenson+void@gmail.com>"
|
||||||
license="custom:NVIDIA Proprietary"
|
license="custom:NVIDIA Proprietary"
|
||||||
homepage="https://www.nvidia.com"
|
homepage="https://www.nvidia.com"
|
||||||
|
@ -39,6 +39,11 @@ do_extract() {
|
||||||
cd ${_pkg}
|
cd ${_pkg}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
do_patch() {
|
||||||
|
cd "${wrksrc}/${_pkg}"
|
||||||
|
patch -Np2 < $FILESDIR/linux-5.14.patch
|
||||||
|
}
|
||||||
|
|
||||||
pre_install() {
|
pre_install() {
|
||||||
cd ${_pkg}
|
cd ${_pkg}
|
||||||
cp nvidia_icd.json.template nvidia_icd.json
|
cp nvidia_icd.json.template nvidia_icd.json
|
||||||
|
|
Loading…
Add table
Reference in a new issue