diff --git a/userspace/files/weston.service b/userspace/files/weston.service index b05d090..08bb7e0 100644 --- a/userspace/files/weston.service +++ b/userspace/files/weston.service @@ -15,9 +15,8 @@ TTYReset=yes TTYVHangup=yes TTYVTDisallocate=yes -# TODO: brightness setting doesn't work without this -ExecStartPre=/bin/bash -c "[ -d /sys/firmware/devicetree/base/soc/qcom,mdss_mdp@ae00000/qcom,mdss_dsi_mate10_lite_video ] && \ - /usr/comma/modetest -M msm_drm -s 26:1080x2160-60 && \ +# TODO: DCS commands (e.g. brightness setting) don't work without this on tizi +ExecStartPre=/bin/bash -c "/usr/comma/modetest -M msm_drm -s 26:1080x2160-60 && \ sleep 1" ExecStartPre=/bin/bash -c "mkdir -p $XDG_RUNTIME_DIR" diff --git a/userspace/usr/comma/tests/benchmark_weston.py b/userspace/usr/comma/tests/benchmark_weston.py new file mode 100755 index 0000000..7ae0d99 --- /dev/null +++ b/userspace/usr/comma/tests/benchmark_weston.py @@ -0,0 +1,47 @@ +#!/usr/bin/env python3 +import os +import time +import subprocess + +def run(cmd): + subprocess.check_call(cmd, shell=True) + +def timestamp_cmd(cmd): + cnt = 0 + while True: + cnt += 1 + print("try ", cnt) + run("sudo chmod -R 770 /var/tmp/weston/") + proc = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) + t = time.monotonic() + time.sleep(0.5) + r = proc.poll() + if r is not None: + continue + break + print("r", r) + return t + +if __name__ == "__main__": + + run("sudo systemctl stop weston") + run("sudo rm -rf /var/tmp/weston/wayland-0") + time.sleep(0.5) + #run("sudo systemctl restart weston-ready") + + run("sudo systemctl restart weston --no-block") + st = time.monotonic() + #ts = defaultdict() + + cnt = 0 + while not os.path.exists("/var/tmp/weston/wayland-0"): + time.sleep(0.1) + cnt += 1 + t = time.monotonic() + print(f"- socket at {t - st:.2f}s") + + t = timestamp_cmd('/usr/comma/setup') + print(f"- setup works {t - st:.2f}s") + + t = timestamp_cmd('cd /data/openpilot/selfdrive/ui/ && ./spinner') + print(f"- spinner works {t - st:.2f}s")