clockworkpi / DevTerm

This code repository offers downloads for the latest images of various DevTerm models, as well as kernel patches, keyboard firmware, the source code for screen and printer drivers, hardware schematics, assembly instructions, and essential technical documents.
GNU Lesser General Public License v2.1
384 stars 68 forks source link

gearbox script shows hardcoded gpu governor instead of the current one. #24

Closed Mihaylov93 closed 2 years ago

Mihaylov93 commented 2 years ago

Expected:

> cat /sys/devices/platform/ff9a0000.gpu/devfreq/ff9a0000.gpu/governor
performance

Current:

> ./devterm-a06-gearbox

Current Status:
+-----------------------------------+-----------------+-----------+
|            Cortex-A53             |   Cortex-A72    | Mali-T860 |
+--------+--------+--------+--------+--------+--------+-----------+
| CPU 0  | CPU 1  | CPU 2  | CPU 3  | CPU 4  | CPU 5  |    GPU    |
+--------+--------+--------+--------+--------+--------+-----------+
| 408Mhz | 408Mhz | 408Mhz | 408Mhz |  OFF   |  OFF   |   200MHz  |
+--------+--------+--------+--------+--------+--------+-----------+
CPU Governor: schedutil    GPU Governor: simple_ondemand

Responsible code: https://github.com/clockworkpi/DevTerm/blob/main/Code/A06/devterm-a06-gearbox#L189

print("CPU Governor: %s GPU Governor: %s" % (self.get_cpu_gov(), self.gear["gpu_gov"]))

Solution: Read it from the filesystem

    @property
    def gpu_gov(self) -> str:
        with open(
            "/sys/devices/platform/ff9a0000.gpu/devfreq/ff9a0000.gpu/governor", "r"
        ) as gov_file:
            return gov_file.read().strip()