sway: Remove petty proprietary driver checks

Avoid penalizing users using multiple GPUs (ie. for cuda/compute, etc) and the prop. drivers for them.

Default to a warning if we detect any proprietary drivers, rather than exit with a petty attacking message.
This commit is contained in:
Joshua Ashton 2019-06-28 01:11:12 +01:00
parent 0ba959f1ce
commit 9c0a1dc1ff

View file

@ -82,7 +82,7 @@ void detect_raspi(void) {
}
}
void detect_proprietary(int allow_unsupported_gpu) {
void detect_proprietary() {
FILE *f = fopen("/proc/modules", "r");
if (!f) {
return;
@ -91,28 +91,13 @@ void detect_proprietary(int allow_unsupported_gpu) {
size_t line_size = 0;
while (getline(&line, &line_size, f) != -1) {
if (strncmp(line, "nvidia ", 7) == 0) {
if (allow_unsupported_gpu) {
sway_log(SWAY_ERROR,
"!!! Proprietary Nvidia drivers are in use !!!");
} else {
sway_log(SWAY_ERROR,
"Proprietary Nvidia drivers are NOT supported. "
"Use Nouveau. To launch sway anyway, launch with "
"--my-next-gpu-wont-be-nvidia and DO NOT report issues.");
exit(EXIT_FAILURE);
}
sway_log(SWAY_ERROR,
"!!! Proprietary Nvidia drivers are detected !!!");
break;
}
if (strstr(line, "fglrx")) {
if (allow_unsupported_gpu) {
sway_log(SWAY_ERROR,
"!!! Proprietary AMD drivers are in use !!!");
} else {
sway_log(SWAY_ERROR, "Proprietary AMD drivers do NOT support "
"Wayland. Use radeon. To try anyway, launch sway with "
"--unsupported-gpu and DO NOT report issues.");
exit(EXIT_FAILURE);
}
sway_log(SWAY_ERROR,
"!!! Proprietary AMD drivers are detected !!!");
break;
}
}
@ -215,7 +200,7 @@ void enable_debug_flag(const char *flag) {
}
int main(int argc, char **argv) {
static int verbose = 0, debug = 0, validate = 0, allow_unsupported_gpu = 0;
static int verbose = 0, debug = 0, validate = 0;
static struct option long_options[] = {
{"help", no_argument, NULL, 'h'},
@ -225,8 +210,6 @@ int main(int argc, char **argv) {
{"version", no_argument, NULL, 'v'},
{"verbose", no_argument, NULL, 'V'},
{"get-socketpath", no_argument, NULL, 'p'},
{"unsupported-gpu", no_argument, NULL, 'u'},
{"my-next-gpu-wont-be-nvidia", no_argument, NULL, 'u'},
{0, 0, 0, 0}
};
@ -268,9 +251,6 @@ int main(int argc, char **argv) {
case 'D': // extended debug options
enable_debug_flag(optarg);
break;
case 'u':
allow_unsupported_gpu = 1;
break;
case 'v': // version
fprintf(stdout, "sway version " SWAY_VERSION "\n");
exit(EXIT_SUCCESS);
@ -317,7 +297,7 @@ int main(int argc, char **argv) {
log_kernel();
log_distro();
log_env();
detect_proprietary(allow_unsupported_gpu);
detect_proprietary();
detect_raspi();
if (optind < argc) { // Behave as IPC client