Skip to content

Commit

Permalink
x11/nvidia-driver: Remove devclass from DRIVER_MODULE on recent main.
Browse files Browse the repository at this point in the history
Initialize nvidia_devclass in nvidia_modevent instead.

Reviewed by:	danfe
Differential Revision:	https://reviews.freebsd.org/D35266
  • Loading branch information
bsdjhb committed Jun 30, 2022
1 parent b12f368 commit 88501f5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
8 changes: 7 additions & 1 deletion x11/nvidia-driver/Makefile
Expand Up @@ -64,7 +64,8 @@ SUB_FILES+= nvidia.conf
SUB_FILES+= pkg-deinstall pkg-install
.endif
SUB_PATCHES= extra-patch-src-Makefile \
extra-patch-src-nv-freebsd.h
extra-patch-src-nv-freebsd.h \
extra-patch-src-nvidia_subr.c
.if ${NVVERSION} < 510.03901
SUB_PATCHES+= extra-patch-src-nvidia_dev.c \
extra-patch-src-nvidia_pci.c
Expand Down Expand Up @@ -231,6 +232,11 @@ post-patch: .SILENT
${REINPLACE_CMD} -e '/void nvidia_dev_dtor/,+8s,.*status.*,,' \
${WRKSRC}/src/${NVSRC}/nvidia_dev.c
.endif
# After src 2a99dd30dfaa, DRIVER_MODULE should not include nvidia_devclass
.if ${OSVERSION} >= 1400058
${REINPLACE_CMD} -e '/^DRIVER_MODULE/s/, nvidia_devclass//' \
${WRKSRC}/src/${NVSRC}/nvidia_pci.c
.endif
# Finally, process OPTIONS
.if ${PORT_OPTIONS:MFREEBSD_AGP}
${REINPLACE_CMD} -E 's/undef (NV_SUPPORT_OS_AGP)/define \1/' \
Expand Down
12 changes: 12 additions & 0 deletions x11/nvidia-driver/files/extra-patch-src-nvidia_subr.c.in
@@ -0,0 +1,12 @@
--- src/%%NVSRC%%/nvidia_subr.c.orig 2022-03-16 11:18:11 UTC
+++ src/%%NVSRC%%/nvidia_subr.c
@@ -727,6 +727,9 @@ int nvidia_modevent(
* time.
*/
sc = &nvidia_ctl_sc;
+#if __FreeBSD_version >= 1400058
+ nvidia_devclass = devclass_create("nvidia");
+#endif

nvidia_stack_t_zone = uma_zcreate("nvidia_stack_t", sizeof(nvidia_stack_t),
NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, 0);

0 comments on commit 88501f5

Please sign in to comment.