Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5d725961 authored by Deepak Kumar's avatar Deepak Kumar
Browse files

msm: kgsl: Ensure that thermal power level restrictions are enforced



Add checks to make sure thermal power level restrictions are
enforced and power level is always within thermal min and max
limit. Currently, thermal limits are breached in cases where
GPU min_pwrlevel and max_pwrlevel sysfs entries are updated by
performance daemon to maintain performance and thermal mitigation
kicks in at same time.

Change-Id: Id3f0c2d878588633398d20d43223b26ec292b98e
Signed-off-by: default avatarDeepak Kumar <dkumar@codeaurora.org>
parent fff51c15
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -178,6 +178,12 @@ static unsigned int _adjust_pwrlevel(struct kgsl_pwrctrl *pwr, int level,
					pwr->thermal_pwrlevel_floor,
					pwr->min_pwrlevel);

	/* Ensure that max/min pwrlevels are within thermal max/min limits */
	max_pwrlevel = min_t(unsigned int, max_pwrlevel,
					pwr->thermal_pwrlevel_floor);
	min_pwrlevel = max_t(unsigned int, min_pwrlevel,
					pwr->thermal_pwrlevel);

	switch (pwrc->type) {
	case KGSL_CONSTRAINT_PWRLEVEL: {
		switch (pwrc->sub_type) {