mirror of
https://github.com/MoreTore/openpilot.git
synced 2026-08-06 00:36:32 +08:00
tici IRQ tuning (#24170)
* first pass * move that back * move that Co-authored-by: Comma Device <device@comma.ai>
This commit is contained in:
@@ -58,6 +58,9 @@ MM_MODEM_ACCESS_TECHNOLOGY_LTE = 1 << 14
|
||||
def sudo_write(val, path):
|
||||
os.system(f"sudo su -c 'echo {val} > {path}'")
|
||||
|
||||
def affine_irq(val, irq):
|
||||
sudo_write(str(val), f"/proc/irq/{irq}/smp_affinity_list")
|
||||
|
||||
|
||||
class Tici(HardwareBase):
|
||||
@cached_property
|
||||
@@ -419,6 +422,12 @@ class Tici(HardwareBase):
|
||||
gov = 'ondemand' if powersave_enabled else 'performance'
|
||||
sudo_write(gov, f"/sys/devices/system/cpu/cpufreq/policy{n}/scaling_governor")
|
||||
|
||||
# *** IRQ config ***
|
||||
affine_irq(5, 565) # kgsl-3d0
|
||||
affine_irq(4, 740) # xhci-hcd:usb1 goes on the boardd core
|
||||
for irq in range(237, 246):
|
||||
affine_irq(5, irq) # camerad
|
||||
|
||||
def get_gpu_usage_percent(self):
|
||||
try:
|
||||
used, total = open('/sys/class/kgsl/kgsl-3d0/gpubusy').read().strip().split()
|
||||
@@ -432,6 +441,14 @@ class Tici(HardwareBase):
|
||||
# Allow thermald to write engagement status to kmsg
|
||||
os.system("sudo chmod a+w /dev/kmsg")
|
||||
|
||||
# *** IRQ config ***
|
||||
|
||||
# move these off the default core
|
||||
affine_irq(1, 7) # msm_drm
|
||||
affine_irq(1, 250) # msm_vidc
|
||||
affine_irq(1, 8) # i2c_geni (sensord)
|
||||
sudo_write("f", "/proc/irq/default_smp_affinity")
|
||||
|
||||
# *** GPU config ***
|
||||
sudo_write("0", "/sys/class/kgsl/kgsl-3d0/min_pwrlevel")
|
||||
sudo_write("0", "/sys/class/kgsl/kgsl-3d0/max_pwrlevel")
|
||||
@@ -472,3 +489,9 @@ class Tici(HardwareBase):
|
||||
pass
|
||||
|
||||
return r
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
t = Tici()
|
||||
t.initialize_hardware()
|
||||
t.set_power_save(False)
|
||||
|
||||
Reference in New Issue
Block a user