public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: NVidia driver with 2.5
@ 2002-02-19 21:51 Nicholas Petreley
  0 siblings, 0 replies; 5+ messages in thread
From: Nicholas Petreley @ 2002-02-19 21:51 UTC (permalink / raw)
  To: Dave Jones, linux-kernel

I haven't tried the NVidia driver with the latest 2.5 kernels but I had 
no problem modifying nv.c and making the driver work with earlier diffs. 
The trick is to just fudge the code in os-interface.c to make it 
compile, and then configure XF86Config-4 not to use the NVidia agp 
driver (use the kernel agpgart instead). That way the fudged 
os-interface.c code doesn't even get called, as far as I know. It worked 
for me (at least, as I said, as of a few diffs ago).

Don't even try to use the bogus os-interface.c changes by activating 
NV's agp or it will bomb, and I take no responsibility for the damage. 
 In fact, I take no responsibility for the damage no matter what you do 
with this info. ;-)

Having said all that, I use 2.4.18-rc2-ac1, which only requires a few 
modifications (IIRC, just the minor() stuff).  But here are some diffs 
against NVidia drivers 2314 for those who are suicidal or just curious.


--- nv.c.original    Wed Jan 16 09:47:27 2002
+++ nv.c.vma    Mon Jan 28 17:05:26 2002
@@ -1146,11 +1146,11 @@
 
     /* for control device, just jump to its open routine */
     /* after setting up the private data */
-    if (NV_DEVICE_IS_CONTROL_DEVICE(inode->i_rdev))
+    if (NV_DEVICE_IS_CONTROL_DEVICE(minor(inode->i_rdev)))
         return nv_kern_ctl_open(inode, file);
 
     /* what device are we talking about? */
