diff options
Diffstat (limited to 'sway')
-rw-r--r-- | sway/main.c | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/sway/main.c b/sway/main.c index cd949e1e..0611e80b 100644 --- a/sway/main.c +++ b/sway/main.c | |||
@@ -47,43 +47,6 @@ void sig_handler(int signal) { | |||
47 | sway_terminate(EXIT_SUCCESS); | 47 | sway_terminate(EXIT_SUCCESS); |
48 | } | 48 | } |
49 | 49 | ||
50 | void detect_raspi(void) { | ||
51 | bool raspi = false; | ||
52 | FILE *f = fopen("/sys/firmware/devicetree/base/model", "r"); | ||
53 | if (!f) { | ||
54 | return; | ||
55 | } | ||
56 | char *line = NULL; | ||
57 | size_t line_size = 0; | ||
58 | while (getline(&line, &line_size, f) != -1) { | ||
59 | if (strstr(line, "Raspberry Pi")) { | ||
60 | raspi = true; | ||
61 | break; | ||
62 | } | ||
63 | } | ||
64 | fclose(f); | ||
65 | FILE *g = fopen("/proc/modules", "r"); | ||
66 | if (!g) { | ||
67 | free(line); | ||
68 | return; | ||
69 | } | ||
70 | bool vc4 = false; | ||
71 | while (getline(&line, &line_size, g) != -1) { | ||
72 | if (strstr(line, "vc4")) { | ||
73 | vc4 = true; | ||
74 | break; | ||
75 | } | ||
76 | } | ||
77 | free(line); | ||
78 | fclose(g); | ||
79 | if (!vc4 && raspi) { | ||
80 | fprintf(stderr, "\x1B[1;31mWarning: You have a " | ||
81 | "Raspberry Pi, but the vc4 Module is " | ||
82 | "not loaded! Set 'dtoverlay=vc4-kms-v3d'" | ||
83 | "in /boot/config.txt and reboot.\x1B[0m\n"); | ||
84 | } | ||
85 | } | ||
86 | |||
87 | void detect_proprietary(int allow_unsupported_gpu) { | 50 | void detect_proprietary(int allow_unsupported_gpu) { |
88 | FILE *f = fopen("/proc/modules", "r"); | 51 | FILE *f = fopen("/proc/modules", "r"); |
89 | if (!f) { | 52 | if (!f) { |
@@ -350,7 +313,6 @@ int main(int argc, char **argv) { | |||
350 | log_distro(); | 313 | log_distro(); |
351 | log_env(); | 314 | log_env(); |
352 | detect_proprietary(allow_unsupported_gpu); | 315 | detect_proprietary(allow_unsupported_gpu); |
353 | detect_raspi(); | ||
354 | 316 | ||
355 | if (optind < argc) { // Behave as IPC client | 317 | if (optind < argc) { // Behave as IPC client |
356 | if (optind != 1) { | 318 | if (optind != 1) { |