Re: patch for the nVidia driver and -CURRENT

2003-02-26 Thread Maxime Henrion
Jake Burkholder wrote:
 Apparently, On Tue, Feb 25, 2003 at 10:49:16PM +0100,
   Maxime Henrion said words to the effect of;
 
  Morten Rodal wrote:
   On Tue, Feb 25, 2003 at 07:28:09PM +0100, Maxime Henrion wrote:
   [snip a lot of the patch]
@@ -1431,7 +1442,8 @@
 SLIST_FOREACH(at, sc-alloc_list, list) {
 if (offset = at-address 
 offset  at-address + at-size)
-return atop(vtophys(offset));
+*paddr = vtophys(offset);
+return 0;
 }
 
 return -1;
   
   Should the function return 0 even if the if (offset..) fails?  I have
   no clue about the nvidia kernel driver (or kernel stuff at all) but it
   seems to me that the only way the function can return -1 is if the
   list is empty.
  
  And this is consistant with what the code was doing before.  This change
  is not a functional change, it's just a necessary update due to API
  changes.
 
 I think he's referring to missing braces around the if which was changed
 from 1 statement to 2.

Damnit.  I've updated the patch at :
http://mu.org/~mux/patches/nvidia.patch

I've also added the removal of the #error in this patch, since people
have been asking me about it.

Cheers,
Maxime

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message


Re: patch for the nVidia driver and -CURRENT

2003-02-26 Thread Luis M. Zuccolo
Hello, 
I'm interested in applying this patch, because I've never done such precedure.
Is anybody able to explane me, step by step, what should I do?
Thanks in advance.

On Wednesday 26 February 2003 08:01, Maxime Henrion wrote:
 Jake Burkholder wrote:
  Apparently, On Tue, Feb 25, 2003 at 10:49:16PM +0100,
  Maxime Henrion said words to the effect of;
 
   Morten Rodal wrote:
On Tue, Feb 25, 2003 at 07:28:09PM +0100, Maxime Henrion wrote:
[snip a lot of the patch]
   
 @@ -1431,7 +1442,8 @@
  SLIST_FOREACH(at, sc-alloc_list, list) {
  if (offset = at-address 
  offset  at-address + at-size)
 -return atop(vtophys(offset));
 +*paddr = vtophys(offset);
 +return 0;
  }

  return -1;
   
Should the function return 0 even if the if (offset..) fails?  I have
no clue about the nvidia kernel driver (or kernel stuff at all) but
it seems to me that the only way the function can return -1 is if the
list is empty.
  
   And this is consistant with what the code was doing before.  This
   change is not a functional change, it's just a necessary update due to
   API changes.
 
  I think he's referring to missing braces around the if which was changed
  from 1 statement to 2.

 Damnit.  I've updated the patch at :
   http://mu.org/~mux/patches/nvidia.patch

 I've also added the removal of the #error in this patch, since people
 have been asking me about it.

 Cheers,
 Maxime

 To Unsubscribe: send mail to [EMAIL PROTECTED]
 with unsubscribe freebsd-current in the body of the message


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message


Re: patch for the nVidia driver and -CURRENT

2003-02-26 Thread Mezz bsdforums.org
I'm interested in applying this patch, because I've never done such 
precedure.
Is anybody able to explane me, step by step, what should I do?
Thanks in advance.
% tar xfvz NVIDIA_FreeBSD-1.0-3203.tar.gz
% fetch http://mu.org/~mux/patches/nvidia.patch
% patch -p0  nvidia.patch
% cd NVIDIA_FreeBSD-1.0-3203
goes on by follow the readme..
BTW: Thanks Maxime! I haven't tried it yet, because I need to update my 
-CURRENT (Feb 18) system tonight so I can use this patch.

Cheers,
Mezz
_
Protect your PC - get McAfee.com VirusScan Online  
http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message


Re: patch for the nVidia driver and -CURRENT

2003-02-26 Thread Luis M. Zuccolo
Thanks Mess

On Thursday 27 February 2003 02:55, Mezz bsdforums.org wrote:
 I'm interested in applying this patch, because I've never done such
 precedure.
 Is anybody able to explane me, step by step, what should I do?
 Thanks in advance.

 % tar xfvz NVIDIA_FreeBSD-1.0-3203.tar.gz
 % fetch http://mu.org/~mux/patches/nvidia.patch
 % patch -p0  nvidia.patch
 % cd NVIDIA_FreeBSD-1.0-3203
 goes on by follow the readme..

 BTW: Thanks Maxime! I haven't tried it yet, because I need to update my
 -CURRENT (Feb 18) system tonight so I can use this patch.

 Cheers,
 Mezz

 _
 Protect your PC - get McAfee.com VirusScan Online
 http://clinic.mcafee.com/clinic/ibuy/campaign.asp?cid=3963


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message


Re: patch for the nVidia driver and -CURRENT

2003-02-25 Thread walt
Maxime Henrion wrote:
--X1bOJ3K7DJ5YkBrT
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
	Hi all,

Recent interface changes made the nVidia driver unbuildable on -CURRENT.
The attached patch should make it work as it used to.  Please let me
know if it doesn't.
Yes!  Mwa! [Big kiss to Maxime]  Thank you!

The only thing I needed to do to make it work was to delete this line
from nv-freebsd.h:
#error This driver does not support FreeBSD 5.0/-CURRENT!

As long as you are patching you may as well patch that one also, yes?

--X1bOJ3K7DJ5YkBrT
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=nvidia.patch
diff -u NVIDIA_FreeBSD-1.0-3203/src/nv-freebsd.h nvidia/src/nv-freebsd.h
--- NVIDIA_FreeBSD-1.0-3203/src/nv-freebsd.h	Wed Oct 30 15:30:58 2002
+++ nvidia/src/nv-freebsd.h	Tue Feb 25 00:00:48 2003
@@ -86,6 +83,7 @@
 
 #if __FreeBSD_version = 50
 #include sys/mutex.h
+#include sys/filedesc.h
 #include dev/pci/pcireg.h
 #include dev/pci/pcivar.h
 
@@ -306,7 +304,8 @@
 intnvidia_open_dev   (struct nvidia_softc *);
 intnvidia_close_ctl  (dev_t, d_thread_t *);
 intnvidia_close_dev  (struct nvidia_softc *, dev_t, d_thread_t *);
-intnvidia_mmap_dev   (struct nvidia_softc *, vm_offset_t);
+intnvidia_mmap_dev   (struct nvidia_softc *, vm_offset_t,
+vm_offset_t *);
 
 #endif /* __NV_FREEBSD_H__ */
 
diff -u NVIDIA_FreeBSD-1.0-3203/src/nvidia_dev.c nvidia/src/nvidia_dev.c
--- NVIDIA_FreeBSD-1.0-3203/src/nvidia_dev.c	Wed Oct 30 15:30:58 2002
+++ nvidia/src/nvidia_dev.c	Mon Feb 24 23:59:21 2003
@@ -135,6 +135,7 @@
 int nvidia_dev_mmap(
 dev_t dev,
 vm_offset_t offset,
+vm_offset_t *paddr,
 int nprot
 )
 {
@@ -148,7 +149,7 @@
 nv = sc-nv_state;
 
 nv_lock_api(nv);
-status = nvidia_mmap_dev(sc, offset);
+status = nvidia_mmap_dev(sc, offset, paddr);
 nv_unlock_api(nv);
 
 return status;
diff -u NVIDIA_FreeBSD-1.0-3203/src/nvidia_subr.c nvidia/src/nvidia_subr.c
--- NVIDIA_FreeBSD-1.0-3203/src/nvidia_subr.c	Wed Oct 30 15:30:58 2002
+++ nvidia/src/nvidia_subr.c	Tue Feb 25 00:00:14 2003
@@ -1401,7 +1405,8 @@
 
 int nvidia_mmap_dev(
 struct nvidia_softc *sc,
-vm_offset_t offset
+vm_offset_t offset,
+vm_offset_t *paddr
 )
 {
 nv_alloc_t *at;
@@ -1412,14 +1417,20 @@
  * are physical addresses and mapped into user-space directly. We can
  * only do some basic sanity checking here.
  */
-if (IS_FB_OFFSET(nv, offset, PAGE_SIZE))
-return atop(offset);
+if (IS_FB_OFFSET(nv, offset, PAGE_SIZE)) {
+*paddr = offset; 
+return 0;
+}
 
-if (IS_REG_OFFSET(nv, offset, PAGE_SIZE))
-return atop(offset);
+if (IS_REG_OFFSET(nv, offset, PAGE_SIZE)) {
+*paddr = offset; 
+return 0;
+}
 
-if (IS_AGP_OFFSET(nv, offset, PAGE_SIZE))
-return atop(offset);
+if (IS_AGP_OFFSET(nv, offset, PAGE_SIZE)) {
+*paddr = offset; 
+return 0;
+}
 
 /*
  * If the offset does not fall into any of the relevant apertures, we
@@ -1431,7 +1442,8 @@
 SLIST_FOREACH(at, sc-alloc_list, list) {
 if (offset = at-address 
 offset  at-address + at-size)
-return atop(vtophys(offset));
+*paddr = vtophys(offset);
+return 0;
 }
 
 return -1;

--X1bOJ3K7DJ5YkBrT--


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message


Re: patch for the nVidia driver and -CURRENT

2003-02-25 Thread Morten Rodal
On Tue, Feb 25, 2003 at 07:28:09PM +0100, Maxime Henrion wrote:
[snip a lot of the patch]
 @@ -1431,7 +1442,8 @@
  SLIST_FOREACH(at, sc-alloc_list, list) {
  if (offset = at-address 
  offset  at-address + at-size)
 -return atop(vtophys(offset));
 +*paddr = vtophys(offset);
 +return 0;
  }
  
  return -1;

Should the function return 0 even if the if (offset..) fails?  I have
no clue about the nvidia kernel driver (or kernel stuff at all) but it
seems to me that the only way the function can return -1 is if the
list is empty.

-- 
Morten Rodal



pgp0.pgp
Description: PGP signature


Re: patch for the nVidia driver and -CURRENT

2003-02-25 Thread Maxime Henrion
Morten Rodal wrote:
 On Tue, Feb 25, 2003 at 07:28:09PM +0100, Maxime Henrion wrote:
 [snip a lot of the patch]
  @@ -1431,7 +1442,8 @@
   SLIST_FOREACH(at, sc-alloc_list, list) {
   if (offset = at-address 
   offset  at-address + at-size)
  -return atop(vtophys(offset));
  +*paddr = vtophys(offset);
  +return 0;
   }
   
   return -1;
 
 Should the function return 0 even if the if (offset..) fails?  I have
 no clue about the nvidia kernel driver (or kernel stuff at all) but it
 seems to me that the only way the function can return -1 is if the
 list is empty.

And this is consistant with what the code was doing before.  This change
is not a functional change, it's just a necessary update due to API
changes.

Cheers,
Maxime

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message


Re: patch for the nVidia driver and -CURRENT

2003-02-25 Thread Patrick Hartling
Does anyone have this working with GDM 2.4.1.3 on -current?  I've found 
that I can use the nvidia driver with Maxime's patch on a freshly built 
-current system as long as I don't use GDM.  If I start up GDM, the 
system freezes as soon as the nvidia logo is replaced by the GDM login 
screen.  In the end, it doesn't make any difference to me if I use GDM 
or XDM, but I would like to know if there is some existing problem with 
the accelerated nvidia driver and GDM or if my local X configuration is 
somehow broken.  Thanks.

 -Patrick

walt wrote:
Maxime Henrion wrote:

--X1bOJ3K7DJ5YkBrT
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Hi all,

Recent interface changes made the nVidia driver unbuildable on -CURRENT.
The attached patch should make it work as it used to.  Please let me
know if it doesn't.


Yes!  Mwa! [Big kiss to Maxime]  Thank you!

The only thing I needed to do to make it work was to delete this line
from nv-freebsd.h:
#error This driver does not support FreeBSD 5.0/-CURRENT!

As long as you are patching you may as well patch that one also, yes?

[patch snipped]

--
Patrick L. Hartling | Research Assistant, VRAC
[EMAIL PROTECTED]   | 2274 Howe Hall Room 2624
PGP: http://www.137.org/patrick/pgp.txt | T: +1.515.294.4916
http://www.137.org/patrick/ | http://www.vrac.iastate.edu/
To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message


Re: patch for the nVidia driver and -CURRENT

2003-02-25 Thread Joe Marcus Clarke
On Tue, 2003-02-25 at 23:45, Patrick Hartling wrote:
 Does anyone have this working with GDM 2.4.1.3 on -current?  I've found 
 that I can use the nvidia driver with Maxime's patch on a freshly built 
 -current system as long as I don't use GDM.  If I start up GDM, the 
 system freezes as soon as the nvidia logo is replaced by the GDM login 
 screen.  In the end, it doesn't make any difference to me if I use GDM 
 or XDM, but I would like to know if there is some existing problem with 
 the accelerated nvidia driver and GDM or if my local X configuration is 
 somehow broken.  Thanks.

I run gdm2 on -stable with the nVidia driver, and it does work.  So if
there's a problem, it's either with the driver on -CURRENT or in your
gdm config.  Try copying /usr/X11R6/etc/gdm/factory-gdm.conf over
/usr/X11R6/etc/gdm.conf, and see if your problem persists.

Joe

-- 
PGP Key : http://www.marcuscom.com/pgp.asc


signature.asc
Description: This is a digitally signed message part


Re: patch for the nVidia driver and -CURRENT

2003-02-25 Thread Jake Burkholder
Apparently, On Tue, Feb 25, 2003 at 10:49:16PM +0100,
Maxime Henrion said words to the effect of;

 Morten Rodal wrote:
  On Tue, Feb 25, 2003 at 07:28:09PM +0100, Maxime Henrion wrote:
  [snip a lot of the patch]
   @@ -1431,7 +1442,8 @@
SLIST_FOREACH(at, sc-alloc_list, list) {
if (offset = at-address 
offset  at-address + at-size)
   -return atop(vtophys(offset));
   +*paddr = vtophys(offset);
   +return 0;
}

return -1;
  
  Should the function return 0 even if the if (offset..) fails?  I have
  no clue about the nvidia kernel driver (or kernel stuff at all) but it
  seems to me that the only way the function can return -1 is if the
  list is empty.
 
 And this is consistant with what the code was doing before.  This change
 is not a functional change, it's just a necessary update due to API
 changes.

I think he's referring to missing braces around the if which was changed
from 1 statement to 2.

Jake

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-current in the body of the message