Bug 230780 - x11/nvidia-driver: nvidia_subr.c:1131:41: error: too many arguments to function call, expected 7, have 8
Summary: x11/nvidia-driver: nvidia_subr.c:1131:41: error: too many arguments to functi...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Gleb Smirnoff
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-20 17:19 UTC by O. Hartmann
Modified: 2018-08-31 19:45 UTC (History)
5 users (show)

See Also:
bugzilla: maintainer-feedback? (danfe)


Attachments
patch kmem_alloc_contig() (707 bytes, patch)
2018-08-20 18:47 UTC, O. Hartmann
no flags Details | Diff
Patch for kmem_free change. (1002 bytes, patch)
2018-08-26 10:02 UTC, Tomoaki AOKI
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description O. Hartmann 2018-08-20 17:19:23 UTC
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
Comment 1 Alan Cox freebsd_committer freebsd_triage 2018-08-20 18:42:45 UTC
You can simply remove the first argument to kmem_alloc_contig().
Comment 2 O. Hartmann 2018-08-20 18:46:06 UTC
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.
Comment 3 O. Hartmann 2018-08-20 18:47:42 UTC
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.
Comment 4 Alan Cox freebsd_committer freebsd_triage 2018-08-20 18:54:44 UTC
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.
Comment 5 commit-hook freebsd_committer freebsd_triage 2018-08-21 22:59:46 UTC
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
Comment 6 Tomoaki AOKI 2018-08-26 10:02:45 UTC
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.
Comment 7 Theron Tarigo 2018-08-29 08:10:25 UTC
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
Comment 8 commit-hook freebsd_committer freebsd_triage 2018-08-31 19:45:30 UTC
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