forked from freebsd/freebsd-ports
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
x11/nvidia-driver: kernel module fails on vt() to load: link_elf_obj:…
… symbol sc_get_softc undefined https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=216050 regression: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=214769 kernel: KLD nvidia-modeset.ko: depends on nvidia - not available or version mismatch kernel: linker_load_file: Unsupported file type kernel: link_elf_obj: symbol sc_get_softc undefined kernel: linker_load_file: Unsupported file type FreeBSD rimwks 11.0-STABLE FreeBSD 11.0-STABLE freebsd#1 r312105M: Sat Jan 14 05:59:46 MSK 2017 I try to rewrite patch to make it respect kernel options, but it is undone: 1. No code for VT 2. Make does not get DEV_SC and DEV_VT from opt_syscons.h - it is empty, and does not included from ${KERNBUILDDIR}.
- Loading branch information
Showing
3 changed files
with
84 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,29 @@ | ||
--- src/%%NVSRC%%/Makefile.orig 2017-09-14 20:46:30 UTC | ||
+++ src/%%NVSRC%%/Makefile | ||
@@ -30,6 +30,15 @@ NOOBJ= true | ||
@@ -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: | ||
+ echo "#define PAE 1" > ${.TARGET} | ||
+.endif | ||
+.endif | ||
+.endif | ||
+ | ||
*.c: stdarg.h | ||
|
||
beforeinstall: ${KMOD}.ko | ||
-beforeinstall: ${KMOD}.ko | ||
+beforeinstall_dontexecute_dontexecute: ${KMOD}.ko | ||
|
||
all: ${OSOBJ} | ||
|
67 changes: 67 additions & 0 deletions
67
x11/nvidia-driver/files/extra-patch-src_nvidia_nvidia_os.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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" | ||
@@ -17,7 +18,9 @@ | ||
#include <sys/fbio.h> | ||
#include <sys/linker.h> | ||
#include <sys/timex.h> | ||
+#ifdef DEV_SC | ||
#include <dev/syscons/syscons.h> | ||
+#endif | ||
|
||
// This bootloader metadata interface was added to metadata.h in FreeBSD 10.1 | ||
// with commit 3a7cd99956b1 and FreeBSD 11 with commit d2c99117cd3b. | ||
@@ -800,29 +803,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; |