mirror of
https://github.com/dragonpilot/dragonpilot.git
synced 2026-02-26 20:43:53 +08:00
tici: offline big cluster while offroad (#20668)
* tici: offline big cluster while offroad * shuffling Co-authored-by: Comma Device <device@comma.ai>
This commit is contained in:
@@ -573,7 +573,7 @@ int main() {
|
||||
LOG("set priority returns %d", err);
|
||||
|
||||
#ifdef QCOM2
|
||||
err = set_core_affinity(7);
|
||||
err = set_core_affinity(4);
|
||||
#else
|
||||
err = set_core_affinity(3);
|
||||
#endif
|
||||
|
||||
@@ -45,7 +45,7 @@ EventName = car.CarEvent.EventName
|
||||
|
||||
class Controls:
|
||||
def __init__(self, sm=None, pm=None, can_sock=None):
|
||||
config_realtime_process(7 if TICI else 3, Priority.CTRL_HIGH)
|
||||
config_realtime_process(4 if TICI else 3, Priority.CTRL_HIGH)
|
||||
|
||||
# Setup sockets
|
||||
self.pm = pm
|
||||
|
||||
@@ -205,6 +205,11 @@ class Tici(HardwareBase):
|
||||
# amplifier, 100mW at idle
|
||||
write_amplifier_reg(0x51, 0b0 if enabled else 0b1, 7, 0b10000000)
|
||||
|
||||
# offline big cluster, leave core 4 online for boardd
|
||||
for i in range(5, 8):
|
||||
# TODO: fix permissions with udev
|
||||
val = "0" if enabled else "1"
|
||||
os.system(f"sudo su -c 'echo {val} > /sys/devices/system/cpu/cpu{i}/online'")
|
||||
|
||||
if __name__ == "__main__":
|
||||
import sys
|
||||
|
||||
@@ -137,8 +137,7 @@ int main(int argc, char **argv) {
|
||||
#ifdef QCOM
|
||||
set_core_affinity(2);
|
||||
#elif QCOM2
|
||||
// CPU usage is much lower when pinned to a single big core
|
||||
set_core_affinity(4);
|
||||
set_core_affinity(7);
|
||||
#endif
|
||||
|
||||
bool wide_camera = false;
|
||||
|
||||
Reference in New Issue
Block a user