Lines Matching refs:sensor_status
561 const SensorStatus &sensor_status) { in getTargetStateOfPID() argument
570 if (severity > sensor_status.severity) { in getTargetStateOfPID()
579 SensorStatus *sensor_status, in pidPowerCalculator() argument
586 if (!target_state || (sensor_status->severity == ThrottlingSeverity::NONE)) { in pidPowerCalculator()
587 sensor_status->err_integral = 0; in pidPowerCalculator()
588 sensor_status->prev_err = NAN; in pidPowerCalculator()
596 i = sensor_status->err_integral * sensor_info.throttling_info->k_i[target_state]; in pidPowerCalculator()
601 sensor_status->err_integral += err; in pidPowerCalculator()
605 if (!std::isnan(sensor_status->prev_err) && in pidPowerCalculator()
607 d = sensor_info.throttling_info->k_d[target_state] * (err - sensor_status->prev_err) / in pidPowerCalculator()
611 sensor_status->prev_err = err; in pidPowerCalculator()
622 << " err_integral=" << sensor_status->err_integral in pidPowerCalculator()
630 bool ThermalHelper::requestCdevByPower(std::string_view sensor_name, SensorStatus *sensor_status, in requestCdevByPower() argument
660 sensor_status->pid_request_map.at(binded_cdev_info_pair.first) = static_cast<int>(j); in requestCdevByPower()
669 void ThermalHelper::requestCdevBySeverity(std::string_view sensor_name, SensorStatus *sensor_status, in requestCdevBySeverity() argument
672 sensor_status->hard_limit_request_map.at(binded_cdev_info_pair.first) = in requestCdevBySeverity()
674 .limit_info[static_cast<size_t>(sensor_status->severity)]; in requestCdevBySeverity()
677 << sensor_status->hard_limit_request_map.at(binded_cdev_info_pair.first); in requestCdevBySeverity()
683 const SensorStatus &sensor_status, std::vector<std::string> *cooling_devices_to_update) { in computeCoolingDevicesRequest() argument
696 binded_cdev_info.cdev_ceiling[static_cast<size_t>(sensor_status.severity)]; in computeCoolingDevicesRequest()
699 .cdev_floor_with_power_link[static_cast<size_t>(sensor_status.severity)]; in computeCoolingDevicesRequest()
702 if (sensor_status.pid_request_map.count(cdev_request_pair.first)) { in computeCoolingDevicesRequest()
703 pid_request = sensor_status.pid_request_map.at(cdev_request_pair.first); in computeCoolingDevicesRequest()
706 if (sensor_status.hard_limit_request_map.count(cdev_request_pair.first)) { in computeCoolingDevicesRequest()
707 hard_limit_request = sensor_status.hard_limit_request_map.at(cdev_request_pair.first); in computeCoolingDevicesRequest()
1164 SensorStatus &sensor_status = name_status_pair.second; in thermalWatcherCallbackFunc() local
1173 auto sleep_ms = (sensor_status.severity != ThrottlingSeverity::NONE) in thermalWatcherCallbackFunc()
1177 if (sensor_status.last_update_time == boot_clock::time_point::min()) { in thermalWatcherCallbackFunc()
1183 now - sensor_status.last_update_time); in thermalWatcherCallbackFunc()
1235 if (throtting_status.first != sensor_status.prev_hot_severity) { in thermalWatcherCallbackFunc()
1236 sensor_status.prev_hot_severity = throtting_status.first; in thermalWatcherCallbackFunc()
1238 if (throtting_status.second != sensor_status.prev_cold_severity) { in thermalWatcherCallbackFunc()
1239 sensor_status.prev_cold_severity = throtting_status.second; in thermalWatcherCallbackFunc()
1241 if (temp.throttlingStatus != sensor_status.severity) { in thermalWatcherCallbackFunc()
1244 sensor_status.severity = temp.throttlingStatus; in thermalWatcherCallbackFunc()
1245 sleep_ms = (sensor_status.severity != ThrottlingSeverity::NONE) in thermalWatcherCallbackFunc()
1251 if (sensor_status.severity != ThrottlingSeverity::NONE) { in thermalWatcherCallbackFunc()
1258 if (sensor_status.pid_request_map.size()) { in thermalWatcherCallbackFunc()
1259 size_t target_state = getTargetStateOfPID(sensor_info, sensor_status); in thermalWatcherCallbackFunc()
1260 float power_budget = pidPowerCalculator(temp, sensor_info, &sensor_status, in thermalWatcherCallbackFunc()
1262 if (!requestCdevByPower(name_status_pair.first, &sensor_status, sensor_info, in thermalWatcherCallbackFunc()
1268 if (sensor_status.hard_limit_request_map.size()) { in thermalWatcherCallbackFunc()
1270 requestCdevBySeverity(name_status_pair.first, &sensor_status, sensor_info); in thermalWatcherCallbackFunc()
1274 if (sensor_status.pid_request_map.size() || sensor_status.hard_limit_request_map.size()) { in thermalWatcherCallbackFunc()
1275 if (sensor_status.severity == ThrottlingSeverity::NONE) { in thermalWatcherCallbackFunc()
1286 sensor_status.severity, time_elapsed_ms, in thermalWatcherCallbackFunc()
1296 computeCoolingDevicesRequest(name_status_pair.first, sensor_info, sensor_status, in thermalWatcherCallbackFunc()
1305 sensor_status.last_update_time = now; in thermalWatcherCallbackFunc()