From 7549cf4dd03b0c2bd16a9455152a7d1b251d422b Mon Sep 17 00:00:00 2001 From: Tao Zeng Date: Wed, 23 Sep 2015 04:46:23 +0000 Subject: PD#113199: fix bug of gpu core can't reduce. change ratio between gpu frequent steps and gpu core steps. if this ratio is not correct, it will cause core/freq can't reduce when temperature is high. Change-Id: If6615951f5995fc40928cca63e96b6b6e287ffe5 --- diff --git a/amlogic_thermal.h b/amlogic_thermal.h index 6f6d256..ec60ac4 100644 --- a/amlogic_thermal.h +++ b/amlogic_thermal.h @@ -106,5 +106,6 @@ void *aml_get_cdevdata(struct thermal_cooling_device *cdev); void aml_set_cdev_update(struct thermal_cooling_device *cdev, bool update); void aml_cdev_lockop(struct thermal_cooling_device *cdev, bool lock); void aml_cdev_get_cur_state(struct thermal_cooling_device *cdev, unsigned long *ret); +int gpu_get_freq_level(int freq); #endif /* __AMLOGIC_THERMAL_H__ */ diff --git a/amlogic_thermal.o_shipped b/amlogic_thermal.o_shipped index 6c0a6ab..7ead449 100644 --- a/amlogic_thermal.o_shipped +++ b/amlogic_thermal.o_shipped @@ -1,19 +1,20 @@ -ELF +ELF €¹àªA €¹C -€¹C -@¹ˆ@¹! - - +€¹C +@¹ˆ@¹! + + ‡* -! - -‡* -  -  +¥ + +‡* +  +  - + + @@ -24,158 +25,157 @@ - - + + - +  "  Œ - 8 -_= - - + 8 +Y= + +       - +   - - - - - + + + + +  - - - + + +  - - + +  - - - - - -•" + + + + + +•" 2'Z% - -Ý - -— -Ò -> - -M -M -X -X -^ - -j - : ;  - - - - - - - - - - - - - - s  !z #"!!/11"0v  .>=5",0!L=LÕ + +Ý + +— +Ò + +G +G +G +H +X +Y +Y +H +X + +Y +Y +j + : ;  + + + + + + + + + + + + + s  !z #"!!/11"0v  .>=5",0!L=LÕ ÓAÞÝ  -ÔÓAÖÕAÞÝ  +ÔÓAÖÕAÞÝ  ž A C“”•–—˜W ÔÓAÖÕAØ×AÞÝ  - AÔÓAÖÕAÞÝ + AÔÓAÖÕAÞÝ ˜ ™šI - AÔÓAÖÕAØ×AÚÙAÞÝ - + AÔÓAÖÕAØ×AÚÙAÞÝ + - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - - - - - - - - - - - - -F - -N - -$ - -& - - -- -0 - - - - - - -? - - - -f - -A -h - - - - - - - - - + + + + + + + + + + + + + + +$ +& + +6 -u - +9 + + + + + +? + + + + + + + + +e + + +G + + + + + + + + + + + + diff --git a/amlogic_thermal_module.c b/amlogic_thermal_module.c index 3965d06..afd2cac 100644 --- a/amlogic_thermal_module.c +++ b/amlogic_thermal_module.c @@ -69,6 +69,7 @@ EXPORT_SYMBOL(freq_update_flag); static struct aml_virtual_thermal_device cpu_virtual_thermal = {}; static struct aml_virtual_thermal_device gpu_virtual_thermal = {}; static unsigned int report_interval[4] = {}; +static int (*gpu_freq_level)(int ) = NULL; /* CPU Zone information */ #define PANIC_ZONE 4 @@ -206,6 +207,13 @@ static int amlogic_get_crit_temp(struct thermal_zone_device *thermal, return ret; } +int gpu_get_freq_level(int freq) +{ + if (gpu_freq_level) + return gpu_freq_level(freq); + else + return -1; +} /* Bind callback functions for thermal zone */ static int amlogic_bind(struct thermal_zone_device *thermal, @@ -252,6 +260,8 @@ static int amlogic_bind(struct thermal_zone_device *thermal, ret = -EINVAL; pr_info("invalidate pointer %p\n",gpufreq_dev->get_gpu_freq_level); goto out; + } else { + gpu_freq_level = gpufreq_dev->get_gpu_freq_level; } pdata->tmp_trip[i].gpu_lower_level=gpufreq_dev->get_gpu_freq_level(pdata->tmp_trip[i].gpu_upper_freq); pdata->tmp_trip[i].gpu_upper_level=gpufreq_dev->get_gpu_freq_level(pdata->tmp_trip[i].gpu_lower_freq); -- cgit