/* * Note that devfreq_recommended_opp() can modify the freq * to something that actually is in the opp table:
*/
opp = devfreq_recommended_opp(dev, freq, flags); if (IS_ERR(opp)) return PTR_ERR(opp);
/* * If the GPU is idle, devfreq is not aware, so just stash * the new target freq (to use when we return to active)
*/ if (df->idle_freq) {
df->idle_freq = *freq;
dev_pm_opp_put(opp); return 0;
}
/* * If the GPU is idle, use the shadow/saved freq to avoid * confusing devfreq (which is unaware that we are switching * to lowest freq until the device is active again)
*/ if (df->idle_freq) return df->idle_freq;
if (gpu->funcs->gpu_get_freq) return gpu->funcs->gpu_get_freq(gpu);
/* We need target support to do devfreq */ if (!gpu->funcs->gpu_busy) return;
/* * Setup default values for simple_ondemand governor tuning. We * want to throttle up at 50% load for the double-buffer case, * where due to stalling waiting for vblank we could get stuck * at (for ex) 30fps at 50% utilization.
*/
priv->gpu_devfreq_config.upthreshold = 50;
priv->gpu_devfreq_config.downdifferential = 10;
mutex_init(&df->lock);
df->suspended = true;
ret = dev_pm_qos_add_request(&gpu->pdev->dev, &df->boost_freq,
DEV_PM_QOS_MIN_FREQUENCY, 0); if (ret < 0) {
DRM_DEV_ERROR(&gpu->pdev->dev, "Couldn't initialize QoS\n"); return;
}
/* * Don't set the freq_table or max_state and let devfreq build the table * from OPP * After a deferred probe, these may have be left to non-zero values, * so set them back to zero before creating the devfreq device
*/
msm_devfreq_profile.freq_table = NULL;
msm_devfreq_profile.max_state = 0;
/* * We could have become active again before the idle work had a * chance to run, in which case the df->idle_freq would have * still been zero. In this case, no need to change freq.
*/ if (target_freq)
msm_devfreq_target(&gpu->pdev->dev, &target_freq, 0);
mutex_unlock(&df->devfreq->lock);
/* * If we've been idle for a significant fraction of a polling * interval, then we won't meet the threshold of busyness for * the governor to ramp up the freq.. so give some boost
*/ if (idle_time > msm_devfreq_profile.polling_ms) {
msm_devfreq_boost(gpu, 2);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.