示例#1
0
void set_mali_schel_mode(u32 mode)
{
#ifndef CONFIG_MALI_DVFS
    MALI_DEBUG_ASSERT(mode < MALI_SCALING_MODE_MAX);
    if (mode >= MALI_SCALING_MODE_MAX)
        return;
	scaling_mode = MALI_TURBO_MODE;

    /* set default performance range. */
    pmali_plat->scale_info.minclk = pmali_plat->cfg_min_clock;
    pmali_plat->scale_info.maxclk = pmali_plat->cfg_clock;
    pmali_plat->scale_info.minpp = pmali_plat->cfg_min_pp;
    pmali_plat->scale_info.maxpp = pmali_plat->cfg_pp;

    /* set current status and tune max freq */
    if (scaling_mode == MALI_PP_FS_SCALING) {
        pmali_plat->scale_info.maxclk = pmali_plat->cfg_clock;
        enable_pp_cores(pmali_plat->sc_mpp);
    } else if (scaling_mode == MALI_SCALING_DISABLE) {
        pmali_plat->scale_info.maxclk = pmali_plat->cfg_clock;
        enable_max_num_cores();
    } else if (scaling_mode == MALI_TURBO_MODE) {
        pmali_plat->scale_info.maxclk = pmali_plat->turbo_clock;
        enable_max_num_cores();
    }
    currentStep = pmali_plat->scale_info.maxclk;
    schedule_work(&wq_work);
#endif
}
void mali_core_scaling_update(struct mali_gpu_utilization_data *data)
{
	/*
	 * This function implements a very trivial PP core scaling algorithm.
	 *
	 * It is _NOT_ of production quality.
	 * The only intention behind this algorithm is to exercise and test the
	 * core scaling functionality of the driver.
	 * It is _NOT_ tuned for neither power saving nor performance!
	 *
	 * Other metrics than PP utilization need to be considered as well
	 * in order to make a good core scaling algorithm.
	 */

	MALI_DEBUG_PRINT(3, ("Utilization: (%3d, %3d, %3d), cores enabled: %d/%d\n", data->utilization_gpu, data->utilization_gp, data->utilization_pp, num_cores_enabled, num_cores_total));

	/* NOTE: this function is normally called directly from the utilization callback which is in
	 * timer context. */

	if (PERCENT_OF(90, 256) < data->utilization_pp) {
		enable_max_num_cores();
	} else if (PERCENT_OF(50, 256) < data->utilization_pp) {
		enable_one_core();
	} else if (PERCENT_OF(40, 256) < data->utilization_pp) {
		/* do nothing */
	} else if (PERCENT_OF(0, 256) < data->utilization_pp) {
		disable_one_core();
	} else {
		/* do nothing */
	}
}
示例#3
0
void mali_pp_scaling_update(struct mali_gpu_utilization_data *data)
{
	int ret = 0;

	if (mali_threshold[2] < data->utilization_pp)
		ret = enable_max_num_cores();
	else if (mali_threshold[1]< data->utilization_pp)
		ret = enable_one_core();
	else if (0 < data->utilization_pp)
		ret = disable_one_core();
	if (ret == 1)
		schedule_work(&wq_work);
}