Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F140493449
D49065.id151243.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
7 KB
Referenced Files
None
Subscribers
None
D49065.id151243.diff
View Options
diff --git a/graphics/Makefile b/graphics/Makefile
--- a/graphics/Makefile
+++ b/graphics/Makefile
@@ -631,6 +631,7 @@
SUBDIR += nvidia-drm-510-kmod
SUBDIR += nvidia-drm-515-kmod
SUBDIR += nvidia-drm-61-kmod
+ SUBDIR += nvidia-drm-66-kmod
SUBDIR += nvidia-drm-kmod
SUBDIR += nvidia-texture-tools
SUBDIR += ocaml-cairo
diff --git a/graphics/nvidia-drm-510-kmod/Makefile b/graphics/nvidia-drm-510-kmod/Makefile
--- a/graphics/nvidia-drm-510-kmod/Makefile
+++ b/graphics/nvidia-drm-510-kmod/Makefile
@@ -3,7 +3,7 @@
BUILD_DEPENDS+= ${KMODDIR}/drm.ko:graphics/drm-510-kmod
RUN_DEPENDS+= ${KMODDIR}/drm.ko:graphics/drm-510-kmod
-CONFLICTS_INSTALL= nvidia-drm-515-kmod nvidia-drm-61-kmod
+CONFLICTS_INSTALL= nvidia-drm-510-kmod nvidia-drm-61-kmod nvidia-drm-66-kmod
.include "${.CURDIR}/../drm-510-kmod/Makefile.version"
.include "${.CURDIR}/../nvidia-drm-kmod/Makefile.common"
diff --git a/graphics/nvidia-drm-515-kmod/Makefile b/graphics/nvidia-drm-515-kmod/Makefile
--- a/graphics/nvidia-drm-515-kmod/Makefile
+++ b/graphics/nvidia-drm-515-kmod/Makefile
@@ -4,7 +4,7 @@
BUILD_DEPENDS+= ${KMODDIR}/drm.ko:graphics/drm-515-kmod
RUN_DEPENDS+= ${KMODDIR}/drm.ko:graphics/drm-515-kmod
-CONFLICTS_INSTALL= nvidia-drm-510-kmod nvidia-drm-61-kmod
+CONFLICTS_INSTALL= nvidia-drm-510-kmod nvidia-drm-61-kmod nvidia-drm-66-kmod
.include "${.CURDIR}/../drm-515-kmod/Makefile.version"
.include "${.CURDIR}/../nvidia-drm-kmod/Makefile.common"
diff --git a/graphics/nvidia-drm-61-kmod/Makefile b/graphics/nvidia-drm-61-kmod/Makefile
--- a/graphics/nvidia-drm-61-kmod/Makefile
+++ b/graphics/nvidia-drm-61-kmod/Makefile
@@ -3,7 +3,7 @@
BUILD_DEPENDS+= ${KMODDIR}/drm.ko:graphics/drm-61-kmod
RUN_DEPENDS+= ${KMODDIR}/drm.ko:graphics/drm-61-kmod
-CONFLICTS_INSTALL= nvidia-drm-510-kmod nvidia-drm-515-kmod
+CONFLICTS_INSTALL= nvidia-drm-510-kmod nvidia-drm-515-kmod nvidia-drm-66-kmod
.include "${.CURDIR}/../drm-61-kmod/Makefile.version"
.include "${.CURDIR}/../nvidia-drm-kmod/Makefile.common"
diff --git a/graphics/nvidia-drm-66-kmod/Makefile b/graphics/nvidia-drm-66-kmod/Makefile
new file mode 100644
--- /dev/null
+++ b/graphics/nvidia-drm-66-kmod/Makefile
@@ -0,0 +1,11 @@
+PORTNAME= nvidia-drm-66-kmod
+CATEGORIES= graphics
+
+BUILD_DEPENDS+= ${KMODDIR}/drm.ko:graphics/drm-66-kmod
+RUN_DEPENDS+= ${KMODDIR}/drm.ko:graphics/drm-66-kmod
+CONFLICTS_INSTALL= nvidia-drm-510-kmod nvidia-drm-515-kmod nvidia-drm-61-kmod
+
+.include "${.CURDIR}/../drm-66-kmod/Makefile.version"
+.include "${.CURDIR}/../nvidia-drm-kmod/Makefile.common"
+
+.include <bsd.port.mk>
diff --git a/graphics/nvidia-drm-66-kmod/distinfo b/graphics/nvidia-drm-66-kmod/distinfo
new file mode 100644
--- /dev/null
+++ b/graphics/nvidia-drm-66-kmod/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1739992459
+SHA256 (NVIDIA-FreeBSD-x86_64-550.127.05.tar.xz) = 74557d328ad74f604599ee2df3d42defc86ebe231e7cbe99c860f928f16a0bc3
+SIZE (NVIDIA-FreeBSD-x86_64-550.127.05.tar.xz) = 143641432
+SHA256 (freebsd-drm-kmod-drm_v6.6.25_1_GH0.tar.gz) = 9de65da6907e2b61b09e9836e923b48dc029e68e2cb4521c17df75f3529fa640
+SIZE (freebsd-drm-kmod-drm_v6.6.25_1_GH0.tar.gz) = 38488410
diff --git a/graphics/nvidia-drm-66-kmod/files/20-nvidia-drm-outputclass.conf.in b/graphics/nvidia-drm-66-kmod/files/20-nvidia-drm-outputclass.conf.in
new file mode 100644
--- /dev/null
+++ b/graphics/nvidia-drm-66-kmod/files/20-nvidia-drm-outputclass.conf.in
@@ -0,0 +1,8 @@
+Section "OutputClass"
+ Identifier "nvidia"
+ MatchDriver "nvidia-drm"
+ Driver "nvidia"
+ Option "PrimaryGPU" "yes"
+ ModulePath "%%LOCALBASE%%/lib/nvidia/xorg"
+ ModulePath "%%LOCALBASE%%/lib/xorg/modules"
+EndSection
diff --git a/graphics/nvidia-drm-66-kmod/files/extra-patch-nvidia-drm-conftest.h b/graphics/nvidia-drm-66-kmod/files/extra-patch-nvidia-drm-conftest.h
new file mode 100644
--- /dev/null
+++ b/graphics/nvidia-drm-66-kmod/files/extra-patch-nvidia-drm-conftest.h
@@ -0,0 +1,14 @@
+--- nvidia-drm-conftest.h.orig 2024-02-22 01:03:15 UTC
++++ nvidia-drm-conftest.h
+@@ -85,7 +85,11 @@
+
+ /* For nv_drm_gem_prime_force_fence_signal */
+ #ifndef spin_is_locked
++#if ((__FreeBSD_version >= 1500000) && (__FreeBSD_version < 1500018)) || (__FreeBSD_version < 1401501)
+ #define spin_is_locked(lock) mtx_owned(lock.m)
++#else
++#define spin_is_locked(lock) mtx_owned(lock)
++#endif
+ #endif
+
+ #ifndef rwsem_is_locked
diff --git a/graphics/nvidia-drm-66-kmod/files/extra-patch-nvidia-drm-freebsd-lkpi.c b/graphics/nvidia-drm-66-kmod/files/extra-patch-nvidia-drm-freebsd-lkpi.c
new file mode 100644
--- /dev/null
+++ b/graphics/nvidia-drm-66-kmod/files/extra-patch-nvidia-drm-freebsd-lkpi.c
@@ -0,0 +1,54 @@
+--- nvidia-drm-freebsd-lkpi.c.orig 2024-02-22 01:03:15 UTC
++++ nvidia-drm-freebsd-lkpi.c
+@@ -115,6 +115,7 @@ int nv_drm_probe_devices(void)
+ * by the native nvidia.ko by using our devclass.
+ */
+ for (int i = 0; i < NV_MAX_DEVICES; i++) {
++ struct pci_dev *pdev;
+ nv_gpu_info_t gpu_info;
+ struct nvidia_softc *sc = devclass_get_softc(nvidia_devclass, i);
+ if (!sc) {
+@@ -124,11 +125,33 @@ int nv_drm_probe_devices(void)
+ nv_state_t *nv = sc->nv_state;
+
+ /*
++ * Set the ivars for this device if they are not already populated. This
++ * is the bus specific data, and linuxkpi will try to use it.
++ */
++ if (!device_get_ivars(sc->dev)) {
++ device_t parent = device_get_parent(sc->dev);
++ struct pci_devinfo *dinfo = device_get_ivars(parent);
++ device_set_ivars(sc->dev, dinfo);
++ }
++
++ /*
+ * Now we have the state (which gives us the device_t), but what nvidia-drm
+ * wants is a pci_dev suitable for use with linuxkpi code. We can use
+- * lkpinew_pci_dev to fill in a pci_dev struct,
++ * lkpinew_pci_dev to fill in a pci_dev struct, or linux_pci_attach on more
++ * recent kernels (introduced by 253dbe7487705).
+ */
+- struct pci_dev *pdev = lkpinew_pci_dev(sc->dev);
++#if __FreeBSD_version < 1300093
++ pdev = lkpinew_pci_dev(sc->dev);
++#else
++ pdev = malloc(sizeof(*pdev), M_DEVBUF, M_WAITOK|M_ZERO);
++ if (!pdev) {
++ return -ENOMEM;
++ }
++
++ if (linux_pci_attach_device(sc->dev, NULL, NULL, pdev)) {
++ return -ENOMEM;
++ }
++#endif
+ nv_lkpi_pci_devs[i] = pdev;
+
+ gpu_info.gpu_id = nv->gpu_id;
+@@ -148,7 +171,6 @@ MODULE_DEPEND(nvidia_drm, linuxkpi, 1, 1, 1);
+ LKPI_DRIVER_MODULE(nvidia_drm, nv_drm_init, nv_drm_exit);
+ LKPI_PNP_INFO(pci, nvidia_drm, nv_module_device_table);
+ MODULE_DEPEND(nvidia_drm, linuxkpi, 1, 1, 1);
+-MODULE_DEPEND(nvidia_drm, linuxkpi_gplv2, 1, 1, 1);
+ MODULE_DEPEND(nvidia_drm, drmn, 2, 2, 2);
+ MODULE_DEPEND(nvidia_drm, dmabuf, 1, 1, 1);
+ MODULE_DEPEND(nvidia_drm, nvidia, 1, 1, 1);
diff --git a/graphics/nvidia-drm-66-kmod/pkg-descr b/graphics/nvidia-drm-66-kmod/pkg-descr
new file mode 100644
--- /dev/null
+++ b/graphics/nvidia-drm-66-kmod/pkg-descr
@@ -0,0 +1,3 @@
+FreeBSD port of Linux's nvidia-drm.ko Kernel module.
+
+This version is compatible with drm.ko 6.6.
diff --git a/graphics/nvidia-drm-66-kmod/pkg-message b/graphics/nvidia-drm-66-kmod/pkg-message
new file mode 100644
--- /dev/null
+++ b/graphics/nvidia-drm-66-kmod/pkg-message
@@ -0,0 +1,8 @@
+Modesetting must be enabled to use nvidia-drm.ko for graphics. This can be done
+by setting the modeset sysctl, the equivalent of the modeset kernel parameter
+on Linux.
+
+hw.nvidiadrm.modeset=1
+
+This must be set before loading nvdidia-drm.ko, most easily done by placing the
+above in /boot/loader.conf.
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Dec 25, 3:09 PM (7 h, 34 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
27249617
Default Alt Text
D49065.id151243.diff (7 KB)
Attached To
Mode
D49065: graphics/nvidia-drm-66-kmod: add new port
Attached
Detach File
Event Timeline
Log In to Comment