aboutsummaryrefslogtreecommitdiffstats
path: root/sway/main.c
diff options
context:
space:
mode:
authorLibravatar Tony Crisci <tony@dubstepdish.com>2017-11-28 05:40:00 -0500
committerLibravatar Tony Crisci <tony@dubstepdish.com>2017-11-28 05:40:00 -0500
commit9696f50ebad2c414195fc561deea21a36693da5a (patch)
tree65ab99f0bacbd084a8c15cd80d3ffc968f7c417c /sway/main.c
parentHandle view destruction properly (diff)
downloadsway-9696f50ebad2c414195fc561deea21a36693da5a.tar.gz
sway-9696f50ebad2c414195fc561deea21a36693da5a.tar.zst
sway-9696f50ebad2c414195fc561deea21a36693da5a.zip
remove nvidia support claim
Diffstat (limited to 'sway/main.c')
-rw-r--r--sway/main.c61
1 files changed, 4 insertions, 57 deletions
diff --git a/sway/main.c b/sway/main.c
index 5d5f9a57..c65d175b 100644
--- a/sway/main.c
+++ b/sway/main.c
@@ -84,23 +84,16 @@ void detect_proprietary() {
84 if (!f) { 84 if (!f) {
85 return; 85 return;
86 } 86 }
87 bool nvidia = false, nvidia_modeset = false, nvidia_uvm = false, nvidia_drm = false;
88 while (!feof(f)) { 87 while (!feof(f)) {
89 char *line; 88 char *line;
90 if (!(line = read_line(f))) { 89 if (!(line = read_line(f))) {
91 break; 90 break;
92 } 91 }
93 if (strstr(line, "nvidia")) { 92 if (strstr(line, "nvidia")) {
94 nvidia = true; 93 fprintf(stderr, "\x1B[1;31mWarning: Proprietary Nvidia drivers are "
95 } 94 "NOT supported. Use Nouveau.\x1B[0m\n");
96 if (strstr(line, "nvidia_modeset")) { 95 free(line);
97 nvidia_modeset = true; 96 break;
98 }
99 if (strstr(line, "nvidia_uvm")) {
100 nvidia_uvm = true;
101 }
102 if (strstr(line, "nvidia_drm")) {
103 nvidia_drm = true;
104 } 97 }
105 if (strstr(line, "fglrx")) { 98 if (strstr(line, "fglrx")) {
106 fprintf(stderr, "\x1B[1;31mWarning: Proprietary AMD drivers do " 99 fprintf(stderr, "\x1B[1;31mWarning: Proprietary AMD drivers do "
@@ -111,52 +104,6 @@ void detect_proprietary() {
111 free(line); 104 free(line);
112 } 105 }
113 fclose(f); 106 fclose(f);
114 if (nvidia) {
115 fprintf(stderr, "\x1B[1;31mWarning: Proprietary nvidia driver support "
116 "is considered experimental. Nouveau is strongly recommended."
117 "\x1B[0m\n");
118 if (!nvidia_modeset || !nvidia_uvm || !nvidia_drm) {
119 fprintf(stderr, "\x1B[1;31mWarning: You do not have all of the "
120 "necessary kernel modules loaded for nvidia support. "
121 "You need nvidia, nvidia_modeset, nvidia_uvm, and nvidia_drm."
122 "\x1B[0m\n");
123 }
124#ifdef __linux__
125 f = fopen("/sys/module/nvidia_drm/parameters/modeset", "r");
126 if (f) {
127 char *line = read_line(f);
128 if (line && strstr(line, "Y")) {
129 // nvidia-drm.modeset is set to 0
130 fprintf(stderr, "\x1B[1;31mWarning: You must load "
131 "nvidia-drm with the modeset option on to use "
132 "the proprietary driver. Consider adding "
133 "nvidia-drm.modeset=1 to your kernel command line "
134 "parameters.\x1B[0m\n");
135 }
136 fclose(f);
137 free(line);
138 } else {
139 // nvidia-drm.modeset is not set
140 fprintf(stderr, "\x1B[1;31mWarning: You must load "
141 "nvidia-drm with the modeset option on to use "
142 "the proprietary driver. Consider adding "
143 "nvidia-drm.modeset=1 to your kernel command line "
144 "parameters.\x1B[0m\n");
145 }
146#else
147 f = fopen("/proc/cmdline", "r");
148 if (f) {
149 char *line = read_line(f);
150 if (line && !strstr(line, "nvidia-drm.modeset=1")) {
151 fprintf(stderr, "\x1B[1;31mWarning: You must add "
152 "nvidia-drm.modeset=1 to your kernel command line to use "
153 "the proprietary driver.\x1B[0m\n");
154 }
155 fclose(f);
156 free(line);
157 }
158#endif
159 }
160} 107}
161 108
162void run_as_ipc_client(char *command, char *socket_path) { 109void run_as_ipc_client(char *command, char *socket_path) {