Bug 176980 - x11/nvidia-driver build fails on head @r248084
x11/nvidia-driver build fails on head @r248084
Status: Closed FIXED
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s)
Latest
Any Any
: Normal Affects Only Me
Assigned To: Sean Bruno
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-03-15 03:50 UTC by david
Modified: 2013-04-08 15:51 UTC (History)
0 users

See Also:


Attachments
file.diff (3.01 KB, patch)
2013-03-15 03:50 UTC, david
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description david 2013-03-15 03:50:00 UTC
	r248084 made some changes in src/sys/vm/vm_pager that break
	the build of ports/x11/nvidia-driver (as of r312359).

Fix: The below patch allows the port to build under both head and
	stable/9.  It is, however, possible that I've failed to get the
	OSVERSION quite right.
How-To-Repeat: 	Update ports to at least r312359 and src to at least r248084;
	while running head (10.0-CURRENT) built from those sources,
	attempt to build ports/x11/nvidia-driver (e.g., "portmaster
	x11/nvidia-driver").

	I originally wrote this as seen in
	<http://docs.FreeBSD.org/cgi/mid.cgi?20130309153454.GS13861>.
Comment 1 Edwin Groothuis freebsd_committer 2013-03-15 03:50:08 UTC
Responsible Changed
From-To: freebsd-ports-bugs->danfe

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter freebsd_committer 2013-03-16 07:30:06 UTC
Author: sbruno (src committer)
Date: Sat Mar 16 07:29:53 2013
New Revision: 314338
URL: http://svnweb.freebsd.org/changeset/ports/314338

Log:
  Resolve current build breakage on head for the nvidia driver via this nice
  handy patch from dhw@ :-)
  
  Shoveled in via src commit bit, after some discussions in #bsdports
  
  PR:		ports/176980
  Submitted by:	dhw@
  Reviewed by:	miwi@
  Approved by:	nobody in particular
  Obtained from:	dogfood
  MFC after:	2 weeks

Added:
  head/x11/nvidia-driver/files/r248084-patch-src-nv-freebsd.h   (contents, props changed)
  head/x11/nvidia-driver/files/r248084-patch-src-nvidia_subr.c   (contents, props changed)
Modified:
  head/x11/nvidia-driver/Makefile   (contents, props changed)

Modified: head/x11/nvidia-driver/Makefile
==============================================================================
--- head/x11/nvidia-driver/Makefile	Sat Mar 16 07:29:22 2013	(r314337)
+++ head/x11/nvidia-driver/Makefile	Sat Mar 16 07:29:53 2013	(r314338)
@@ -86,6 +86,10 @@ WBINVD_DESC=		Flush CPU caches directly 
 
 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]*

Added: head/x11/nvidia-driver/files/r248084-patch-src-nv-freebsd.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/x11/nvidia-driver/files/r248084-patch-src-nv-freebsd.h	Sat Mar 16 07:29:53 2013	(r314338)
@@ -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>
+ 

Added: head/x11/nvidia-driver/files/r248084-patch-src-nvidia_subr.c
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/x11/nvidia-driver/files/r248084-patch-src-nvidia_subr.c	Sat Mar 16 07:29:53 2013	(r314338)
@@ -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);
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Sean Bruno freebsd_committer 2013-04-08 15:51:08 UTC
State Changed
From-To: open->closed

Patched at svn r314338 


Comment 4 Sean Bruno freebsd_committer 2013-04-08 15:51:08 UTC
Responsible Changed
From-To: danfe->sbruno

patch commited at svn r314338