diff --git a/selfdrive/navd/main.cc b/selfdrive/navd/main.cc index 5251b046fb..2e7b4d3b60 100644 --- a/selfdrive/navd/main.cc +++ b/selfdrive/navd/main.cc @@ -11,7 +11,7 @@ #include "system/hardware/hw.h" int main(int argc, char *argv[]) { - Hardware::config_cpu_rendering(); + Hardware::config_cpu_rendering(true); qInstallMessageHandler(swagLogMessageHandler); setpriority(PRIO_PROCESS, 0, -20); diff --git a/system/hardware/base.h b/system/hardware/base.h index 43f5db023d..890a743ea0 100644 --- a/system/hardware/base.h +++ b/system/hardware/base.h @@ -34,7 +34,7 @@ public: static bool get_ssh_enabled() { return false; } static void set_ssh_enabled(bool enabled) {} - static void config_cpu_rendering(); + static void config_cpu_rendering(bool offscreen); static bool PC() { return false; } static bool TICI() { return false; } diff --git a/system/hardware/pc/hardware.h b/system/hardware/pc/hardware.h index 7a7ddd60b7..189adbbbee 100644 --- a/system/hardware/pc/hardware.h +++ b/system/hardware/pc/hardware.h @@ -21,8 +21,10 @@ public: std::system(("pactl set-sink-volume @DEFAULT_SINK@ " + std::string(volume_str)).c_str()); } - static void config_cpu_rendering() { - setenv("QT_QPA_PLATFORM", "offscreen", 1); + static void config_cpu_rendering(bool offscreen) { + if (offscreen) { + setenv("QT_QPA_PLATFORM", "offscreen", 1); + } setenv("__GLX_VENDOR_LIBRARY_NAME", "mesa", 1); setenv("LP_NUM_THREADS", "0", 1); // disable threading so we stay on our assigned CPU } diff --git a/system/hardware/tici/hardware.h b/system/hardware/tici/hardware.h index fe0a20ae58..0a00aca5be 100644 --- a/system/hardware/tici/hardware.h +++ b/system/hardware/tici/hardware.h @@ -104,8 +104,10 @@ public: static bool get_ssh_enabled() { return Params().getBool("SshEnabled"); } static void set_ssh_enabled(bool enabled) { Params().putBool("SshEnabled", enabled); } - static void config_cpu_rendering() { - setenv("QT_QPA_PLATFORM", "eglfs", 1); // offscreen doesn't work with EGL/GLES + static void config_cpu_rendering(bool offscreen) { + if (offscreen) { + setenv("QT_QPA_PLATFORM", "eglfs", 1); // offscreen doesn't work with EGL/GLES + } setenv("LP_NUM_THREADS", "0", 1); // disable threading so we stay on our assigned CPU } };