From 99df44412f58e5f58c5e360b4f01c81cc475b524 Mon Sep 17 00:00:00 2001 From: Tao Zeng Date: Fri, 19 Dec 2014 16:33:31 +0800 Subject: [PATCH] PD #94468: change mali driver to support keep mode of thermal governor Change-Id: I324e06252d4e0b5118a11ce0458b9e800a71b134 Conflicts: mali/platform/meson_m450/platform_m8b.c --- mali/platform/mali_clock.c | 6 +++++- mali/platform/meson_m450/platform_m8b.c | 18 ++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/mali/platform/mali_clock.c b/mali/platform/mali_clock.c index 23a3623..a113a39 100755 --- a/mali/platform/mali_clock.c +++ b/mali/platform/mali_clock.c @@ -97,7 +97,11 @@ void enable_clock(void) u32 get_mali_freq(u32 idx) { - return pmali_plat->clk_sample[idx]; + if (mali_pm_statue) { + return pmali_plat->clk_sample[idx]; + } else { + return 0; + } } void set_str_src(u32 data) diff --git a/mali/platform/meson_m450/platform_m8b.c b/mali/platform/meson_m450/platform_m8b.c index 0ecde2d..2514a4d 100755 --- a/mali/platform/meson_m450/platform_m8b.c +++ b/mali/platform/meson_m450/platform_m8b.c @@ -171,7 +171,7 @@ static u32 get_limit_mali_freq(void) { return mali_plat_data.scale_info.maxclk; } -#if 0 + static u32 set_limit_pp_num(u32 num) { u32 ret = -1; @@ -186,7 +186,6 @@ static u32 set_limit_pp_num(u32 num) quit: return ret; } -#endif int mali_meson_init_start(struct platform_device* ptr_plt_dev) { @@ -357,8 +356,10 @@ void mali_post_init(void) #ifdef CONFIG_GPU_THERMAL int err; struct gpufreq_cooling_device *gcdev = NULL; + struct gpucore_cooling_device *gccdev = NULL; gcdev = gpufreq_cooling_alloc(); + register_gpu_freq_info(get_current_frequency); if(IS_ERR(gcdev)) printk("malloc gpu cooling buffer error!!\n"); else if(!gcdev) @@ -374,5 +375,18 @@ void mali_post_init(void) printk("gpu cooling register okay with err=%d\n",err); } + gccdev=gpucore_cooling_alloc(); + if(IS_ERR(gccdev)) + printk("malloc gpu core cooling buffer error!!\n"); + else if(!gccdev) + printk("system does not enable thermal driver\n"); + else { + gccdev->max_gpu_core_num=mali_plat_data.cfg_pp; + gccdev->set_max_pp_num=set_limit_pp_num; + err = (int)gpucore_cooling_register(gccdev); + if(err < 0) + printk("register GPU cooling error\n"); + printk("gpu core cooling register okay with err=%d\n",err); + } #endif } -- 2.20.1