allow onscreen cpu rendering (#30510)

* spinner POC cpu

* should be single threaded

* how tf did that get added

* allow non offscreen

---------

Co-authored-by: Comma Device <device@comma.ai>
old-commit-hash: 7f14bdfb22
chrysler-long2
Justin Newberry 1 year ago committed by GitHub
parent 872b9cc6e9
commit 0c43599b93
  1. 2
      selfdrive/navd/main.cc
  2. 2
      system/hardware/base.h
  3. 6
      system/hardware/pc/hardware.h
  4. 6
      system/hardware/tici/hardware.h

@ -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);

@ -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; }

@ -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
}

@ -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
}
};

Loading…
Cancel
Save