mirror of
https://github.com/swaywm/sway.git
synced 2024-12-30 17:06:40 +01:00
Merge pull request #1147 from SirCmpwn/nvidia-support
Downgrade nvidia proprietary driver warning
This commit is contained in:
commit
a25a2f40ce
2 changed files with 35 additions and 8 deletions
40
sway/main.c
40
sway/main.c
|
@ -57,25 +57,55 @@ void detect_proprietary() {
|
||||||
if (!f) {
|
if (!f) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
bool nvidia = false, nvidia_modeset = false, nvidia_uvm = false, nvidia_drm = false;
|
||||||
while (!feof(f)) {
|
while (!feof(f)) {
|
||||||
char *line;
|
char *line;
|
||||||
if (!(line = read_line(f))) {
|
if (!(line = read_line(f))) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (strstr(line, "nvidia")) {
|
if (strstr(line, "nvidia")) {
|
||||||
fprintf(stderr, "\x1B[1;31mWarning: Proprietary nvidia drivers do NOT support Wayland. Use nouveau.\x1B[0m\n");
|
nvidia = true;
|
||||||
fprintf(stderr, "\x1B[1;31mYes, they STILL don't work with the newly announced wayland \"support\".\x1B[0m\n");
|
}
|
||||||
free(line);
|
if (strstr(line, "nvidia_modeset")) {
|
||||||
break;
|
nvidia_modeset = true;
|
||||||
|
}
|
||||||
|
if (strstr(line, "nvidia_uvm")) {
|
||||||
|
nvidia_uvm = true;
|
||||||
|
}
|
||||||
|
if (strstr(line, "nvidia_drm")) {
|
||||||
|
nvidia_drm = true;
|
||||||
}
|
}
|
||||||
if (strstr(line, "fglrx")) {
|
if (strstr(line, "fglrx")) {
|
||||||
fprintf(stderr, "\x1B[1;31mWarning: Proprietary AMD drivers do NOT support Wayland. Use radeon.\x1B[0m\n");
|
fprintf(stderr, "\x1B[1;31mWarning: Proprietary AMD drivers do "
|
||||||
|
"NOT support Wayland. Use radeon.\x1B[0m\n");
|
||||||
free(line);
|
free(line);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
free(line);
|
free(line);
|
||||||
}
|
}
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
if (nvidia) {
|
||||||
|
fprintf(stderr, "\x1B[1;31mWarning: Proprietary nvidia driver support "
|
||||||
|
"is considered experimental. Nouveau is strongly recommended."
|
||||||
|
"\x1B[0m\n");
|
||||||
|
if (!nvidia_modeset || !nvidia_uvm || !nvidia_drm) {
|
||||||
|
fprintf(stderr, "\x1B[1;31mWarning: You do not have all of the "
|
||||||
|
"necessary kernel modules loaded for nvidia support. "
|
||||||
|
"You need nvidia, nvidia_modeset, nvidia_uvm, and nvidia_drm."
|
||||||
|
"\x1B[0m\n");
|
||||||
|
}
|
||||||
|
f = fopen("/proc/cmdline", "r");
|
||||||
|
if (f) {
|
||||||
|
char *line = read_line(f);
|
||||||
|
if (line && !strstr(line, "nvidia-drm.modeset=1")) {
|
||||||
|
fprintf(stderr, "\x1B[1;31mWarning: You must add "
|
||||||
|
"nvidia-drm.modeset=1 to your kernel command line to use "
|
||||||
|
"the proprietary driver.\x1B[0m\n");
|
||||||
|
}
|
||||||
|
fclose(f);
|
||||||
|
free(line);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void run_as_ipc_client(char *command, char *socket_path) {
|
void run_as_ipc_client(char *command, char *socket_path) {
|
||||||
|
|
|
@ -51,9 +51,6 @@ rather than switch to something else.
|
||||||
Launch sway directly from a tty or via your favorite Wayland-compatible login
|
Launch sway directly from a tty or via your favorite Wayland-compatible login
|
||||||
manager.
|
manager.
|
||||||
|
|
||||||
*Important note for nvidia users*: The proprietary nvidia driver does _not_ have
|
|
||||||
support for Wayland as of 2016-06-10. Use nouveau.
|
|
||||||
|
|
||||||
Commands
|
Commands
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue