PD #94468: change mali driver to support keep mode of thermal governor
authorTao Zeng <tao.zeng@amlogic.com>
Fri, 19 Dec 2014 08:33:31 +0000 (16:33 +0800)
committerKasin Lee <kasin.li@amlogic.com>
Fri, 26 Dec 2014 11:02:57 +0000 (19:02 +0800)
Change-Id: I324e06252d4e0b5118a11ce0458b9e800a71b134

Conflicts:

mali/platform/meson_m450/platform_m8b.c

mali/platform/mali_clock.c
mali/platform/meson_m450/platform_m8b.c

index 23a3623eac46355d246a74b1e53bec94e1b24e0b..a113a394978e7ea6ac45e4534fdd72f1343dc3f2 100755 (executable)
@@ -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)
index 0ecde2da8d050ac99ffc5b0a06368ddcddc8041f..2514a4df9a9249e3253e3404e2efac41d68e472c 100755 (executable)
@@ -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
 }