| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2016 Google Inc. | 2 * Copyright 2016 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "ThermalManager.h" | 8 #include "ThermalManager.h" |
| 9 | 9 |
| 10 #include "SkOSFile.h" | 10 #include "SkOSFile.h" |
| 11 | 11 |
| 12 #include <stdio.h> | 12 #include <stdio.h> |
| 13 | 13 |
| 14 #ifndef SK_BUILD_FOR_WIN32 |
| 15 #include <unistd.h> |
| 16 #endif |
| 17 |
| 14 #ifdef THERMAL_MANAGER_SUPPORTED | 18 #ifdef THERMAL_MANAGER_SUPPORTED |
| 15 | 19 |
| 16 /* | 20 /* |
| 17 * ThermalManager is completely dependent on sysfs to monitor thermal temperatur
es. In sysfs | 21 * ThermalManager is completely dependent on sysfs to monitor thermal temperatur
es. In sysfs |
| 18 * thermal management is controlled by a number of thermal zones. They are laid
out as follows: | 22 * thermal management is controlled by a number of thermal zones. They are laid
out as follows: |
| 19 * /sys/class/thermal/thermal_zoneN where N is the number of the thermal zone st
arting at 0. | 23 * /sys/class/thermal/thermal_zoneN where N is the number of the thermal zone st
arting at 0. |
| 20 * | 24 * |
| 21 * Inside each thermal_zone folder is a file called 'temp,' which has the curren
t temperature | 25 * Inside each thermal_zone folder is a file called 'temp,' which has the curren
t temperature |
| 22 * reading from the sensor in that zone, as well as 0 or more files called 'trip
_point_N_temp.' | 26 * reading from the sensor in that zone, as well as 0 or more files called 'trip
_point_N_temp.' |
| 23 * | 27 * |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 bool wouldTrip = !fDisabled && currentTemp + fThreshold >= fPoint; | 108 bool wouldTrip = !fDisabled && currentTemp + fThreshold >= fPoint; |
| 105 | 109 |
| 106 if (wouldTrip) { | 110 if (wouldTrip) { |
| 107 SkDebugf("%s/%s would trip {%d,%d,%d,%d}\n", fThermalZoneRoot.c_str(), | 111 SkDebugf("%s/%s would trip {%d,%d,%d,%d}\n", fThermalZoneRoot.c_str(), |
| 108 fPointName.c_str(), fBase, currentTemp, fPoint, fThreshold); | 112 fPointName.c_str(), fBase, currentTemp, fPoint, fThreshold); |
| 109 } | 113 } |
| 110 return wouldTrip; | 114 return wouldTrip; |
| 111 } | 115 } |
| 112 | 116 |
| 113 #endif | 117 #endif |
| OLD | NEW |