Re: [non-kernel patch] Re: bug of Nvidia (0.9.5) Drivers in 2.4 Kernel Enviroment

2001-01-06 Thread Daniel Phillips

Jared Sulem wrote:
> Driver should work after applying the following patch.  I'm not a kernel
> hacker so I don't know how good a solution this is (especially suspicious
> of the work around in os-interface.c) but X works on my machine and it has
> not crashed (yet) - have not tried any OpenGL though.
> [...]
>
>  struct vm_operations_struct nv_vm_ops = {
>  open: nv_vma_open,
>  close:nv_vma_release,
> -unmap:nv_vma_unmap,
> +nv_vma_unmap,
   ^
No... 1) Bad idea to mix named field initializers with positional  Here
you're initializing a nonexistent field  2) The unmap method is gone
from vm_operations_struct because this is now handled generically.  Just
remove it.

>  };
>  #endif

--
Daniel
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



[non-kernel patch] Re: bug of Nvidia (0.9.5) Drivers in 2.4 Kernel Enviroment

2001-01-06 Thread Jared Sulem

(replies - cc: [EMAIL PROTECTED])

Driver should work after applying the following patch.  I'm not a kernel
hacker so I don't know how good a solution this is (especially suspicious
of the work around in os-interface.c) but X works on my machine and it has
not crashed (yet) - have not tried any OpenGL though.

Apply this to the extracted tar.gz version of the driver and compile that.
Don't just try and rebuild the binary rpm from the spec file as it will
extract
the tar.gz again and all changes will be lost (there should be a tar.gz
hanging
around once the src.rpm has been installed).

diff -u NVIDIA_kernel-0.9-5/nv.c NVIDIA_kernel-0.9-5-kern2.4/nv.c
--- NVIDIA_kernel-0.9-5/nv.cSat Aug 26 01:48:38 2000
+++ NVIDIA_kernel-0.9-5-kern2.4/nv.cSat Jan  6 14:53:02 2001
@@ -84,6 +84,9 @@

 #include 

+#define mem_map_inc_count(p) atomic_inc(&(p->count))
+#define mem_map_dec_count(p) atomic_dec(&(p->count))
+
 #define LINUX_VMA_DEV(vma)  ((vma)->vm_file->f_dentry->d_inode->i_rdev)

 #ifdef KERNEL_2_3
@@ -850,7 +853,7 @@
 struct vm_operations_struct nv_vm_ops = {
 open: nv_vma_open,
 close:nv_vma_release,
-unmap:nv_vma_unmap,
+nv_vma_unmap,
 };
 #endif

diff -u NVIDIA_kernel-0.9-5/os-interface.c
NVIDIA_kernel-0.9-5-kern2.4/os-interface.c
--- NVIDIA_kernel-0.9-5/os-interface.c  Fri Sep  1 03:19:17 2000
+++ NVIDIA_kernel-0.9-5-kern2.4/os-interface.c  Sat Jan  6 14:59:36 2001
@@ -81,6 +81,9 @@

 #include 

+static inline unsigned long get_module_symbol(char *unused1, char *unused2)
{ return 0; };
+static inline void put_module_symbol(unsigned long unused) { };
+
 // registry controls

 #define NV_MODULE_NAME   "NVdriver"

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/



Re: bug of Nvidia (0.9.5) Drivers in 2.4 Kernel Enviroment

2001-01-05 Thread Cefiar

At 10:07 PM 5/01/01 +0100, Gregor Essers wrote:
> From the pre9 relaese to the final of the 2.4 Kernel i become this Errors,
>can someone help me or have someone an idea what this mean ??.
>
>I will build this with the src.rpm from Nvidia with the spec file
>
>In file included from nv.c:52:
>nv.h:131: warning: #warning This driver is not officially supported on
>post-2.2
>kernels
>nv.c: In function `nv_lock_pages':
>nv.c:556: warning: implicit declaration of function `mem_map_inc_count'
>nv.c: In function `nv_unlock_pages':
>nv.c:583: warning: implicit declaration of function `mem_map_dec_count'
>nv.c: At top level:
>nv.c:853: unknown field `unmap' specified in initializer
>nv.c:853: warning: initialization from incompatible pointer type
>make: *** [nv.o] Fehler 1
>Bad exit status from /var/tmp/rpm-tmp.37085 (%build)

You need to patch the Nvidia kernel driver to handle changes made in the 
2.4 tree. You can either:

1> Get on irc (Server: irc.openprojects.net, Channel #nvidia) and request 
the patch from there. (You need to be able to do DCC transfers for this to 
work). There is patches for 2.4.0-test1[0-3] and for 
2.4.0-[prerelease/final], so get what you need that way. The bot to request 
from is usually iCE-DCC, and you can request a list using '/msg iCE-DCC 
xdcc list' and request a file using eg: '/msg iCE-DCC xdcc send #10' (if 
you wanted file 10 that is).

2> Alternatively, if you e-mail me, I could probably forward you the patch 
or, if people don't mind too much, I could post it to the list (I'll wait 
for comments on this first!).

The patch is about 1k for test10, and about 3k for prerelease/final. 
Remember, this patches Nvidia's driver shim source code, and not the 
kernel. You could unpack the .src.rpm and add the patch to the compile 
process if you were really game, but I did it from the .tar.gz and it works 
fine for me. YMMV of course.

BTW: Common problem is that people complain that the make still gets 
includes wrong. Make sure you compile the kernel and it's modules 
completely. I compiled the kernel and modules, rebooted into the new 
kernel, and then compiled the Nvidia driver. The last step of Nvidia's make 
process (for the .tar.gz) is to actually insmod the driver to make sure it 
worked, which will probably fail on any other version of the kernel.

Of note: Nvidia have a new driver in the works, that should be much nicer 
re: kernel interface.

--
  -=[ Stuart Young (Aka Cefiar) ]=---
  | http://amarok.glasswings.com.au/ | [EMAIL PROTECTED] |
  ---

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
Please read the FAQ at http://www.tux.org/lkml/