summaryrefslogtreecommitdiff
path: root/graphics/nvidia-drm-61-kmod/files/patch-nvidia-drm-freebsd-lkpi.c-20250918-01
diff options
context:
space:
mode:
Diffstat (limited to 'graphics/nvidia-drm-61-kmod/files/patch-nvidia-drm-freebsd-lkpi.c-20250918-01')
-rw-r--r--graphics/nvidia-drm-61-kmod/files/patch-nvidia-drm-freebsd-lkpi.c-20250918-0147
1 files changed, 47 insertions, 0 deletions
diff --git a/graphics/nvidia-drm-61-kmod/files/patch-nvidia-drm-freebsd-lkpi.c-20250918-01 b/graphics/nvidia-drm-61-kmod/files/patch-nvidia-drm-freebsd-lkpi.c-20250918-01
new file mode 100644
index 000000000000..c703950a0c88
--- /dev/null
+++ b/graphics/nvidia-drm-61-kmod/files/patch-nvidia-drm-freebsd-lkpi.c-20250918-01
@@ -0,0 +1,47 @@
+--- nvidia-drm-freebsd-lkpi.c.orig 2025-08-27 17:59:14 UTC
++++ nvidia-drm-freebsd-lkpi.c
+@@ -104,6 +104,35 @@ lkpinew_pci_dev(device_t dev)
+ * FreeBSD linuxkpi based loading support code.
+ *************************************************************************/
+
++static int
++dummy_nv_pci_probe(struct pci_dev *pci_dev __unused,
++ const struct pci_device_id *id_table __unused)
++{
++ return (0);
++}
++
++static void
++dummy_nv_pci_remove(struct pci_dev *pci_dev __unused)
++{
++}
++
++static void
++dummy_nv_pci_shutdown(struct pci_dev *pci_dev __unused)
++{
++}
++
++struct pci_driver nv_pci_driver = {
++ .name = "drmn",
++ .id_table = nv_pci_table,
++ .probe = dummy_nv_pci_probe,
++ .remove = dummy_nv_pci_remove,
++ .shutdown = dummy_nv_pci_shutdown,
++#if defined(__FreeBSD__)
++ /* FreeBSD internal/specifc. */
++ .isdrm = true,
++#endif
++};
++
+ static struct pci_dev *nv_lkpi_pci_devs[NV_MAX_DEVICES];
+
+ int nv_drm_probe_devices(void)
+@@ -153,7 +182,7 @@ int nv_drm_probe_devices(void)
+ return -ENOMEM;
+ }
+
+- if (linux_pci_attach_device(sc->dev, NULL, NULL, pdev)) {
++ if (linux_pci_attach_device(sc->dev, &nv_pci_driver, NULL, pdev)) {
+ NV_DRM_LOG_ERR("Failed to attach linuxkpi PCI device");
+ free(pdev, M_DEVBUF);
+ return -ENOMEM;