aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorAustin Shafer <ashafer@badland.io>2023-08-18 14:31:22 +0000
committerGleb Popov <arrowd@FreeBSD.org>2023-08-20 17:54:07 +0000
commit4754e9fd33c4fae0359a272d72d9aa7fe75c7a82 (patch)
treeb998e4670e75f71af0f9beb9ac9f54dae2a9d9c7 /graphics
parentc078575487b62a1dd2b6c5874ccc37898b87a1d2 (diff)
downloadports-4754e9fd33c4fae0359a272d72d9aa7fe75c7a82.tar.gz
ports-4754e9fd33c4fae0359a272d72d9aa7fe75c7a82.zip
graphics/nvidia-drm-[510,515]-kmod: Add the port.
This port provides the nvidia-drm.ko kernel module, as ported here: https://github.com/amshafer/nvidia-driver This module implements the DRM API, which is commonly used for PRIME and Wayland setups. Differential Revision: https://reviews.freebsd.org/D41497 Reviewed by: arrowd
Diffstat (limited to 'graphics')
-rw-r--r--graphics/Makefile3
-rw-r--r--graphics/nvidia-drm-510-kmod/Makefile10
-rw-r--r--graphics/nvidia-drm-510-kmod/distinfo5
-rw-r--r--graphics/nvidia-drm-510-kmod/files/20-nvidia-drm-outputclass.conf.in8
-rw-r--r--graphics/nvidia-drm-510-kmod/pkg-descr3
-rw-r--r--graphics/nvidia-drm-515-kmod/Makefile10
-rw-r--r--graphics/nvidia-drm-515-kmod/distinfo5
-rw-r--r--graphics/nvidia-drm-515-kmod/files/20-nvidia-drm-outputclass.conf.in8
-rw-r--r--graphics/nvidia-drm-515-kmod/pkg-descr3
-rw-r--r--graphics/nvidia-drm-kmod/Makefile25
-rw-r--r--graphics/nvidia-drm-kmod/Makefile.common32
-rw-r--r--graphics/nvidia-drm-kmod/pkg-descr1
12 files changed, 113 insertions, 0 deletions
diff --git a/graphics/Makefile b/graphics/Makefile
index 8a01b3895276..c1910b63b806 100644
--- a/graphics/Makefile
+++ b/graphics/Makefile
@@ -593,6 +593,9 @@
SUBDIR += npretty
SUBDIR += nsxiv
SUBDIR += nurbs++
+ SUBDIR += nvidia-drm-510-kmod
+ SUBDIR += nvidia-drm-515-kmod
+ SUBDIR += nvidia-drm-kmod
SUBDIR += nvidia-texture-tools
SUBDIR += ocaml-cairo
SUBDIR += ocaml-images
diff --git a/graphics/nvidia-drm-510-kmod/Makefile b/graphics/nvidia-drm-510-kmod/Makefile
new file mode 100644
index 000000000000..13b2c26c6c3f
--- /dev/null
+++ b/graphics/nvidia-drm-510-kmod/Makefile
@@ -0,0 +1,10 @@
+PORTNAME= nvidia-drm-510-kmod
+PORTVERSION= ${NVIDIA_DISTVERSION}
+CATEGORIES= graphics
+
+RUN_DEPENDS+= ${KMODDIR}/drm.ko:graphics/drm-510-kmod
+
+.include "${.CURDIR}/../drm-510-kmod/Makefile.version"
+.include "${.CURDIR}/../nvidia-drm-kmod/Makefile.common"
+
+.include <bsd.port.mk>
diff --git a/graphics/nvidia-drm-510-kmod/distinfo b/graphics/nvidia-drm-510-kmod/distinfo
new file mode 100644
index 000000000000..3b60248b1ff9
--- /dev/null
+++ b/graphics/nvidia-drm-510-kmod/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1692304583
+SHA256 (amshafer-nvidia-driver-535.98-nvidia-drm-510-kmod-535.98_GH0.tar.gz) = c11fb17f9f8cddc11ec699c63bbc288bd1124537dd7ae698538ebd8bb399e225
+SIZE (amshafer-nvidia-driver-535.98-nvidia-drm-510-kmod-535.98_GH0.tar.gz) = 185499361
+SHA256 (freebsd-drm-kmod-drm_v5.10.163_6_GH0.tar.gz) = 342eb5073f318d18667c605e639bd85e48de3be25861d8a730d0ca3dd7ba7726
+SIZE (freebsd-drm-kmod-drm_v5.10.163_6_GH0.tar.gz) = 20096515
diff --git a/graphics/nvidia-drm-510-kmod/files/20-nvidia-drm-outputclass.conf.in b/graphics/nvidia-drm-510-kmod/files/20-nvidia-drm-outputclass.conf.in
new file mode 100644
index 000000000000..15496138f63a
--- /dev/null
+++ b/graphics/nvidia-drm-510-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-510-kmod/pkg-descr b/graphics/nvidia-drm-510-kmod/pkg-descr
new file mode 100644
index 000000000000..64ec67472ed7
--- /dev/null
+++ b/graphics/nvidia-drm-510-kmod/pkg-descr
@@ -0,0 +1,3 @@
+FreeBSD port of Linux's nvidia-drm.ko Kernel module.
+
+This version is compatible with drm.ko 5.10.
diff --git a/graphics/nvidia-drm-515-kmod/Makefile b/graphics/nvidia-drm-515-kmod/Makefile
new file mode 100644
index 000000000000..c20e7d25f126
--- /dev/null
+++ b/graphics/nvidia-drm-515-kmod/Makefile
@@ -0,0 +1,10 @@
+PORTNAME= nvidia-drm-515-kmod
+PORTVERSION= ${NVIDIA_DISTVERSION}
+CATEGORIES= graphics
+
+RUN_DEPENDS+= ${KMODDIR}/drm.ko:graphics/drm-515-kmod
+
+.include "${.CURDIR}/../drm-515-kmod/Makefile.version"
+.include "${.CURDIR}/../nvidia-drm-kmod/Makefile.common"
+
+.include <bsd.port.mk>
diff --git a/graphics/nvidia-drm-515-kmod/distinfo b/graphics/nvidia-drm-515-kmod/distinfo
new file mode 100644
index 000000000000..ea026477bc17
--- /dev/null
+++ b/graphics/nvidia-drm-515-kmod/distinfo
@@ -0,0 +1,5 @@
+TIMESTAMP = 1692308433
+SHA256 (amshafer-nvidia-driver-535.98-nvidia-drm-515-kmod-535.98_GH0.tar.gz) = 973bb7d81e894767f1e9e5cbe394be15289084098d782fb4adb3758a8face51c
+SIZE (amshafer-nvidia-driver-535.98-nvidia-drm-515-kmod-535.98_GH0.tar.gz) = 185499765
+SHA256 (freebsd-drm-kmod-drm_v5.15.25_5_GH0.tar.gz) = bd5eb5a39cd46f532d0310958bfc2870da1c1a003e92874f18f7f88c8baac6a5
+SIZE (freebsd-drm-kmod-drm_v5.15.25_5_GH0.tar.gz) = 26084713
diff --git a/graphics/nvidia-drm-515-kmod/files/20-nvidia-drm-outputclass.conf.in b/graphics/nvidia-drm-515-kmod/files/20-nvidia-drm-outputclass.conf.in
new file mode 100644
index 000000000000..15496138f63a
--- /dev/null
+++ b/graphics/nvidia-drm-515-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-515-kmod/pkg-descr b/graphics/nvidia-drm-515-kmod/pkg-descr
new file mode 100644
index 000000000000..598cb9411e54
--- /dev/null
+++ b/graphics/nvidia-drm-515-kmod/pkg-descr
@@ -0,0 +1,3 @@
+FreeBSD port of Linux's nvidia-drm.ko Kernel module.
+
+This version is compatible with drm.ko 5.15.
diff --git a/graphics/nvidia-drm-kmod/Makefile b/graphics/nvidia-drm-kmod/Makefile
new file mode 100644
index 000000000000..cc226f22dbf2
--- /dev/null
+++ b/graphics/nvidia-drm-kmod/Makefile
@@ -0,0 +1,25 @@
+PORTNAME= nvidia-drm-kmod
+PORTVERSION= ${NVIDIA_DISTVERSION}
+CATEGORIES= graphics kld
+
+MAINTAINER= ashafer@badland.io
+COMMENT= NVIDIA DRM Kernel Module
+WWW= https://github.com/amshafer/nvidia-driver
+
+USES= metaport
+
+.include "${.CURDIR}/../../x11/nvidia-driver/Makefile.version"
+.include <bsd.port.pre.mk>
+
+# Only supported on FreeBSD 13.1+
+.if ${OPSYS} != FreeBSD
+IGNORE= not supported on anything but FreeBSD (missing linuxkpi functionality)
+.else
+. if ${OSVERSION} >= 1301000
+RUN_DEPENDS+= ${KMODDIR}/nvidia-drm.ko:graphics/nvidia-drm-510-kmod
+. else
+IGNORE= not supported for this FreeBSD version
+. endif
+.endif
+
+.include <bsd.port.post.mk>
diff --git a/graphics/nvidia-drm-kmod/Makefile.common b/graphics/nvidia-drm-kmod/Makefile.common
new file mode 100644
index 000000000000..f97266bc03e1
--- /dev/null
+++ b/graphics/nvidia-drm-kmod/Makefile.common
@@ -0,0 +1,32 @@
+# Common rules for nvidia-drm-*-kmod ports
+
+MAINTAINER= ashafer@badland.io
+COMMENT= NVIDIA DRM Kernel Module
+WWW= https://github.com/amshafer/nvidia-driver
+
+ONLY_FOR_ARCHS= amd64
+USES= kmod uidfix
+
+SUB_FILES= 20-nvidia-drm-outputclass.conf
+
+RUN_DEPENDS+= ${KMODDIR}/nvidia.ko:x11/nvidia-driver
+
+.include "${.CURDIR}/../../x11/nvidia-driver/Makefile.version"
+
+LICENSE_FILE= ${WRKSRC}/nvidia/doc/license.txt
+
+NVIDIA_GH_TAGNAME= ${PORTNAME}-${PORTVERSION}
+USE_GITHUB= yes
+GH_ACCOUNT= amshafer freebsd:drm
+GH_PROJECT= nvidia-driver drm-kmod:drm
+GH_TAGNAME:= ${NVIDIA_GH_TAGNAME} ${DRM_KMOD_GH_TAGNAME}:drm
+
+PLIST_FILES= ${KMODDIR}/nvidia-drm.ko \
+ share/X11/xorg.conf.d/20-nvidia-drm-outputclass.conf
+
+MAKE_ENV+= DRMKMODDIR=${WRKDIR}/drm-kmod-${DRM_KMOD_GH_TAGNAME}/
+WRKSRC_SUBDIR= nvidia/src/nvidia-drm/
+
+post-install:
+ ${MKDIR} ${STAGEDIR}${PREFIX}/share/X11/xorg.conf.d/
+ ${INSTALL_DATA} ${WRKDIR}/20-nvidia-drm-outputclass.conf ${STAGEDIR}${PREFIX}/share/X11/xorg.conf.d/
diff --git a/graphics/nvidia-drm-kmod/pkg-descr b/graphics/nvidia-drm-kmod/pkg-descr
new file mode 100644
index 000000000000..9fea5fd244d8
--- /dev/null
+++ b/graphics/nvidia-drm-kmod/pkg-descr
@@ -0,0 +1 @@
+FreeBSD port of Linux's nvidia-drm.ko Kernel module.