From: Jiyu Yang Date: Wed, 23 Oct 2019 17:10:38 +0000 (+0800) Subject: gpu: reset keep_count when loading shake[2/3] X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=606bcb0fb7eac5d43c86f98165918250856057bd;p=GitHub%2FLineageOS%2FG12%2Fandroid_hardware_amlogic_kernel-modules_mali-driver.git gpu: reset keep_count when loading shake[2/3] PD#SWPL-15215 Problem: preheat clk usually set before utilization is zero, which lead stay_count go down from zero. Solution: 1. reset stay_count when utilization in threshold 2. reset stay_count when preheat Verify: newton_BCM Change-Id: Ia697fe129189c9481b5ec6180c65911866ed1a8d Signed-off-by: Jiyu Yang --- diff --git a/dvalin/kernel/drivers/gpu/arm/midgard/platform/devicetree/scaling.c b/dvalin/kernel/drivers/gpu/arm/midgard/platform/devicetree/scaling.c index 081a97b..eafa237 100644 --- a/dvalin/kernel/drivers/gpu/arm/midgard/platform/devicetree/scaling.c +++ b/dvalin/kernel/drivers/gpu/arm/midgard/platform/devicetree/scaling.c @@ -64,6 +64,7 @@ MODULE_PARM_DESC(scaling_dbg_level , "scaling debug level"); } while (0) #ifndef CONFIG_MALI_DVFS +static int mali_stay_count = 0; static inline void mali_clk_exected(void) { mali_dvfs_threshold_table * pdvfs = pmali_plat->dvfs_table; @@ -219,6 +220,10 @@ u32 set_mali_rt_clkpp(u32 clk, u32 pp, u32 flush) else ret = 1; } + + if (flush) + mali_stay_count = pmali_plat->dvfs_table[currentStep].keep_count; + if (pp < pinfo->minpp) pp = pinfo->minpp; else if (pp > pinfo->maxpp) @@ -363,7 +368,6 @@ void trace_utilization(int utilization_gpu, u32 current_idx, u32 next, #endif #ifndef CONFIG_MALI_DVFS -static int mali_stay_count = 0; static void mali_decide_next_status(int utilization_pp, int* next_fs_idx, int* pp_change_flag) { @@ -448,6 +452,10 @@ static void mali_decide_next_status(int utilization_pp, int* next_fs_idx, } else if (change_mode == 2) { /* decrease PPS */ *pp_change_flag = -1; } + } else { + mali_stay_count = pmali_plat->dvfs_table[currentStep].keep_count; + scalingdbg(1, "reset to %d, decided_fs_idx=%d, mali_stay_count=%d\n", + currentStep, decided_fs_idx, mali_stay_count); } if (decided_fs_idx < 0 ) { @@ -463,6 +471,7 @@ static void mali_decide_next_status(int utilization_pp, int* next_fs_idx, mali_stay_count = pmali_plat->dvfs_table[decided_fs_idx].keep_count; *next_fs_idx = decided_fs_idx; + scalingdbg(1, "mali_stay_count=%d\n", mali_stay_count); } #endif