summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sway/main.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/sway/main.c b/sway/main.c
index 6d13955c..cc9147b8 100644
--- a/sway/main.c
+++ b/sway/main.c
@@ -135,6 +135,29 @@ void detect_proprietary() {
135 "You need nvidia, nvidia_modeset, nvidia_uvm, and nvidia_drm." 135 "You need nvidia, nvidia_modeset, nvidia_uvm, and nvidia_drm."
136 "\x1B[0m\n"); 136 "\x1B[0m\n");
137 } 137 }
138#ifdef __linux__
139 f = fopen("/sys/module/nvidia_drm/parameters/modeset", "r");
140 if (f) {
141 char *line = read_line(f);
142 if (line && strstr(line, "Y")) {
143 // nvidia-drm.modeset is set to 0
144 fprintf(stderr, "\x1B[1;31mWarning: You must load "
145 "nvidia-drm with the modeset option on to use "
146 "the proprietary driver. Consider adding "
147 "nvidia-drm.modeset=1 to your kernel command line "
148 "parameters.\x1B[0m\n");
149 }
150 fclose(f);
151 free(line);
152 } else {
153 // nvidia-drm.modeset is not set
154 fprintf(stderr, "\x1B[1;31mWarning: You must load "
155 "nvidia-drm with the modeset option on to use "
156 "the proprietary driver. Consider adding "
157 "nvidia-drm.modeset=1 to your kernel command line "
158 "parameters.\x1B[0m\n");
159 }
160#else
138 f = fopen("/proc/cmdline", "r"); 161 f = fopen("/proc/cmdline", "r");
139 if (f) { 162 if (f) {
140 char *line = read_line(f); 163 char *line = read_line(f);
@@ -146,6 +169,7 @@ void detect_proprietary() {
146 fclose(f); 169 fclose(f);
147 free(line); 170 free(line);
148 } 171 }
172#endif
149 } 173 }
150} 174}
151 175