git: ada1f9a5cfd9 - main - graphics/nvidia-drm-61-kmod: new port

From: Gleb Popov <arrowd_at_FreeBSD.org>
Date: Tue, 20 Feb 2024 18:42:51 UTC
The branch main has been updated by arrowd:

URL: https://cgit.FreeBSD.org/ports/commit/?id=ada1f9a5cfd99523efe39ba49084fc0890653922

commit ada1f9a5cfd99523efe39ba49084fc0890653922
Author:     Austin Shafer <ashafer@badland.io>
AuthorDate: 2024-02-20 18:37:06 +0000
Commit:     Gleb Popov <arrowd@FreeBSD.org>
CommitDate: 2024-02-20 18:41:57 +0000

    graphics/nvidia-drm-61-kmod: new port
    
    Differential Revision: https://reviews.freebsd.org/D43987
---
 graphics/Makefile                                            |  1 +
 graphics/nvidia-drm-61-kmod/Makefile                         | 12 ++++++++++++
 graphics/nvidia-drm-61-kmod/distinfo                         |  5 +++++
 .../files/20-nvidia-drm-outputclass.conf.in                  |  8 ++++++++
 .../nvidia-drm-61-kmod/files/patch-nvidia-drm-freebsd-lkpi.c | 10 ++++++++++
 graphics/nvidia-drm-61-kmod/pkg-descr                        |  3 +++
 6 files changed, 39 insertions(+)

diff --git a/graphics/Makefile b/graphics/Makefile
index b5e49a6bba6f..50eb59e0f8ae 100644
--- a/graphics/Makefile
+++ b/graphics/Makefile
@@ -594,6 +594,7 @@
     SUBDIR += nurbs++
     SUBDIR += nvidia-drm-510-kmod
     SUBDIR += nvidia-drm-515-kmod
+    SUBDIR += nvidia-drm-61-kmod
     SUBDIR += nvidia-drm-kmod
     SUBDIR += nvidia-texture-tools
     SUBDIR += ocaml-cairo
diff --git a/graphics/nvidia-drm-61-kmod/Makefile b/graphics/nvidia-drm-61-kmod/Makefile
new file mode 100644
index 000000000000..c19838a0ec14
--- /dev/null
+++ b/graphics/nvidia-drm-61-kmod/Makefile
@@ -0,0 +1,12 @@
+PORTNAME=	nvidia-drm-61-kmod
+PORTVERSION=	${NVIDIA_DISTVERSION}
+PORTREVISION=	2
+CATEGORIES=	graphics
+
+RUN_DEPENDS+=	${KMODDIR}/drm.ko:graphics/drm-61-kmod
+CONFLICTS_INSTALL=	nvidia-drm-510-kmod nvidia-drm-515-kmod
+
+.include "${.CURDIR}/../drm-61-kmod/Makefile.version"
+.include "${.CURDIR}/../nvidia-drm-kmod/Makefile.common"
+
+.include <bsd.port.mk>
diff --git a/graphics/nvidia-drm-61-kmod/distinfo b/graphics/nvidia-drm-61-kmod/distinfo
new file mode 100644
index 000000000000..084e786dd0ce
--- /dev/null
+++ b/graphics/nvidia-drm-61-kmod/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1708442445
+SHA256 (amshafer-nvidia-driver-535.146.02-nvidia-drm-61-kmod-535.146.02_GH0.tar.gz) = 3dff8909f1c51ef086cc9f88574083292c51d18f13bb3708abd0f76b703807b2
+SIZE (amshafer-nvidia-driver-535.146.02-nvidia-drm-61-kmod-535.146.02_GH0.tar.gz) = 185685669
+SHA256 (freebsd-drm-kmod-drm_v6.1.69_GH0.tar.gz) = 2327b60eb403f07c9782894cff70de04920cb14a70efc565d68d4b5ad12bc5cb
+SIZE (freebsd-drm-kmod-drm_v6.1.69_GH0.tar.gz) = 37088102
diff --git a/graphics/nvidia-drm-61-kmod/files/20-nvidia-drm-outputclass.conf.in b/graphics/nvidia-drm-61-kmod/files/20-nvidia-drm-outputclass.conf.in
new file mode 100644
index 000000000000..15496138f63a
--- /dev/null
+++ b/graphics/nvidia-drm-61-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-61-kmod/files/patch-nvidia-drm-freebsd-lkpi.c b/graphics/nvidia-drm-61-kmod/files/patch-nvidia-drm-freebsd-lkpi.c
new file mode 100644
index 000000000000..5f707bd2f03d
--- /dev/null
+++ b/graphics/nvidia-drm-61-kmod/files/patch-nvidia-drm-freebsd-lkpi.c
@@ -0,0 +1,10 @@
+--- nvidia-drm-freebsd-lkpi.c.orig	2023-11-06 18:11:13 UTC
++++ nvidia-drm-freebsd-lkpi.c
+@@ -228,7 +228,6 @@ MODULE_DEPEND(nvidia_drm, linuxkpi, 1, 1, 1);
+ 
+ LKPI_DRIVER_MODULE(nvidia_drm, nv_drm_init, nv_drm_exit);
+ 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-61-kmod/pkg-descr b/graphics/nvidia-drm-61-kmod/pkg-descr
new file mode 100644
index 000000000000..7d7a2771a627
--- /dev/null
+++ b/graphics/nvidia-drm-61-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.1.