summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Drew DeVault <sir@cmpwn.com>2017-04-12 10:15:38 -0400
committerLibravatar GitHub <noreply@github.com>2017-04-12 10:15:38 -0400
commita25a2f40ce207ea39cf693fe5ee12c621ae06ae7 (patch)
treeda7b2dbe82457d3f446cf094cc02e809bcd72a19
parentMerge pull request #1146 from SirCmpwn/pretty-print-swaymsg (diff)
parentImplement more thourough nvidia config check (diff)
downloadsway-a25a2f40ce207ea39cf693fe5ee12c621ae06ae7.tar.gz
sway-a25a2f40ce207ea39cf693fe5ee12c621ae06ae7.tar.zst
sway-a25a2f40ce207ea39cf693fe5ee12c621ae06ae7.zip
Merge pull request #1147 from SirCmpwn/nvidia-support
Downgrade nvidia proprietary driver warning
-rw-r--r--sway/main.c40
-rw-r--r--sway/sway.1.txt3
2 files changed, 35 insertions, 8 deletions
diff --git a/sway/main.c b/sway/main.c
index b9f8936f..39bf225e 100644
--- a/sway/main.c
+++ b/sway/main.c
@@ -57,25 +57,55 @@ void detect_proprietary() {
57 if (!f) { 57 if (!f) {
58 return; 58 return;
59 } 59 }
60 bool nvidia = false, nvidia_modeset = false, nvidia_uvm = false, nvidia_drm = false;
60 while (!feof(f)) { 61 while (!feof(f)) {
61 char *line; 62 char *line;
62 if (!(line = read_line(f))) { 63 if (!(line = read_line(f))) {
63 break; 64 break;
64 } 65 }
65 if (strstr(line, "nvidia")) { 66 if (strstr(line, "nvidia")) {
66 fprintf(stderr, "\x1B[1;31mWarning: Proprietary nvidia drivers do NOT support Wayland. Use nouveau.\x1B[0m\n"); 67 nvidia = true;
67 fprintf(stderr, "\x1B[1;31mYes, they STILL don't work with the newly announced wayland \"support\".\x1B[0m\n"); 68 }
68 free(line); 69 if (strstr(line, "nvidia_modeset")) {
69 break; 70 nvidia_modeset = true;
71 }
72 if (strstr(line, "nvidia_uvm")) {
73 nvidia_uvm = true;
74 }
75 if (strstr(line, "nvidia_drm")) {
76 nvidia_drm = true;
70 } 77 }
71 if (strstr(line, "fglrx")) { 78 if (strstr(line, "fglrx")) {
72 fprintf(stderr, "\x1B[1;31mWarning: Proprietary AMD drivers do NOT support Wayland. Use radeon.\x1B[0m\n"); 79 fprintf(stderr, "\x1B[1;31mWarning: Proprietary AMD drivers do "
80 "NOT support Wayland. Use radeon.\x1B[0m\n");
73 free(line); 81 free(line);
74 break; 82 break;
75 } 83 }
76 free(line); 84 free(line);
77 } 85 }
78 fclose(f); 86 fclose(f);
87 if (nvidia) {
88 fprintf(stderr, "\x1B[1;31mWarning: Proprietary nvidia driver support "
89 "is considered experimental. Nouveau is strongly recommended."
90 "\x1B[0m\n");
91 if (!nvidia_modeset || !nvidia_uvm || !nvidia_drm) {
92 fprintf(stderr, "\x1B[1;31mWarning: You do not have all of the "
93 "necessary kernel modules loaded for nvidia support. "
94 "You need nvidia, nvidia_modeset, nvidia_uvm, and nvidia_drm."
95 "\x1B[0m\n");
96 }
97 f = fopen("/proc/cmdline", "r");
98 if (f) {
99 char *line = read_line(f);
100 if (line && !strstr(line, "nvidia-drm.modeset=1")) {
101 fprintf(stderr, "\x1B[1;31mWarning: You must add "
102 "nvidia-drm.modeset=1 to your kernel command line to use "
103 "the proprietary driver.\x1B[0m\n");
104 }
105 fclose(f);
106 free(line);
107 }
108 }
79} 109}
80 110
81void run_as_ipc_client(char *command, char *socket_path) { 111void run_as_ipc_client(char *command, char *socket_path) {
diff --git a/sway/sway.1.txt b/sway/sway.1.txt
index 1a77611d..bc827bd5 100644
--- a/sway/sway.1.txt
+++ b/sway/sway.1.txt
@@ -51,9 +51,6 @@ rather than switch to something else.
51Launch sway directly from a tty or via your favorite Wayland-compatible login 51Launch sway directly from a tty or via your favorite Wayland-compatible login
52manager. 52manager.
53 53
54*Important note for nvidia users*: The proprietary nvidia driver does _not_ have
55support for Wayland as of 2016-06-10. Use nouveau.
56
57Commands 54Commands
58-------- 55--------
59 56