ANDROID: thermal: Add a flag for vendor hook enable_thermal_power_throt-
tle Taking in account of SoC's surface temperature, we have to use more str- ict temperature control to make IPA can monitor and mitigate temperature control earlier and faster. It means power budget will be overridden wi- th a more strict one(user power budget). So add an override flag. It is not the same as "enable" flag. Originally, whether the IPA turns on or not depends on whether the temperature exceeds switch_on_temp,the- refore add "enable" flag. About enable flag: true: enable IPA control when temperature >= swtich_on_temp false: disable IPA control when temperature < switch_on_temp Now in order not to affect the original logic, add flag "override". About override flag: true: power budget is overridden by user power budget, and then thermal power throttle takes action even if temperature < switch_on_temp. false: power budget is not overridden, there's no other thermal requirm- ent. Normal temperature control. Bug: 209386157 Signed-off-by: Di Shen <di.shen@unisoc.com> Change-Id: Ia9bbded636809d89d90a330df302391a5f4b3f5a
This commit is contained in:
@@ -714,7 +714,8 @@ static int power_allocator_throttle(struct thermal_zone_device *tz, int trip)
|
||||
int switch_on_temp, control_temp;
|
||||
struct power_allocator_params *params = tz->governor_data;
|
||||
bool update;
|
||||
int enable = 1;
|
||||
bool enable = true;
|
||||
bool override = false;
|
||||
|
||||
/*
|
||||
* We get called for every trip point but we only need to do
|
||||
@@ -723,11 +724,22 @@ static int power_allocator_throttle(struct thermal_zone_device *tz, int trip)
|
||||
if (trip != params->trip_max_desired_temperature)
|
||||
return 0;
|
||||
|
||||
trace_android_vh_enable_thermal_power_throttle(&enable);
|
||||
/*
|
||||
* Enable or disable IPA control by temperature and user power budget.
|
||||
* About enable:
|
||||
* true: enable IPA control when temperature >= swtich_on_temp.
|
||||
* false: disable IPA control when temperature < switch_on_temp.
|
||||
* About override:
|
||||
* true: power budget is overridden by user power budget.
|
||||
* false: power budget is not overridden, there's no other thermal
|
||||
* requirement.
|
||||
*/
|
||||
trace_android_vh_enable_thermal_power_throttle(&enable, &override);
|
||||
if (enable)
|
||||
ret = tz->ops->get_trip_temp(tz, params->trip_switch_on,
|
||||
&switch_on_temp);
|
||||
if (!enable || (!ret && (tz->temperature < switch_on_temp))) {
|
||||
if (!enable || (!ret && (tz->temperature < switch_on_temp) &&
|
||||
!override)) {
|
||||
update = (tz->last_temperature >= switch_on_temp);
|
||||
tz->passive = 0;
|
||||
reset_pid_controller(params);
|
||||
|
||||
@@ -27,8 +27,8 @@ DECLARE_HOOK(android_vh_thermal_unregister,
|
||||
TP_ARGS(policy));
|
||||
|
||||
DECLARE_HOOK(android_vh_enable_thermal_power_throttle,
|
||||
TP_PROTO(int *enable),
|
||||
TP_ARGS(enable));
|
||||
TP_PROTO(bool *enable, bool *override),
|
||||
TP_ARGS(enable, override));
|
||||
|
||||
DECLARE_HOOK(android_vh_thermal_power_cap,
|
||||
TP_PROTO(u32 *power_range),
|
||||
|
||||
Reference in New Issue
Block a user