mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-01 03:22:07 +08:00
clamp gpu usage to fix thermald crash (#21548)
old-commit-hash: 3adfd1d53bfe7d1ddb7be2299fbac56fac025a41
This commit is contained in:
@@ -381,6 +381,7 @@ class Android(HardwareBase):
|
||||
def get_gpu_usage_percent(self):
|
||||
try:
|
||||
used, total = open('/sys/devices/soc/b00000.qcom,kgsl-3d0/kgsl/kgsl-3d0/gpubusy').read().strip().split()
|
||||
return 100.0 * int(used) / int(total)
|
||||
perc = 100.0 * int(used) / int(total)
|
||||
return min(max(perc, 0), 100)
|
||||
except Exception:
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user