Index: x11/nvidia-driver/Makefile =================================================================== --- x11/nvidia-driver/Makefile (revision 448440) +++ x11/nvidia-driver/Makefile (working copy) @@ -71,7 +71,8 @@ .else EXTRA_PATCHES= ${FILESDIR}/extra-patch-src_nvidia_Makefile \ ${FILESDIR}/extra-patch-src_nvidia_nv-freebsd.h \ - ${FILESDIR}/extra-patch-src_nvidia_nv-misc.h + ${FILESDIR}/extra-patch-src_nvidia_nv-misc.h \ + ${FILESDIR}/extra-patch-src_nvidia_nvidia_os.c NVSRC= nvidia .endif .if ${NVVERSION} >= 358.009 Index: x11/nvidia-driver/files/extra-patch-src_nvidia_Makefile =================================================================== --- x11/nvidia-driver/files/extra-patch-src_nvidia_Makefile (revision 448440) +++ x11/nvidia-driver/files/extra-patch-src_nvidia_Makefile (working copy) @@ -1,11 +1,17 @@ ---- src/nvidia/Makefile.orig 2014-04-04 23:24:59.000000000 +0200 -+++ src/nvidia/Makefile 2014-05-06 14:31:07.000000000 +0200 -@@ -24,6 +24,15 @@ +--- src/nvidia/Makefile.orig 2017-05-02 00:34:40.000000000 +0300 ++++ src/nvidia/Makefile 2017-06-04 21:44:00.043530000 +0300 +@@ -26,9 +26,25 @@ stdarg.h: @ln -s machine/stdarg.h stdarg.h -+SRCS+= opt_global.h -+.if ${MACHINE_ARCH} == "i386" && !defined(KERNBUILDDIR) ++SRCS+= opt_global.h opt_syscons.h ++.if defined(KERNBUILDDIR) ++MKDEP= -include ${KERNBUILDDIR}/opt_global.h -include ${KERNBUILDDIR}/opt_syscons.h ++.else ++CFLAGS+= -include opt_global.h -include opt_syscons.h ++MKDEP= -include opt_global.h -include opt_syscons.h ++ ++.if ${MACHINE_ARCH} == "i386" +PAE!= sed -n '/define NV_SUPPORT_PAE/p' nv-freebsd.h +.if !empty(PAE) +opt_global.h: @@ -12,7 +18,12 @@ + echo "#define PAE 1" > ${.TARGET} +.endif +.endif ++.endif + *.c: stdarg.h - beforeinstall: ${KMOD}.ko +-beforeinstall: ${KMOD}.ko ++beforeinstall_dontexecute_dontexecute: ${KMOD}.ko + + all: ${OSOBJ} + Index: x11/nvidia-driver/files/extra-patch-src_nvidia_nvidia_os.c =================================================================== --- x11/nvidia-driver/files/extra-patch-src_nvidia_nvidia_os.c (nonexistent) +++ x11/nvidia-driver/files/extra-patch-src_nvidia_nvidia_os.c (working copy) @@ -0,0 +1,67 @@ +--- src/nvidia/nvidia_os.c.orig 2017-05-01 21:17:21 UTC ++++ src/nvidia/nvidia_os.c +@@ -8,6 +8,7 @@ + * _NVRM_COPYRIGHT_END_ + */ + ++#include "opt_syscons.h" + #include "nv-misc.h" + #include "os-interface.h" + #include "nv.h" +@@ -16,7 +17,9 @@ + #include + #include + #include ++#ifdef DEV_SC + #include ++#endif + + // This bootloader metadata interface was added to metadata.h in FreeBSD 10.1 + // with commit 3a7cd99956b1 and FreeBSD 11 with commit d2c99117cd3b. +@@ -787,29 +790,32 @@ + } + } + #endif ++ ++#ifdef DEV_VT ++ /* TODO */ ++#endif ++ ++#ifdef DEV_SC + { + const sc_softc_t *sc = sc_get_softc(0, SC_KERNEL_CONSOLE); ++ const struct video_info *vi; + +- if (sc) ++ if (sc && sc->adp) + { +- const video_adapter_t *adp = sc->adp; ++ vi = &sc->adp->va_info; + +- if (adp) ++ if (vi && (vi->vi_flags & V_INFO_LINEAR)) + { +- const struct video_info *vi = &adp->va_info; +- +- if (vi && (vi->vi_flags & V_INFO_LINEAR)) +- { +- *pPhysicalAddress = vi->vi_buffer; +- *pFbWidth = vi->vi_width; +- *pFbHeight = vi->vi_height; +- *pFbDepth = vi->vi_depth; +- *pFbPitch = adp->va_line_width; +- return; +- } ++ *pPhysicalAddress = vi->vi_buffer; ++ *pFbWidth = vi->vi_width; ++ *pFbHeight = vi->vi_height; ++ *pFbDepth = vi->vi_depth; ++ *pFbPitch = sc->adp->va_line_width; ++ return; + } + } + } ++#endif + + *pPhysicalAddress = 0; + *pFbWidth = *pFbHeight = *pFbDepth = *pFbPitch = 0;