int mali_meson_init_finish(struct platform_device* ptr_plt_dev)
{
#ifdef CONFIG_GPU_THERMAL
	int err;
	struct gpufreq_cooling_device *gcdev = NULL;
	struct gpucore_cooling_device *gccdev = NULL;
#endif
	if (mali_core_scaling_init(&mali_plat_data) < 0)
		return -1;

#ifdef CONFIG_GPU_THERMAL
	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)
		printk("system does not enable thermal driver\n");
	else {
		gcdev->get_gpu_freq_level = get_mali_freq_level;
		gcdev->get_gpu_max_level = get_mali_max_level;
		gcdev->set_gpu_freq_idx = set_limit_mali_freq;
		gcdev->get_gpu_current_max_level = get_limit_mali_freq;
		err = gpufreq_cooling_register(gcdev);
		if(err < 0)
			printk("register GPU  cooling error\n");
		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
#ifdef CONFIG_AM_VDEC_H264_4K2K
	vh264_4k2k_register_module_callback(mali_4k2k_enter, mali_4k2k_exit);
#endif /* CONFIG_AM_VDEC_H264_4K2K */
	return 0;
}
Пример #2
0
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)
        printk("system does not enable thermal driver\n");
    else {
        gcdev->get_gpu_freq_level = get_mali_freq_level;
        gcdev->get_gpu_max_level = get_mali_max_level;
        gcdev->set_gpu_freq_idx = set_limit_mali_freq;
        gcdev->get_gpu_current_max_level = get_limit_mali_freq;
        err = gpufreq_cooling_register(gcdev);
        if (err < 0)
            printk("register GPU  cooling error\n");
        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
}