patched to fix 'Error: Driver nvidia is already registered, aborting...' [release 340.102-2mamba;Sat Aug 12 2017]

This commit is contained in:
Silvan Calarco 2024-01-06 07:46:49 +01:00
parent e96ad04555
commit 758284eda1
3 changed files with 51 additions and 2 deletions

View File

@ -0,0 +1,11 @@
--- NVIDIA-Linux-x86_64-340.102/kernel/nv.c.orig 2017-08-12 11:58:37.536676945 +0200
+++ NVIDIA-Linux-x86_64-340.102/kernel/nv.c 2017-08-12 11:59:26.101854994 +0200
@@ -1040,6 +1040,8 @@
pci_unregister_driver(&nv_pci_driver);
+ nv_unregister_procfs();
+
failed5:
rm_shutdown_rm(sp);

View File

@ -0,0 +1,28 @@
From 19996a25efb250a1b8c7d06fdb85b5462e2a7797 Mon Sep 17 00:00:00 2001
From: leigh123linux <leigh123linux@googlemail.com>
Date: Sun, 30 Jul 2017 12:16:14 +0100
Subject: [PATCH 1/4] 4.9.0_kernel
---
kernel/nv-drm.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/kernel/nv-drm.c b/kernel/nv-drm.c
index 4c1a3ae..ea9f17e 100644
--- a/kernel/nv-drm.c
+++ b/kernel/nv-drm.c
@@ -115,7 +115,11 @@ static const struct file_operations nv_drm_fops = {
};
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,
--
2.13.3

View File

@ -1,7 +1,7 @@
%define nvidia_current_ver %version %define nvidia_current_ver %version
%define nvidia_current_libver %version %define nvidia_current_libver %version
Name: nvidia_340 Name: nvidia_340
Version: 340.76 Version: 340.102
Epoch: 1 Epoch: 1
Release: 2mamba Release: 2mamba
Summary: NVIDIA proprietary accelerated drivers for the Linux Kernel Summary: NVIDIA proprietary accelerated drivers for the Linux Kernel
@ -13,6 +13,8 @@ URL: http://www.nvidia.com/object/unix.html
Source0: http://us.download.nvidia.com/XFree86/Linux-x86/%{nvidia_current_ver}/NVIDIA-Linux-x86-%{nvidia_current_ver}.run Source0: http://us.download.nvidia.com/XFree86/Linux-x86/%{nvidia_current_ver}/NVIDIA-Linux-x86-%{nvidia_current_ver}.run
Source1: http://us.download.nvidia.com/XFree86/Linux-x86_64/%{nvidia_current_ver}/NVIDIA-Linux-x86_64-%{nvidia_current_ver}.run Source1: http://us.download.nvidia.com/XFree86/Linux-x86_64/%{nvidia_current_ver}/NVIDIA-Linux-x86_64-%{nvidia_current_ver}.run
Patch0: nvidia-331.20-x86-conftest.patch Patch0: nvidia-331.20-x86-conftest.patch
Patch1: nvidia-340.102-kernel-4.9.patch
Patch2: nvidia_340-340.102-kernel-4.9-2.patch
License: no OSI Approved License: no OSI Approved
## AUTOBUILDREQ-BEGIN ## AUTOBUILDREQ-BEGIN
## AUTOBUILDREQ-END ## AUTOBUILDREQ-END
@ -120,6 +122,8 @@ sed -i "s|__UTILS_PATH__|%{_bindir}|;s|__PIXMAP_PATH__|%{_datadir}/pixmaps|" \
cd current cd current
%patch0 -p1 %patch0 -p1
%patch1 -p1
%patch2 -p1
cd .. cd ..
%build %build
@ -303,7 +307,7 @@ exit 0
%preun -n xorg-drv-video-%{name} %preun -n xorg-drv-video-%{name}
# erase # erase
dkms remove -q -m nvidia -v %{version} --all dkms remove -q -m %{name} -v %{version} --all
if [ $1 -eq 0 ]; then if [ $1 -eq 0 ]; then
# update-alternatives \ # update-alternatives \
# --remove libXvMCNVIDIA_dynamic.so %{_libdir}/libXvMCNVIDIA_current_so # --remove libXvMCNVIDIA_dynamic.so %{_libdir}/libXvMCNVIDIA_current_so
@ -418,6 +422,12 @@ exit 0
%doc current/{LICENSE,NVIDIA_Changelog,README.txt} current/html %doc current/{LICENSE,NVIDIA_Changelog,README.txt} current/html
%changelog %changelog
* Sat Aug 12 2017 Silvan Calarco <silvan.calarco@mambasoft.it> 340.102-2mamba
- patched to fix 'Error: Driver nvidia is already registered, aborting...'
* Sun Aug 06 2017 Silvan Calarco <silvan.calarco@mambasoft.it> 340.102-1mamba
- update to 340.102
* Thu May 28 2015 Silvan Calarco <silvan.calarco@mambasoft.it> 340.76-2mamba * Thu May 28 2015 Silvan Calarco <silvan.calarco@mambasoft.it> 340.76-2mamba
- CLUTTER_BACKEND workaround to fix Gnome >= 3.16 apps - CLUTTER_BACKEND workaround to fix Gnome >= 3.16 apps