summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2021-09-11 19:25:38 +0100
committerV3n3RiX <venerix@redcorelinux.org>2021-09-11 19:25:38 +0100
commit523581f5193f53ebc8f931285106141775efd2b9 (patch)
tree86b244d17d2a8feb657c7db4978a6ad512e02242
parent6ac2a001590357fb85d6f56e3e52c68d3e1b9220 (diff)
sys-kernel/nvidia-drivers-legacy-dkms && x11-drivers/nvidia-drivers-legacy : add linux-5.14 compat
-rw-r--r--metadata/md5-cache/sys-kernel/nvidia-drivers-legacy-dkms-390.144-r1 (renamed from metadata/md5-cache/sys-kernel/nvidia-drivers-legacy-dkms-390.144)2
-rw-r--r--metadata/md5-cache/x11-drivers/nvidia-drivers-legacy-390.144-r3 (renamed from metadata/md5-cache/x11-drivers/nvidia-drivers-legacy-390.144-r2)2
-rw-r--r--metadata/pkg_desc_index4
-rw-r--r--sys-kernel/nvidia-drivers-legacy-dkms/files/kernel-5.14.patch82
-rw-r--r--sys-kernel/nvidia-drivers-legacy-dkms/nvidia-drivers-legacy-dkms-390.144-r1.ebuild (renamed from sys-kernel/nvidia-drivers-legacy-dkms/nvidia-drivers-legacy-dkms-390.144.ebuild)1
-rw-r--r--x11-drivers/nvidia-drivers-legacy/files/kernel-5.14.patch82
-rw-r--r--x11-drivers/nvidia-drivers-legacy/nvidia-drivers-legacy-390.144-r3.ebuild (renamed from x11-drivers/nvidia-drivers-legacy/nvidia-drivers-legacy-390.144-r2.ebuild)1
7 files changed, 170 insertions, 4 deletions
diff --git a/metadata/md5-cache/sys-kernel/nvidia-drivers-legacy-dkms-390.144 b/metadata/md5-cache/sys-kernel/nvidia-drivers-legacy-dkms-390.144-r1
index ed5d66ec..f6548166 100644
--- a/metadata/md5-cache/sys-kernel/nvidia-drivers-legacy-dkms-390.144
+++ b/metadata/md5-cache/sys-kernel/nvidia-drivers-legacy-dkms-390.144-r1
@@ -9,4 +9,4 @@ RDEPEND=sys-kernel/dkms !!sys-kernel/nvidia-drivers-dkms
SLOT=0
SRC_URI=amd64? ( http://us.download.nvidia.com/XFree86/Linux-x86_64/390.144/NVIDIA-Linux-x86_64-390.144.run )
_eclasses_=desktop c0d27bf73aa08ca05b663dbd31fbef28 edos2unix 33e347e171066657f91f8b0c72ec8773 epatch 9f813bb3c47cf2e60619a663b87c5f4e estack 055c42df72f76a4f45ec92b35e83cd56 eutils dab5d8ec471d025b79c9e6906bcf3bff ltprune 4f3f2db5ce3ccbeeacdf3f94954043aa multilib 4b66d835ec72e021e359bb81eacfe988 preserve-libs dbc9f8d2d49c66467bc327fddd8317bd strip-linguas ac3ee41ee2d31d8c41a77c0838320cc7 toolchain-funcs 9ea1c67b6f8315fdc2568abb674519aa vcs-clean b690a7e9b6c497cf59326a7545df4283 wrapper 4251d4c84c25f59094fd557e0063a974
-_md5_=3ee78272c14f43bb7f09b013dfe31bb8
+_md5_=85c16e3e6bd9d110a90a9cf35f8ce0b4
diff --git a/metadata/md5-cache/x11-drivers/nvidia-drivers-legacy-390.144-r2 b/metadata/md5-cache/x11-drivers/nvidia-drivers-legacy-390.144-r3
index 2af13ad1..841e1f9f 100644
--- a/metadata/md5-cache/x11-drivers/nvidia-drivers-legacy-390.144-r2
+++ b/metadata/md5-cache/x11-drivers/nvidia-drivers-legacy-390.144-r3
@@ -12,4 +12,4 @@ RESTRICT=bindist mirror
SLOT=0
SRC_URI=amd64? ( http://http.download.nvidia.com/XFree86/Linux-x86_64/390.144/NVIDIA-Linux-x86_64-390.144.run )
_eclasses_=desktop c0d27bf73aa08ca05b663dbd31fbef28 edos2unix 33e347e171066657f91f8b0c72ec8773 epatch 9f813bb3c47cf2e60619a663b87c5f4e estack 055c42df72f76a4f45ec92b35e83cd56 eutils dab5d8ec471d025b79c9e6906bcf3bff flag-o-matic 4134b5c0fb719b9161d10bdaba9e09e5 ltprune 4f3f2db5ce3ccbeeacdf3f94954043aa multibuild 05a584848db4901c97fcd94ae7cc3a97 multilib 4b66d835ec72e021e359bb81eacfe988 multilib-build 19ec165e9adcaa4c132b9e3fe3e7f556 multilib-minimal be5919734a8448dddd49c2b26db45091 portability d1186f1e621de7b27ddcae82e6253259 preserve-libs dbc9f8d2d49c66467bc327fddd8317bd strip-linguas ac3ee41ee2d31d8c41a77c0838320cc7 toolchain-funcs 9ea1c67b6f8315fdc2568abb674519aa unpacker 928e1f35ef78ba9fc2b214e29c2b55a4 vcs-clean b690a7e9b6c497cf59326a7545df4283 wrapper 4251d4c84c25f59094fd557e0063a974
-_md5_=d95baba754fc86f3c53eea257a8fb381
+_md5_=871067e65302787e187d137e9ec3ad04
diff --git a/metadata/pkg_desc_index b/metadata/pkg_desc_index
index ee24eb0e..ccd33be3 100644
--- a/metadata/pkg_desc_index
+++ b/metadata/pkg_desc_index
@@ -71,7 +71,7 @@ sys-kernel/linux-sources-redcore 5.13.15 5.14.2: Redcore Linux Kernel Sources
sys-kernel/linux-sources-redcore-lts 5.10.63: Redcore Linux Kernel Sources (LTS)
sys-kernel/linux-sources-redcore-lts-legacy 5.4.144: Redcore Linux Kernel Sources (LTS Legacy 5.4)
sys-kernel/nvidia-drivers-dkms 470.63.01: NVIDIA driver sources for linux
-sys-kernel/nvidia-drivers-legacy-dkms 390.144: NVIDIA driver sources for linux
+sys-kernel/nvidia-drivers-legacy-dkms 390.144-r1: NVIDIA driver sources for linux
sys-kernel/rtl8821cu-dkms 5.8.1: Realtek RTL8811CU/RTL8821CU USB Wi-Fi adapter driver for Linux
sys-kernel/vhba-dkms 20190831: Virtual (SCSI) Host Bus Adapter kernel module for the CDEmu suite sources
sys-kernel/virtualbox-modules-dkms 6.1.18-r1: Kernel Modules source for Virtualbox
@@ -90,7 +90,7 @@ x11-base/xorg-drivers 1.20-r100: Meta package containing deps on all xorg driver
x11-base/xorg-server 1.20.13-r100: X.Org X servers
x11-base/xwayland 21.1.2-r100: Standalone X server running under Wayland
x11-drivers/nvidia-drivers 470.63.01: NVIDIA Accelerated Graphics Driver
-x11-drivers/nvidia-drivers-legacy 390.144-r2: NVIDIA Accelerated Graphics Driver
+x11-drivers/nvidia-drivers-legacy 390.144-r3: NVIDIA Accelerated Graphics Driver
x11-libs/gtk+ 2.24.33-r10 3.24.29-r10: Gimp ToolKit +
x11-misc/nvidia-prime 314: NVIDIA Prime Render Offload configuration and utilities
x11-misc/nvidia-settings 470.63.01: NVIDIA Linux X11 Settings Utility
diff --git a/sys-kernel/nvidia-drivers-legacy-dkms/files/kernel-5.14.patch b/sys-kernel/nvidia-drivers-legacy-dkms/files/kernel-5.14.patch
new file mode 100644
index 00000000..a4242ec7
--- /dev/null
+++ b/sys-kernel/nvidia-drivers-legacy-dkms/files/kernel-5.14.patch
@@ -0,0 +1,82 @@
+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>
+
+diff -u -p -r NVIDIA-Linux-x86_64-390.144/kernel.orig/conftest.sh NVIDIA-Linux-x86_64-390.144/kernel/conftest.sh
+--- NVIDIA-Linux-x86_64-390.144/kernel.orig/conftest.sh 2021-08-31 16:58:57.799629833 +0200
++++ NVIDIA-Linux-x86_64-390.144/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
+ }
+
+diff -u -p -r NVIDIA-Linux-x86_64-390.144/kernel.orig/nvidia/nvlink_linux.c NVIDIA-Linux-x86_64-390.144/kernel/nvidia/nvlink_linux.c
+--- NVIDIA-Linux-x86_64-390.144/kernel.orig/nvidia/nvlink_linux.c 2021-08-31 16:58:57.787629590 +0200
++++ NVIDIA-Linux-x86_64-390.144/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);
+diff -u -p -r NVIDIA-Linux-x86_64-390.144/kernel.orig/nvidia/os-interface.c NVIDIA-Linux-x86_64-390.144/kernel/nvidia/os-interface.c
+--- NVIDIA-Linux-x86_64-390.144/kernel.orig/nvidia/os-interface.c 2021-08-31 16:58:57.787629590 +0200
++++ NVIDIA-Linux-x86_64-390.144/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);
+diff -u -p -r NVIDIA-Linux-x86_64-390.144/kernel.orig/nvidia-drm/nvidia-drm-drv.c NVIDIA-Linux-x86_64-390.144/kernel/nvidia-drm/nvidia-drm-drv.c
+--- NVIDIA-Linux-x86_64-390.144/kernel.orig/nvidia-drm/nvidia-drm-drv.c 2021-08-31 16:58:57.783629508 +0200
++++ NVIDIA-Linux-x86_64-390.144/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 */
+
+diff -u -p -r NVIDIA-Linux-x86_64-390.144/kernel.orig/nvidia-drm/nvidia-drm.Kbuild NVIDIA-Linux-x86_64-390.144/kernel/nvidia-drm/nvidia-drm.Kbuild
+--- NVIDIA-Linux-x86_64-390.144/kernel.orig/nvidia-drm/nvidia-drm.Kbuild 2021-08-31 16:58:57.783629508 +0200
++++ NVIDIA-Linux-x86_64-390.144/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
diff --git a/sys-kernel/nvidia-drivers-legacy-dkms/nvidia-drivers-legacy-dkms-390.144.ebuild b/sys-kernel/nvidia-drivers-legacy-dkms/nvidia-drivers-legacy-dkms-390.144-r1.ebuild
index e95877a1..c56e28a6 100644
--- a/sys-kernel/nvidia-drivers-legacy-dkms/nvidia-drivers-legacy-dkms-390.144.ebuild
+++ b/sys-kernel/nvidia-drivers-legacy-dkms/nvidia-drivers-legacy-dkms-390.144-r1.ebuild
@@ -24,6 +24,7 @@ RDEPEND="${DEPEND}
PATCHES=(
"${FILESDIR}"/dkms.patch
+ "${FILESDIR}"/kernel-5.14.patch
)
S="${WORKDIR}/${AMD64_NV_PACKAGE}"
diff --git a/x11-drivers/nvidia-drivers-legacy/files/kernel-5.14.patch b/x11-drivers/nvidia-drivers-legacy/files/kernel-5.14.patch
new file mode 100644
index 00000000..a4242ec7
--- /dev/null
+++ b/x11-drivers/nvidia-drivers-legacy/files/kernel-5.14.patch
@@ -0,0 +1,82 @@
+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>
+
+diff -u -p -r NVIDIA-Linux-x86_64-390.144/kernel.orig/conftest.sh NVIDIA-Linux-x86_64-390.144/kernel/conftest.sh
+--- NVIDIA-Linux-x86_64-390.144/kernel.orig/conftest.sh 2021-08-31 16:58:57.799629833 +0200
++++ NVIDIA-Linux-x86_64-390.144/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
+ }
+
+diff -u -p -r NVIDIA-Linux-x86_64-390.144/kernel.orig/nvidia/nvlink_linux.c NVIDIA-Linux-x86_64-390.144/kernel/nvidia/nvlink_linux.c
+--- NVIDIA-Linux-x86_64-390.144/kernel.orig/nvidia/nvlink_linux.c 2021-08-31 16:58:57.787629590 +0200
++++ NVIDIA-Linux-x86_64-390.144/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);
+diff -u -p -r NVIDIA-Linux-x86_64-390.144/kernel.orig/nvidia/os-interface.c NVIDIA-Linux-x86_64-390.144/kernel/nvidia/os-interface.c
+--- NVIDIA-Linux-x86_64-390.144/kernel.orig/nvidia/os-interface.c 2021-08-31 16:58:57.787629590 +0200
++++ NVIDIA-Linux-x86_64-390.144/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);
+diff -u -p -r NVIDIA-Linux-x86_64-390.144/kernel.orig/nvidia-drm/nvidia-drm-drv.c NVIDIA-Linux-x86_64-390.144/kernel/nvidia-drm/nvidia-drm-drv.c
+--- NVIDIA-Linux-x86_64-390.144/kernel.orig/nvidia-drm/nvidia-drm-drv.c 2021-08-31 16:58:57.783629508 +0200
++++ NVIDIA-Linux-x86_64-390.144/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 */
+
+diff -u -p -r NVIDIA-Linux-x86_64-390.144/kernel.orig/nvidia-drm/nvidia-drm.Kbuild NVIDIA-Linux-x86_64-390.144/kernel/nvidia-drm/nvidia-drm.Kbuild
+--- NVIDIA-Linux-x86_64-390.144/kernel.orig/nvidia-drm/nvidia-drm.Kbuild 2021-08-31 16:58:57.783629508 +0200
++++ NVIDIA-Linux-x86_64-390.144/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
diff --git a/x11-drivers/nvidia-drivers-legacy/nvidia-drivers-legacy-390.144-r2.ebuild b/x11-drivers/nvidia-drivers-legacy/nvidia-drivers-legacy-390.144-r3.ebuild
index e2094b5d..d1f2fd66 100644
--- a/x11-drivers/nvidia-drivers-legacy/nvidia-drivers-legacy-390.144-r2.ebuild
+++ b/x11-drivers/nvidia-drivers-legacy/nvidia-drivers-legacy-390.144-r3.ebuild
@@ -49,6 +49,7 @@ QA_PREBUILT="opt/* usr/lib*"
PATCHES=(
"${FILESDIR}"/dkms.patch
+ "${FILESDIR}"/kernel-5.14.patch
)
S=${WORKDIR}/