On recent CURRENT (FreeBSD 12.0-ALPHA2 #489 r338074: Sun Aug 19 23:17:39 CEST 2018 amd64), the port x11/nvidia-driver fails to compile due to recent changes: [...] --- nvidia_subr.o --- nvidia_subr.c:1131:41: error: too many arguments to function call, expected 7, have 8 sc->dma_mask, PAGE_SIZE, 0, attr); ^~~~ /usr/src/sys/vm/vm_extern.h:61:1: note: 'kmem_alloc_contig' declared here vm_offset_t kmem_alloc_contig(vm_size_t size, int flags, ^ nvidia_subr.c:1269:45: error: too many arguments to function call, expected 7, have 8 sc->dma_mask, PAGE_SIZE, 0, attr); ^~~~ /usr/src/sys/vm/vm_extern.h:61:1: note: 'kmem_alloc_contig' declared here vm_offset_t kmem_alloc_contig(vm_size_t size, int flags, ^ 2 errors generated. *** [nvidia_subr.o] Error code 1 make[4]: stopped in /usr/ports/x11/nvidia-driver/work/NVIDIA-FreeBSD-x86_64-390.77/src/nvidia
You can simply remove the first argument to kmem_alloc_contig().
I already did and that worked for me ... see the patch I supplied, I think it is due to the OSVERSION related change a bit nasty.
Created attachment 196392 [details] patch kmem_alloc_contig() This patches the call of kmem_alloc_contig() according to svn commit r338018 (kmem arena parameter gone) in nvidia_subr.c.
There will be one more change to the kmem KPI for 12.0 in the next couple of days that will likely affect this driver. Specifically, keep an eye out for a change to kmem_free(). I will followup here when that happens.
A commit references this bug: Author: glebius Date: Tue Aug 21 22:58:44 UTC 2018 New revision: 477761 URL: https://svnweb.freebsd.org/changeset/ports/477761 Log: Unbreak nVidia drivers on recent -CURRENT, after change to kmem_alloc_contig() in r338143. PR: 230780 Changes: head/x11/nvidia-driver/Makefile
Created attachment 196559 [details] Patch for kmem_free change. As alc@ noted at -current ML, now we need patch for kmem_free(). Please try attached. Built, installed and ran OK for me. Just to be clear, I didn't use regexp to reduce REINPLACE_CMD lines. All variations of 1st, obsoleted argument appears separately. Feel free to modify using regexp to commit. But should need at least 2 lines.
The Makefile has grown many parts. Wouldn't it be cleaner to have something like this as a patch to nv-freebsd.h? #if __FreeBSD_version >= 1200082 static inline void nv_kmem_free_legacy(struct vmem *vmem, vm_offset_t addr, vm_size_t size) { kmem_free(addr, size); } #define kmem_free nv_kmem_free_legacy #endif
A commit references this bug: Author: glebius Date: Fri Aug 31 19:45:04 UTC 2018 New revision: 478606 URL: https://svnweb.freebsd.org/changeset/ports/478606 Log: Unbreak nVidia drivers on recent -CURRENT, after change to kmem_free() in r338318. PR: 230780 Changes: head/x11/nvidia-driver/Makefile