summarylogtreecommitdiffstats
path: root/0003-nvidia-drm-modeset.patch
blob: 7b7153f5f30889de77e65da8abd88fa395022b32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
From 74446d263faf4b37122f509891b790adaea3425b Mon Sep 17 00:00:00 2001
From: Vasiliy Stelmachenok <cabopust@yandex.ru>
Date: Tue, 4 May 2021 13:01:59 +0300
Subject: [PATCH] Enable nvidia-drm.modeset=1 by default

This patch activates the DRM KMS of the closed Nvidia driver by default.

DRM KMS is required to activate NVIDIA PRIME Sync,
which is the only guaranteed way to fix the tearing issue on NVIDIA PRIME laptops.
This is the main reason why this patch was added.

Note: NVIDIA PRIME Sync only works for the built-in display of your laptop and does not work for plug-in monitors.

Without a KMS, no Wayland session also does not work.

However, the implementation of DRM KMS in the NVIDIA driver also causes some problems:
- May cause problems booting the system due to missing Nvidia driver modules in initramfs or loading them too late.
To fix this you need to put the Nvidia driver modules in /etc/mknitcpio.conf,
line MODULES=(nvidia nvidia_drm nvidia_modeset nvidia_uvm).
The nvidia-dkms-performance package also contains a Pacman hook to automatically rebuild initramfs
when upgrading/installing/uninstalling an Nvidia driver.
- Causes problems scaling resolution in the console on HiDPI monitors
  and not only. This is because the NVIDIA driver does not support the fbdev high-resolution framebuffer.
  Therefore you must use the efifb driver to get high resolution in the console
  (This method works only for EFI-compatible systems).
  For more detailed instructions read this:
https://wiki.archlinux.org/title/NVIDIA/Tips_and_tricks#Fixing_terminal_resolution

If you have problems with this patch, you can disable KMS
with the kernel boot option nvidia-drm.modeset=0,
which you can put in your boot loader settings.

You can read more about the NVIDIA driver's DRM KMS implementation here:
https://download.nvidia.com/XFree86/Linux-x86_64/465.27/README/kms.html
https://wiki.archlinux.org/title/NVIDIA#DRM_kernel_mode_setting
---
 kernel/nvidia-drm/nvidia-drm-linux.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/nvidia-drm/nvidia-drm-linux.c b/kernel/nvidia-drm/nvidia-drm-linux.c
index f8fcde4..e220af5 100644
--- a/kernel/nvidia-drm/nvidia-drm-linux.c
+++ b/kernel/nvidia-drm/nvidia-drm-linux.c
@@ -41,8 +41,8 @@
 
 MODULE_PARM_DESC(
     modeset,
-    "Enable atomic kernel modesetting (1 = enable, 0 = disable (default))");
-bool nv_drm_modeset_module_param = false;
+    "Enable atomic kernel modesetting (1 = enable (default), 0 = disable");
+bool nv_drm_modeset_module_param = true;
 module_param_named(modeset, nv_drm_modeset_module_param, bool, 0400);
 
 void *nv_drm_calloc(size_t nmemb, size_t size)
-- 
2.31.1