コード例 #1
0
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 */
	}
}
コード例 #2
0
ファイル: scaling.c プロジェクト: kozmo2k4/linux-amlogic
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);
}
コード例 #3
0
ファイル: scaling.c プロジェクト: DBMandrake/vero2-linux
void mali_pp_fs_scaling_update(struct mali_gpu_utilization_data *data)
{
#ifndef CONFIG_MALI_DVFS
    int ret = 0;
    int pp_change_flag = 0;
    u32 next_idx = 0;

#if LOG_MALI_SCALING
    u32 last_pp = num_cores_enabled;
#endif
    mali_decide_next_status(data, &next_idx, &pp_change_flag);

    if (pp_change_flag == 1)
        ret = enable_pp_cores(pmali_plat->sc_mpp);
    else if (pp_change_flag == 2)
        ret = enable_one_core();
    else if (pp_change_flag == -1) {
        ret = disable_one_core();
    }

#if LOG_MALI_SCALING
    if (pp_change_flag || (next_idx != currentStep))
        trace_utilization(data, currentStep, next_idx, last_pp, num_cores_enabled);
#endif

    if (next_idx != currentStep) {
        ret = 1;
        currentStep = next_idx;
    }

    if (ret == 1)
        schedule_work(&wq_work);
#ifdef CONFIG_MALI400_PROFILING
    else
        _mali_osk_profiling_add_event(MALI_PROFILING_EVENT_TYPE_SINGLE |
                MALI_PROFILING_EVENT_CHANNEL_GPU |
                MALI_PROFILING_EVENT_REASON_SINGLE_GPU_FREQ_VOLT_CHANGE,
                get_current_frequency(),
                0,	0,	0,	0);
#endif
#endif
}