mirror of
https://github.com/NickHu/sway
synced 2024-12-26 21:58:30 +01:00
main: removed vc4 detection code.
Signed-off-by: Bartłomiej Burdukiewicz <bartlomiej.burdukiewicz@gmail.com>
This commit is contained in:
parent
30e400c0a3
commit
7c74f01f0a
1 changed files with 0 additions and 38 deletions
38
sway/main.c
38
sway/main.c
|
@ -47,43 +47,6 @@ void sig_handler(int signal) {
|
|||
sway_terminate(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
void detect_raspi(void) {
|
||||
bool raspi = false;
|
||||
FILE *f = fopen("/sys/firmware/devicetree/base/model", "r");
|
||||
if (!f) {
|
||||
return;
|
||||
}
|
||||
char *line = NULL;
|
||||
size_t line_size = 0;
|
||||
while (getline(&line, &line_size, f) != -1) {
|
||||
if (strstr(line, "Raspberry Pi")) {
|
||||
raspi = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
fclose(f);
|
||||
FILE *g = fopen("/proc/modules", "r");
|
||||
if (!g) {
|
||||
free(line);
|
||||
return;
|
||||
}
|
||||
bool vc4 = false;
|
||||
while (getline(&line, &line_size, g) != -1) {
|
||||
if (strstr(line, "vc4")) {
|
||||
vc4 = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
free(line);
|
||||
fclose(g);
|
||||
if (!vc4 && raspi) {
|
||||
fprintf(stderr, "\x1B[1;31mWarning: You have a "
|
||||
"Raspberry Pi, but the vc4 Module is "
|
||||
"not loaded! Set 'dtoverlay=vc4-kms-v3d'"
|
||||
"in /boot/config.txt and reboot.\x1B[0m\n");
|
||||
}
|
||||
}
|
||||
|
||||
void detect_proprietary(int allow_unsupported_gpu) {
|
||||
FILE *f = fopen("/proc/modules", "r");
|
||||
if (!f) {
|
||||
|
@ -350,7 +313,6 @@ int main(int argc, char **argv) {
|
|||
log_distro();
|
||||
log_env();
|
||||
detect_proprietary(allow_unsupported_gpu);
|
||||
detect_raspi();
|
||||
|
||||
if (optind < argc) { // Behave as IPC client
|
||||
if (optind != 1) {
|
||||
|
|
Loading…
Reference in a new issue