DragonFly BSD
DragonFly submit List (threaded) for 2004-02
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

x11/nvidia-driver fix


From: Emiel Kollof <coolvibe@xxxxxxxxxxxxxxxx>
Date: Wed, 25 Feb 2004 20:12:33 +0100

This cvs diff against the nvidia-driver port fixes compilation and
operation of the x11/nvidia-driver port. Module loads, X works, and GLX
works a treat too:

critter# glxgears
11602 frames in 5.0 seconds = 2320.400 FPS

Please test and commit. :)

Cheers,
Emiel
-- 
Index: files/patch-dfly
===================================================================
RCS file: /home/dcvs/dfports/x11/nvidia-driver/files/patch-dfly,v
retrieving revision 1.1
diff -u -r1.1 patch-dfly
--- files/patch-dfly	12 Feb 2004 00:42:24 -0000	1.1
+++ files/patch-dfly	25 Feb 2004 18:56:15 -0000
@@ -1,6 +1,18 @@
+diff -urN ./module/Makefile ../../nvidia-patched/module/Makefile
+--- ./module/Makefile	Wed May 28 18:51:52 2003
++++ ../../nvidia-patched/module/Makefile	Wed Feb 25 19:35:22 2004
+@@ -6,7 +6,7 @@
+ KMOD=		nvidia
+ SRCS=		nvidia_ctl.c nvidia_dev.c nvidia_linux.c nvidia_os.c nvidia_os_pci.c nvidia_os_registry.c nvidia_pci.c nvidia_subr.c nvidia_sysctl.c 
+ SRCS+=		device_if.h bus_if.h pci_if.h vnode_if.h
+-CFLAGS+=	-I${NVIDIA_ROOT}/src -D__KERNEL__ -DNV_MAJOR_VERSION=1 -DNV_MINOR_VERSION=0 -DNV_PATCHLEVEL=4365  -DNVCPU_X86   -DNV_BSD   -DNV_INT64_OK   -DNV_UNIX     
++CFLAGS+=	-I${NVIDIA_ROOT}/src -D__KERNEL__ -DNV_MAJOR_VERSION=1 -DNV_MINOR_VERSION=0 -DNV_PATCHLEVEL=4365  -DNVCPU_X86   -DNV_BSD   -DNV_INT64_OK   -DNV_UNIX     -Werror
+ NVOBJ=		${NVIDIA_ROOT}/obj/nv-kernel.o
+ OBJS+=		NVIDIA.o
+ NOOBJ=		true
 diff -urN ./src/nv-dragonfly.h ../../nvidia-patched/src/nv-dragonfly.h
 --- ./src/nv-dragonfly.h	Thu Jan  1 01:00:00 1970
-+++ ../../nvidia-patched/src/nv-dragonfly.h	Tue Feb 10 22:25:38 2004
++++ ../../nvidia-patched/src/nv-dragonfly.h	Wed Feb 25 19:32:38 2004
 @@ -0,0 +1,295 @@
 +/* _NVRM_COPYRIGHT_BEGIN_
 + *
@@ -299,7 +311,7 @@
 +
 diff -urN ./src/nvidia_ctl.c ../../nvidia-patched/src/nvidia_ctl.c
 --- ./src/nvidia_ctl.c	Wed May 28 18:51:52 2003
-+++ ../../nvidia-patched/src/nvidia_ctl.c	Tue Feb 10 22:14:00 2004
++++ ../../nvidia-patched/src/nvidia_ctl.c	Wed Feb 25 19:32:38 2004
 @@ -11,7 +11,11 @@
  #include "nv-misc.h"
  #include "os-interface.h"
@@ -379,7 +391,7 @@
      }
 diff -urN ./src/nvidia_dev.c ../../nvidia-patched/src/nvidia_dev.c
 --- ./src/nvidia_dev.c	Wed May 28 18:51:52 2003
-+++ ../../nvidia-patched/src/nvidia_dev.c	Tue Feb 10 22:15:53 2004
++++ ../../nvidia-patched/src/nvidia_dev.c	Wed Feb 25 19:32:38 2004
 @@ -11,7 +11,11 @@
  #include "nv-misc.h"
  #include "os-interface.h"
@@ -439,7 +451,7 @@
  int nvidia_dev_open(
 diff -urN ./src/nvidia_linux.c ../../nvidia-patched/src/nvidia_linux.c
 --- ./src/nvidia_linux.c	Wed May 28 18:51:52 2003
-+++ ../../nvidia-patched/src/nvidia_linux.c	Tue Feb 10 22:16:38 2004
++++ ../../nvidia-patched/src/nvidia_linux.c	Wed Feb 25 19:32:38 2004
 @@ -11,7 +11,11 @@
  #include "nv-misc.h"
  #include "os-interface.h"
@@ -466,7 +478,7 @@
  struct linux_ioctl_handler nvidia_handler = {
 diff -urN ./src/nvidia_os.c ../../nvidia-patched/src/nvidia_os.c
 --- ./src/nvidia_os.c	Wed May 28 18:51:52 2003
-+++ ../../nvidia-patched/src/nvidia_os.c	Tue Feb 10 22:18:50 2004
++++ ../../nvidia-patched/src/nvidia_os.c	Wed Feb 25 19:51:00 2004
 @@ -11,7 +11,11 @@
  #include "nv-misc.h"
  #include "os-interface.h"
@@ -488,9 +500,21 @@
      return suser(curproc);
  #else
      return suser(curthread);
+@@ -301,7 +305,11 @@
+             *pte |= PG_N;
+             va += PAGE_SIZE;
+         } while (va < (vm_offset_t) vm + size);
++#if defined(__FreeBSD__) && !defined(__DragonFly__)
+         invltlb();
++#else /* DragonFly BSD */
++	cpu_invltlb();
++#endif
+     }
+ 
+     return vm;
 diff -urN ./src/nvidia_os_pci.c ../../nvidia-patched/src/nvidia_os_pci.c
 --- ./src/nvidia_os_pci.c	Wed May 28 18:51:52 2003
-+++ ../../nvidia-patched/src/nvidia_os_pci.c	Tue Feb 10 22:20:42 2004
++++ ../../nvidia-patched/src/nvidia_os_pci.c	Wed Feb 25 19:32:38 2004
 @@ -11,7 +11,11 @@
  #include "nv-misc.h"
  #include "os-interface.h"
@@ -505,7 +529,7 @@
  VOID* os_pci_init_handle(
 diff -urN ./src/nvidia_os_registry.c ../../nvidia-patched/src/nvidia_os_registry.c
 --- ./src/nvidia_os_registry.c	Wed May 28 18:51:52 2003
-+++ ../../nvidia-patched/src/nvidia_os_registry.c	Tue Feb 10 22:21:20 2004
++++ ../../nvidia-patched/src/nvidia_os_registry.c	Wed Feb 25 19:32:38 2004
 @@ -11,7 +11,11 @@
  #include "nv-misc.h"
  #include "os-interface.h"
@@ -520,7 +544,7 @@
  /*
 diff -urN ./src/nvidia_pci.c ../../nvidia-patched/src/nvidia_pci.c
 --- ./src/nvidia_pci.c	Wed May 28 18:51:52 2003
-+++ ../../nvidia-patched/src/nvidia_pci.c	Tue Feb 10 22:22:11 2004
++++ ../../nvidia-patched/src/nvidia_pci.c	Wed Feb 25 19:32:38 2004
 @@ -11,7 +11,11 @@
  #include "nv-misc.h"
  #include "os-interface.h"
@@ -559,7 +583,7 @@
      status = nvidia_detach(dev);
 diff -urN ./src/nvidia_subr.c ../../nvidia-patched/src/nvidia_subr.c
 --- ./src/nvidia_subr.c	Wed May 28 18:51:52 2003
-+++ ../../nvidia-patched/src/nvidia_subr.c	Tue Feb 10 22:22:58 2004
++++ ../../nvidia-patched/src/nvidia_subr.c	Wed Feb 25 19:32:38 2004
 @@ -11,7 +11,11 @@
  #include "nv-misc.h"
  #include "os-interface.h"
@@ -624,7 +648,7 @@
  
 diff -urN ./src/nvidia_sysctl.c ../../nvidia-patched/src/nvidia_sysctl.c
 --- ./src/nvidia_sysctl.c	Wed May 28 18:51:52 2003
-+++ ../../nvidia-patched/src/nvidia_sysctl.c	Tue Feb 10 22:23:53 2004
++++ ../../nvidia-patched/src/nvidia_sysctl.c	Wed Feb 25 19:50:41 2004
 @@ -11,7 +11,11 @@
  #include "nv-misc.h"
  #include "os-interface.h"
@@ -637,3 +661,15 @@
  
  struct sysctl_ctx_list sysctl_ctx;
  
+@@ -231,7 +235,11 @@
+                  * It also doesn't make sense to to iterate over multiple
+                  * functions if this isn't a multi-function device.
+                  */
++#if defined(__FreeBSD__) && !defined(__DragonFly__)
+                 hdrtype = pci_read_config(dev, PCIR_HEADERTYPE, 1);
++#else
++                hdrtype = pci_read_config(dev, PCIR_HDRTYPE, 1);
++#endif
+ 
+                 if ((hdrtype & PCIM_MFDEV) == 0)
+                     break;


[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]