mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
MALI: midgard: Fix power coefficient overflow
Change-Id: Ie0ceca32a33a5a8da56d3a32913e819a7e31e45b Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
This commit is contained in:
@@ -99,6 +99,7 @@ static int model_static_coeff(struct kbase_ipa_model *model, u32 *coeffp)
|
||||
struct kbase_ipa_model_simple_data *model_data =
|
||||
(struct kbase_ipa_model_simple_data *) model->model_data;
|
||||
struct thermal_zone_device *gpu_tz = model_data->gpu_tz;
|
||||
u64 coeffp_big;
|
||||
|
||||
if (gpu_tz) {
|
||||
int ret;
|
||||
@@ -115,9 +116,8 @@ static int model_static_coeff(struct kbase_ipa_model *model, u32 *coeffp)
|
||||
|
||||
temp_scaling_factor = calculate_temp_scaling_factor(model_data->ts,
|
||||
temp);
|
||||
|
||||
*coeffp = model_data->static_coefficient * temp_scaling_factor;
|
||||
*coeffp /= 1000000;
|
||||
coeffp_big = (u64)model_data->static_coefficient * temp_scaling_factor;
|
||||
*coeffp = div_u64(coeffp_big, 1000000);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user