-    devnum = NV_DEVICE_NUMBER(inode->i_rdev);
+    devnum = NV_DEVICE_NUMBER(minor(inode->i_rdev));
     if (devnum >= NV_MAX_DEVICES)
     {
         rc = -ENODEV;
@@ -1257,7 +1257,7 @@
 
     /* for control device, just jump to its open routine */
     /* after setting up the private data */
-    if (NV_DEVICE_IS_CONTROL_DEVICE(inode->i_rdev))
+    if (NV_DEVICE_IS_CONTROL_DEVICE(minor(inode->i_rdev)))
         return nv_kern_ctl_close(inode, file);
 
     NV_DMSG(nv, "close");
@@ -1383,7 +1383,7 @@
 #if defined(IA64)
         vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
 #endif
-        if (remap_page_range(vma->vm_start,
+        if (remap_page_range(vma, vma->vm_start,
                              (u32) (nv->reg_physical_address) + 
LINUX_VMA_OFFS(vma) - NV_MMAP_REG_OFFSET,
                              vma->vm_end - vma->vm_start,
                              vma->vm_page_prot))
@@ -1400,7 +1400,7 @@
 #if defined(IA64)
         vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
 #endif
-        if (remap_page_range(vma->vm_start,
+        if (remap_page_range(vma, vma->vm_start,
                              (u32) (nv->fb_physical_address) + 
LINUX_VMA_OFFS(vma) - NV_MMAP_FB_OFFSET,
                              vma->vm_end - vma->vm_start,
                              vma->vm_page_prot))
@@ -1435,7 +1435,7 @@
         while (pages--)
         {
             page = (unsigned long) at->page_table[i++];
-            if (remap_page_range(start, page, PAGE_SIZE, PAGE_SHARED))
+            if (remap_page_range(vma, start, page, PAGE_SIZE, PAGE_SHARED))
                   return -EAGAIN;
             start += PAGE_SIZE;
             pos += PAGE_SIZE;

=================================================

--- os-interface.c.original    Mon Feb  4 22:42:44 2002
+++ os-interface.c.vma    Thu Jan 31 23:35:59 2002
@@ -1446,7 +1446,7 @@
     uaddr = *priv;
 
     /* finally, let's do it! */
-    err = remap_page_range( (size_t) uaddr, (size_t) paddr, size_bytes,
+    err = remap_page_range(uaddr, (size_t) uaddr, (size_t) paddr, 
size_bytes,
                             PAGE_SHARED);
 
     if (err != 0)
@@ -1474,7 +1474,7 @@
     uaddr = *priv;
 
     /* finally, let's do it! */
-    err = remap_page_range( (size_t) uaddr, (size_t) start, size_bytes,
+    err = remap_page_range(uaddr, (size_t) uaddr, (size_t) start, 
size_bytes,
                             PAGE_SHARED);
 
     if (err != 0)
@@ -2027,7 +2027,7 @@
 
     agp_addr = agpinfo.aper_base + (agp_data->offset << PAGE_SHIFT);
 
-    err = remap_page_range(vma->vm_start, (size_t) agp_addr,
+    err = remap_page_range(vma, vma->vm_start, (size_t) agp_addr,
                            agp_data->num_pages << PAGE_SHIFT,
 #if defined(IA64)
                            vma->vm_page_prot);




-Nicholas Petreley



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: NVidia driver with 2.5
       [not found] <fa.fhm0v6v.d02k8d@ifi.uio.no>
@ 2002-02-20  8:25 ` Giacomo Catenazzi
  2002-02-20  8:34   ` Arjan van de Ven
  0 siblings, 1 reply; 5+ messages in thread
From: Giacomo Catenazzi @ 2002-02-20  8:25 UTC (permalink / raw)
  To: nicholas; +Cc: Dave Jones, linux-kernel

Nicholas Petreley wrote:

> I haven't tried the NVidia driver with the latest 2.5 kernels but I had 
> no problem modifying nv.c and making the driver work with earlier diffs. 
> The trick is to just fudge the code in os-interface.c to make it 
> compile, and then configure XF86Config-4 not to use the NVidia agp 
> driver (use the kernel agpgart instead). That way the fudged 
> os-interface.c code doesn't even get called, as far as I know. It worked 
> for me (at least, as I said, as of a few diffs ago).
> 
> Don't even try to use the bogus os-interface.c changes by activating 
> NV's agp or it will bomb, and I take no responsibility for the damage. 
> In fact, I take no responsibility for the damage no matter what you do 
> with this info. ;-)
> 
> Having said all that, I use 2.4.18-rc2-ac1, which only requires a few 
> modifications (IIRC, just the minor() stuff).  But here are some diffs 
> against NVidia drivers 2314 for those who are suicidal or just curious.
> 
> 
> --- nv.c.original    Wed Jan 16 09:47:27 2002
> +++ nv.c.vma    Mon Jan 28 17:05:26 2002
> 
> --- os-interface.c.original    Mon Feb  4 22:42:44 2002
> +++ os-interface.c.vma    Thu Jan 31 23:35:59 2002

Put explicity that your code is GPL, so that we can use it
(private use we can link with all code), but nvidia cannot
use your work unless they release the source.

	giacomo


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: NVidia driver with 2.5
  2002-02-20  8:25 ` Giacomo Catenazzi
@ 2002-02-20  8:34   ` Arjan van de Ven
  2002-02-20 10:30     ` Dr. Keith G. Bowden
  0 siblings, 1 reply; 5+ messages in thread
From: Arjan van de Ven @ 2002-02-20  8:34 UTC (permalink / raw)
  To: Giacomo Catenazzi, linux-kernel


> Put explicity that your code is GPL, so that we can use it
> (private use we can link with all code), but nvidia cannot
> use your work unless they release the source.

Since the nvidia driver is not gpl in the first place, the patch
is most likely in violation of nvidia's license already. Maybe they
let it go but... if they were mean and evil they could sue the guy
who posted the patch in the first place.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: NVidia driver with 2.5
  2002-02-20  8:34   ` Arjan van de Ven
@ 2002-02-20 10:30     ` Dr. Keith G. Bowden
  0 siblings, 0 replies; 5+ messages in thread
From: Dr. Keith G. Bowden @ 2002-02-20 10:30 UTC (permalink / raw)
  To: arjanv, Giacomo Catenazzi, linux-kernel

Hi,

I have unsubscribed to the list because I am only interested in the stuff
about nvidia.

Is there another list for this?

(Reply direct to me.)

Keith


-----------------------------------------------------
Click here for Free Video!!
http://www.gohip.com/free_video/

----- Original Message -----
From: Arjan van de Ven <arjanv@redhat.com>
To: Giacomo Catenazzi <cate@debian.org>; <linux-kernel@vger.kernel.org>
Sent: Wednesday, February 20, 2002 8:34 AM
Subject: Re: NVidia driver with 2.5


>
> > Put explicity that your code is GPL, so that we can use it
> > (private use we can link with all code), but nvidia cannot
> > use your work unless they release the source.
>
> Since the nvidia driver is not gpl in the first place, the patch
> is most likely in violation of nvidia's license already. Maybe they
> let it go but... if they were mean and evil they could sue the guy
> who posted the patch in the first place.
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: NVidia driver with 2.5
@ 2002-02-20 17:58 Nicholas Petreley
  0 siblings, 0 replies; 5+ messages in thread
From: Nicholas Petreley @ 2002-02-20 17:58 UTC (permalink / raw)
  To: linux-kernel

>
> Since the nvidia driver is not gpl in the first place, the patch
> is most likely in violation of nvidia's license already. Maybe they
> let it go but... if they were mean and evil they could sue the guy
> who posted the patch in the first place.
> -

ROFL! Such paranoia!  

I doubt NVidia would sue. It's not just a case of being nice or 
mean, good or evil.  They have to feel as if the company was damaged 
in some way by the patch, or make a case that there was the potential 
for damage. Then they'd have to see if I have enough money to make it 
worth their while to sue.  If I didn't have enough money (and I don't), 
they'd evaluate whether I did anything that threatened their IP (such
as reverse engineering their binary to figure out how to come up with 
the patch).  Clearly that's not what this patch is all about. 

The only thing left is a "test case" to discourage anyone from messing
with their source code.  Somehow I just don't get the feeling that 
they're going to pursue a test case in order to discourage people 
from helping expand the number of potential customers for their 
hardware. ;-)

If I'm wrong, then bring on the lawyers!  That would give me LOTs of 
good column material. 

-Nicholas Petreley







^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-02-20 17:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-02-20 17:58 NVidia driver with 2.5 Nicholas Petreley
     [not found] <fa.fhm0v6v.d02k8d@ifi.uio.no>
2002-02-20  8:25 ` Giacomo Catenazzi
2002-02-20  8:34   ` Arjan van de Ven
2002-02-20 10:30     ` Dr. Keith G. Bowden
  -- strict thread matches above, loose matches on Subject: below --
2002-02-19 21:51 Nicholas Petreley

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox