aboutsummaryrefslogtreecommitdiff
path: root/x11/nvidia-driver
diff options
context:
space:
mode:
authorSean Bruno <sbruno@FreeBSD.org>2013-03-16 07:29:53 +0000
committerSean Bruno <sbruno@FreeBSD.org>2013-03-16 07:29:53 +0000
commit794fdc1d52a7356bd1422eee0706831885f2bff1 (patch)
tree9b0d7ea7e4f99f8bda119accf39e3b440c27219b /x11/nvidia-driver
parentc111245040e62ac233158d650b9e8b4971f22c9d (diff)
downloadports-794fdc1d52a7356bd1422eee0706831885f2bff1.tar.gz
ports-794fdc1d52a7356bd1422eee0706831885f2bff1.zip
Notes
Diffstat (limited to 'x11/nvidia-driver')
-rw-r--r--x11/nvidia-driver/Makefile4
-rw-r--r--x11/nvidia-driver/files/r248084-patch-src-nv-freebsd.h10
-rw-r--r--x11/nvidia-driver/files/r248084-patch-src-nvidia_subr.c56
3 files changed, 70 insertions, 0 deletions
diff --git a/x11/nvidia-driver/Makefile b/x11/nvidia-driver/Makefile
index 0e6b22a2c9f6..2a73fd4d30af 100644
--- a/x11/nvidia-driver/Makefile
+++ b/x11/nvidia-driver/Makefile
@@ -86,6 +86,10 @@ WBINVD_DESC= Flush CPU caches directly with WBINVD
PLIST_SUB+= LINUXBASE=${LINUXBASE} SHLIB_VERSION=${PORTVERSION} \
MODULESDIR=${MODULESDIR}
+. if ${OSVERSION} > 1000028
+EXTRA_PATCHES+= ${FILESDIR}/r248084-patch-src-nv-freebsd.h
+EXTRA_PATCHES+= ${FILESDIR}/r248084-patch-src-nvidia_subr.c
+. endif
.if ${PORT_OPTIONS:MLINUX}
CONFLICTS= linux[-_]dri-[0-9]* linux-f10-dri-[0-9]*
diff --git a/x11/nvidia-driver/files/r248084-patch-src-nv-freebsd.h b/x11/nvidia-driver/files/r248084-patch-src-nv-freebsd.h
new file mode 100644
index 000000000000..ed695fb84ad3
--- /dev/null
+++ b/x11/nvidia-driver/files/r248084-patch-src-nv-freebsd.h
@@ -0,0 +1,10 @@
+--- src/nv-freebsd.h.orig 2013-01-14 14:38:44.000000000 -0800
++++ src/nv-freebsd.h 2013-03-09 06:36:23.000000000 -0800
+@@ -77,6 +77,7 @@
+ #include <vm/vm_object.h>
+ #include <vm/pmap.h>
+ #include <vm/vm_map.h>
++#include <sys/rwlock.h>
+ #include <vm/vm_pager.h>
+ #include <vm/uma.h>
+
diff --git a/x11/nvidia-driver/files/r248084-patch-src-nvidia_subr.c b/x11/nvidia-driver/files/r248084-patch-src-nvidia_subr.c
new file mode 100644
index 000000000000..0bd908eb0cc1
--- /dev/null
+++ b/x11/nvidia-driver/files/r248084-patch-src-nvidia_subr.c
@@ -0,0 +1,56 @@
+--- src/nvidia_subr.c.orig 2013-01-14 14:38:44.000000000 -0800
++++ src/nvidia_subr.c 2013-03-09 06:47:05.000000000 -0800
+@@ -83,7 +83,7 @@
+ if (!sc->BAR_objects[i])
+ goto failed;
+
+- VM_OBJECT_LOCK(sc->BAR_objects[i]);
++ VM_OBJECT_WLOCK(sc->BAR_objects[i]);
+ switch (i) {
+ case NV_GPU_BAR_INDEX_FB:
+ vm_object_set_memattr(sc->BAR_objects[i],
+@@ -95,7 +95,7 @@
+ VM_MEMATTR_UNCACHEABLE);
+ break;
+ }
+- VM_OBJECT_UNLOCK(sc->BAR_objects[i]);
++ VM_OBJECT_WUNLOCK(sc->BAR_objects[i]);
+ }
+ }
+
+@@ -541,9 +541,9 @@
+ goto failed;
+ }
+
+- VM_OBJECT_LOCK(sc->UD_object);
++ VM_OBJECT_WLOCK(sc->UD_object);
+ vm_object_set_memattr(sc->UD_object, VM_MEMATTR_UNCACHEABLE);
+- VM_OBJECT_UNLOCK(sc->UD_object);
++ VM_OBJECT_WUNLOCK(sc->UD_object);
+ }
+
+ nv->flags |= NV_FLAG_OPEN;
+@@ -965,9 +965,9 @@
+ goto failed;
+ }
+
+- VM_OBJECT_LOCK(at->object);
++ VM_OBJECT_WLOCK(at->object);
+ vm_object_set_memattr(at->object, attr);
+- VM_OBJECT_UNLOCK(at->object);
++ VM_OBJECT_WUNLOCK(at->object);
+
+ *private = at;
+ SLIST_INSERT_HEAD(&sc->alloc_list, at, list);
+@@ -1108,9 +1108,9 @@
+ goto failed;
+ }
+
+- VM_OBJECT_LOCK(at->object);
++ VM_OBJECT_WLOCK(at->object);
+ vm_object_set_memattr(at->object, attr);
+- VM_OBJECT_UNLOCK(at->object);
++ VM_OBJECT_WUNLOCK(at->object);
+
+ *private = at;
+ SLIST_INSERT_HEAD(&sc->alloc_list, at, list);