View previous topic :: View next topic |
Author |
Message |
ulenrich Veteran
Joined: 10 Oct 2010 Posts: 1480
|
Posted: Sun Dec 21, 2014 1:04 pm Post subject: linux-3.18.1 and nvidia-drivers-340.65 patch |
|
|
Trying to run linux-3.18 with proprietary nvidia-drivers-340 shows:
https://devtalk.nvidia.com/default/topic/796559/linux/kernel-3-18-warning-no-drm_driver-set_busid-implementation-provided-by-nvidia_frontend_exit_modu/
Code: | --- a/kernel/nv-drm.c 2014-11-08 00:57:53.000000000 +0100
+++ b/kernel/nv-drm.c 2014-11-13 21:03:37.589650873 +0100
@@ -128,6 +128,10 @@ static struct drm_driver nv_drm_driver =
.gem_prime_vmap = nv_gem_prime_vmap,
.gem_prime_vunmap = nv_gem_prime_vunmap,
.
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 18, 0)
+ .set_busid = drm_pci_set_busid,
+#endif
+
.name = "nvidia-drm",
.desc = "NVIDIA DRM driver",
.date = "20130102",
diff --git a/nv-frontend.c~ b/nv-frontend.c
index c8c8af1..00f0973 100644
--- a/kernel/nv-frontend.c
+++ b/kernel/nv-frontend.c
@@ -327,7 +327,7 @@ long nvidia_frontend_unlocked_ioctl(
unsigned long i_arg
)
{
- return nvidia_frontend_ioctl(file->f_dentry->d_inode, file, cmd, i_arg);
+ return nvidia_frontend_ioctl(file->f_path.dentry->d_inode, file, cmd, i_arg);
}
.
long nvidia_frontend_compat_ioctl(
@@ -336,7 +336,7 @@ long nvidia_frontend_compat_ioctl(
unsigned long i_arg
)
{
- return nvidia_frontend_ioctl(file->f_dentry->d_inode, file, cmd, i_arg);
+ return nvidia_frontend_ioctl(file->f_path.dentry->d_inode, file, cmd, i_arg);
}
.
int nvidia_frontend_mmap(
diff --git a/nv.c~ b/nv.c
index 6b31000..3db114e 100644
--- a/kernel/nv.c
+++ b/kernel/nv.c
@@ -1796,7 +1796,7 @@ nvidia_unlocked_ioctl(
unsigned long i_arg
)
{
- return nvidia_ioctl(file->f_dentry->d_inode, file, cmd, i_arg);
+ return nvidia_ioctl(file->f_path.dentry->d_inode, file, cmd, i_arg);
}
.
/*
| ... change a line beginning point to blank |
|
Back to top |
|
|
musv Advocate
Joined: 01 Dec 2002 Posts: 3337 Location: de
|
Posted: Tue Feb 03, 2015 7:58 pm Post subject: |
|
|
Tried this with gentoo-sources-3.18.5 and nvidia-drivers-340.76.
The last part of the patch in nv.c doesn't seem to exist. And even with the patch, I get the kernel panic and a freezing system. |
|
Back to top |
|
|
ulenrich Veteran
Joined: 10 Oct 2010 Posts: 1480
|
Posted: Wed Feb 04, 2015 12:03 am Post subject: |
|
|
I don't need the patch either since there is x11-drivers/nvidia-drivers-340.76
Runs well without issues using x11-base/xorg-server-1.16.3-r1 |
|
Back to top |
|
|
42n4 n00b
Joined: 10 Feb 2015 Posts: 9
|
Posted: Tue Feb 10, 2015 5:44 pm Post subject: |
|
|
After some editing it works even on the kernel 3.19. _________________ gentoo gcc 8.3.0 lto graphite, arm rpi3 7.4.0,
http://bit.ly/gen2ls |
|
Back to top |
|
|
ChrisJumper Advocate
Joined: 12 Mar 2005 Posts: 2390 Location: Germany
|
Posted: Wed Mar 11, 2015 12:50 pm Post subject: |
|
|
This is for patching the linux kernel code, or for patching parts of the nvidia drivers?
Same as musv, i don't have this files in my linux-kernel directory.
The hard part for me is that i need to use the old 340.76 drivers for my now unsupported old nvidia cards. Its a mess that nvidia don't release the "old" part for self unsupported hardware of the old drivers/specifications to the free open source driver team.
Or did they and i could safely use the nv-drivers?
Edit: Got it, this is a patch to apply for the Nvidia-drivers. The line numbers with 340.76 slightly different and the Line with the
Code: | return nvidia_ioctl(NV_FILE_INODE(file), file, cmd, i_arg); |
I had to change, as the Patch recommended to:
Code: | return nvidia_ioctl(file->f_path.dentry->d_inode, file, cmd, i_arg); |
Did not reboot now but think that this will work, because i had no compiler error. |
|
Back to top |
|
|
ulenrich Veteran
Joined: 10 Oct 2010 Posts: 1480
|
Posted: Wed Mar 11, 2015 2:11 pm Post subject: |
|
|
if linux >=3.19 then put this file to:
/etc/portage/patches/x11-drivers/nvidia-drivers-340.76/linux-3.19-nvidia.patch
Code: | --- a/kernel/nv-linux.h 2015-01-11 05:30:46.000000000 +0100
+++ b/kernel/nv-linux.h 2015-01-25 20:30:32.000000000 +0100
@@ -2000,7 +2000,11 @@
#if defined(NV_FILE_HAS_INODE)
#define NV_FILE_INODE(file) (file)->f_inode
#else
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19 , 0)
#define NV_FILE_INODE(file) (file)->f_dentry->d_inode
+#else
+#define NV_FILE_INODE(file) (file)->f_path.dentry->d_inode
+#endif
#endif
/* Stub out UVM in multi-RM builds */
|
if Linux >=4
/etc/portage/patches/x11-drivers/nvidia-drivers-340.76/linux-4.0-nvidia.patch
Code: | --- a/kernel/nv-pat.c.orig 2015-02-20 02:49:40.000000000 +0100
+++ b/kernel/nv-pat.c 2015-02-25 07:56:40.000000000 +0100
@@ -35,8 +35,13 @@
unsigned long cr0 = read_cr0();
write_cr0(((cr0 & (0xdfffffff)) | 0x40000000));
wbinvd();
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 20, 0)
*cr4 = read_cr4();
if (*cr4 & 0x80) write_cr4(*cr4 & ~0x80);
+#else
+ *cr4 = __read_cr4();
+ if (*cr4 & 0x80) __write_cr4(*cr4 & ~0x80);
+#endif
__flush_tlb();
}
@@ -46,7 +51,11 @@
wbinvd();
__flush_tlb();
write_cr0((cr0 & 0x9fffffff));
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 20, 0)
if (cr4 & 0x80) write_cr4(cr4);
+#else
+ if (cr4 & 0x80) __write_cr4(cr4);
+#endif
}
static int nv_determine_pat_mode(void)
|
The directory
/etc/portage/patches/x11-drivers/nvidia-drivers-340.76
means this only applys to nvidia-drivers-340.76 |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|