| OLD | NEW |
| 1 # Copyright 2016 Google Inc. | 1 # Copyright 2016 Google Inc. |
| 2 # | 2 # |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 from _hardware import HardwareException, Expectation | 6 from _hardware import HardwareException, Expectation |
| 7 from _hardware_android import HardwareAndroid | 7 from _hardware_android import HardwareAndroid |
| 8 | 8 |
| 9 CPU_CLOCK_RATE = 1728000 | 9 CPU_CLOCK_RATE = 1728000 |
| 10 GPU_CLOCK_RATE = 510000000 | 10 GPU_CLOCK_RATE = 510000000 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 | 99 |
| 100 # turn the disabled cores back on. | 100 # turn the disabled cores back on. |
| 101 self._adb.shell('''\ | 101 self._adb.shell('''\ |
| 102 for N in 7 3 2 1 0; do | 102 for N in 7 3 2 1 0; do |
| 103 echo 1 > /sys/devices/system/cpu/cpu$N/online | 103 echo 1 > /sys/devices/system/cpu/cpu$N/online |
| 104 done''') | 104 done''') |
| 105 | 105 |
| 106 # unlock the 3 enabled big cores. | 106 # unlock the 3 enabled big cores. |
| 107 self._adb.shell('''\ | 107 self._adb.shell('''\ |
| 108 for N in 6 5 4; do | 108 for N in 6 5 4; do |
| 109 echo 633600 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_min_freq | 109 echo 633600 > /sys/devices/system/cpu/cpu$N/cpufreq/scaling_min_freq |
| 110 echo 1958400 > /sys/devices/system/cpu/cpu4/cpufreq/scaling_max_freq | 110 echo 1958400 > /sys/devices/system/cpu/cpu$N/cpufreq/scaling_max_freq |
| 111 echo 0 > /sys/devices/system/cpu/cpu$N/cpufreq/scaling_setspeed | 111 echo 0 > /sys/devices/system/cpu/cpu$N/cpufreq/scaling_setspeed |
| 112 echo interactive > /sys/devices/system/cpu/cpu$N/cpufreq/scaling_governo
r | 112 echo interactive > /sys/devices/system/cpu/cpu$N/cpufreq/scaling_governo
r |
| 113 done''') | 113 done''') |
| 114 | 114 |
| 115 self._adb.shell('''\ | 115 self._adb.shell('''\ |
| 116 start mpdecision | 116 start mpdecision |
| 117 start perfd | 117 start perfd |
| 118 start thermald | 118 start thermald |
| 119 start thermal-engine''') | 119 start thermal-engine''') |
| 120 | 120 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 146 name='ddr clock rate', sleeptime=10)] + \ | 146 name='ddr clock rate', sleeptime=10)] + \ |
| 147 [Expectation(int, exact_value=CPU_CLOCK_RATE, name='cpu_%i clock rate' %i) | 147 [Expectation(int, exact_value=CPU_CLOCK_RATE, name='cpu_%i clock rate' %i) |
| 148 for i in range(4, 7)] | 148 for i in range(4, 7)] |
| 149 | 149 |
| 150 Expectation.check_all(expectations, result) | 150 Expectation.check_all(expectations, result) |
| 151 | 151 |
| 152 def sleep(self, sleeptime): | 152 def sleep(self, sleeptime): |
| 153 self._unlock_clocks() | 153 self._unlock_clocks() |
| 154 HardwareAndroid.sleep(self, sleeptime) | 154 HardwareAndroid.sleep(self, sleeptime) |
| 155 self._lock_clocks() | 155 self._lock_clocks() |
| OLD | NEW |