Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions srcpkgs/nvidia-open-dkms/files/dkms.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
PACKAGE_NAME="nvidia"
PACKAGE_VERSION="__PKGVER"
AUTOINSTALL="yes"

# By default, DKMS will add KERNELRELEASE to the make command line; however,
# this will cause the kernel module build to infer that it was invoked via
# Kbuild directly instead of DKMS. The dkms(8) manual page recommends quoting
# the 'make' command name to suppress this behavior.
MAKE[0]="'make' -j$(nproc) NV_EXCLUDE_BUILD_MODULES='' KERNEL_UNAME=${kernelver} modules"

# The list of kernel modules will be generated by nvidia-installer at runtime.
BUILT_MODULE_NAME[0]="nvidia"
BUILT_MODULE_LOCATION[0]="kernel-open"
DEST_MODULE_LOCATION[0]="/kernel/drivers/video"
BUILT_MODULE_NAME[1]="nvidia-uvm"
BUILT_MODULE_LOCATION[1]="kernel-open"
DEST_MODULE_LOCATION[1]="/kernel/drivers/video"
BUILT_MODULE_NAME[2]="nvidia-modeset"
BUILT_MODULE_LOCATION[2]="kernel-open"
DEST_MODULE_LOCATION[2]="/kernel/drivers/video"
BUILT_MODULE_NAME[3]="nvidia-drm"
BUILT_MODULE_LOCATION[3]="kernel-open"
DEST_MODULE_LOCATION[3]="/kernel/drivers/video"
BUILT_MODULE_NAME[4]="nvidia-peermem"
BUILT_MODULE_LOCATION[4]="kernel-open"
DEST_MODULE_LOCATION[4]="/kernel/drivers/video"
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
From 69769b8ebaaeca84a5188330f80c460dcc0fa747 Mon Sep 17 00:00:00 2001
From: Eric Naim <dnaim@cachyos.org>
Date: Fri, 24 Jan 2025 19:34:24 +0700
Subject: [PATCH] Enable atomic kernel modesetting by default

This is required for proper functionality under Wayland. fbdev has been default enabled since 570 so that
hunk can be removed from this patch.

Signed-off-by: Eric Naim <dnaim@cachyos.org>
---
nvidia-drm/nvidia-drm-linux.c | 2 +-
nvidia-drm/nvidia-drm-os-interface.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/nvidia-drm/nvidia-drm-linux.c b/nvidia-drm/nvidia-drm-linux.c
index 0007cbf..bd0b9eb 100644
--- a/kernel-open/nvidia-drm/nvidia-drm-linux.c
+++ b/kernel-open/nvidia-drm/nvidia-drm-linux.c
@@ -31,7 +31,7 @@

MODULE_PARM_DESC(
modeset,
- "Enable atomic kernel modesetting (1 = enable, 0 = disable (default))");
+ "Enable atomic kernel modesetting (1 = enable (default), 0 = disable)");
module_param_named(modeset, nv_drm_modeset_module_param, bool, 0400);

#if defined(NV_DRM_FBDEV_AVAILABLE)
diff --git a/nvidia-drm/nvidia-drm-os-interface.c b/nvidia-drm/nvidia-drm-os-interface.c
index 7617476..f22afd7 100644
--- a/kernel-open/nvidia-drm/nvidia-drm-os-interface.c
+++ b/kernel-open/nvidia-drm/nvidia-drm-os-interface.c
@@ -41,7 +41,7 @@
#include <drm/drmP.h>
#endif

-bool nv_drm_modeset_module_param = false;
+bool nv_drm_modeset_module_param = true;
bool nv_drm_fbdev_module_param = true;

void *nv_drm_calloc(size_t nmemb, size_t size)
--
2.48.1
25 changes: 25 additions & 0 deletions srcpkgs/nvidia-open-dkms/patches/0003-Add-IBT-support.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
From 1484c9ee0a60468dfd88954011fae0e28c0f73de Mon Sep 17 00:00:00 2001
From: Peter Jung <admin@ptr1337.dev>
Date: Fri, 18 Oct 2024 22:40:58 +0200
Subject: [PATCH 3/6] Add IBT support

Signed-off-by: Peter Jung <admin@ptr1337.dev>
---
src/nvidia-modeset/Makefile | 1 +
1 file changed, 1 insertion(+)

diff --git a/src/nvidia-modeset/Makefile b/src/nvidia-modeset/Makefile
index 2b96f3fa..ed934014 100644
--- a/src/nvidia-modeset/Makefile
+++ b/src/nvidia-modeset/Makefile
@@ -151,6 +151,7 @@ ifeq ($(TARGET_ARCH),x86_64)
CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -fno-jump-tables)
CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mindirect-branch=thunk-extern)
CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mindirect-branch-register)
+ CONDITIONAL_CFLAGS += $(call TEST_CC_ARG, -mharden-sls=all)
endif

CFLAGS += $(CONDITIONAL_CFLAGS)
--
2.47.0

13 changes: 13 additions & 0 deletions srcpkgs/nvidia-open-dkms/patches/nvidia-tegra-bpmp.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
--- a/kernel-open/nvidia/nv-clk.c
+++ b/kernel-open/nvidia/nv-clk.c
@@ -27,8 +27,10 @@
#include "nv-linux.h"
#include "nv-platform.h"

+#if IS_ENABLED(CONFIG_TEGRA_BPMP)
#include <soc/tegra/bpmp-abi.h>
#include <soc/tegra/bpmp.h>
+#endif // IS_ENABLED(CONFIG_TEGRA_BPMP)

// Use the CCF APIs if enabled in Kernel config and RM build
// has Dual license define enabled.
36 changes: 36 additions & 0 deletions srcpkgs/nvidia-open-dkms/template
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Template file for 'nvidia-open-dkms'
pkgname=nvidia-open-dkms
version=580.119.02
revision=1
archs="x86_64"
depends="dkms nvidia xz"
short_desc="NVIDIA drivers for linux - open DKMS kernel module"
maintainer="JkktBkkt <apkabikov@gmail.com>"
license="GPL-2.0-only, MIT"
homepage="https://github.com/NVIDIA/open-gpu-kernel-modules"
distfiles="https://download.nvidia.com/XFree86/NVIDIA-kernel-module-source/NVIDIA-kernel-module-source-${version}.tar.xz"
checksum=ea06941cf2b095c2a9a6f1d0640a447d1c33baefbff9d95fd9726955dd210692
replaces="nvidia-dkms>=0"
conflicts="nvidia390-dkms>=0 nvidia470-dkms>=0"
dkms_modules="nvidia-open-dkms ${version}"
triggers="dkms initramfs-regenerate"
provides="nvidia-dkms-${version}_${revision}"

do_install() {
vmkdir usr/src/nvidia-open-dkms-${version}
vcopy "*" usr/src/nvidia-open-dkms-${version}
cp ${FILESDIR}/dkms.conf ${DESTDIR}/usr/src/nvidia-open-dkms-${version}/dkms.conf
vsed -e "s/__PKGVER/${version}/" -i ${DESTDIR}/usr/src/nvidia-open-dkms-${version}/dkms.conf

# Blacklist nouveau
vmkdir usr/lib/modprobe.d
cat <<- END > ${DESTDIR}/usr/lib/modprobe.d/nvidia.conf
blacklist nouveau
blacklist nova_core
blacklist nova_drm
END
chmod 644 ${DESTDIR}/usr/lib/modprobe.d/nvidia.conf

vdoc README.md
vlicense COPYING
}