Monorepo for Aesthetic.Computer aesthetic.computer

fix: skip SDL3 when running as PID 1 — DRI probe corrupts GPU state

The SDL3/Mesa DRI probe segfaults on ThinkPad 11e even in a child
process. When running as PID 1 (bare metal), the fork+crash corrupts
shared GPU/DRM state. Skip SDL entirely for PID 1 and use DRM dumb
buffers (which work reliably). SDL still available when running
under a proper init system.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+9 -1
+9 -1
fedac/native/src/drm-display.c
··· 127 127 } 128 128 129 129 static ACDisplay *sdl_init(void) { 130 + // Skip SDL when running as PID 1 (bare metal init) — the DRI/Mesa 131 + // probe can corrupt GPU state even in a child process, and fork() 132 + // from PID 1 has kernel implications. Use DRM dumb buffers instead. 133 + // SDL works fine when running under a proper init system (systemd, etc.) 134 + if (getpid() == 1) { 135 + ac_log("[sdl3] Skipping SDL3 (PID 1 — using DRM dumb buffers)\n"); 136 + return NULL; 137 + } 130 138 // Probe in child process first (catches DRI segfaults) 131 139 if (!sdl_probe_safe()) return NULL; 132 140 // Load SDL3 via dlopen 133 141 if (!sdl_load()) return NULL; 134 142 135 - if (getpid() == 1) setenv("SDL_VIDEO_DRIVER", "kmsdrm", 0); 143 + setenv("SDL_VIDEO_DRIVER", "kmsdrm", 0); 136 144 137 145 if (!sdl.Init(0x20)) { // SDL_INIT_VIDEO 138 146 ac_log("[sdl3] SDL_Init failed: %s\n", sdl.GetError ? sdl.GetError() : "?");