本文整理汇总了C++中pm_qos_request函数的典型用法代码示例。如果您正苦于以下问题:C++ pm_qos_request函数的具体用法?C++ pm_qos_request怎么用?C++ pm_qos_request使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了pm_qos_request函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: update_core_config
static int update_core_config(unsigned int cpunumber, bool up)
{
int ret = -EINVAL;
unsigned int nr_cpus = num_online_cpus();
int max_cpus = pm_qos_request(PM_QOS_MAX_ONLINE_CPUS) ? : 4;
int min_cpus = pm_qos_request(PM_QOS_MIN_ONLINE_CPUS);
if (cpq_state == TEGRA_CPQ_DISABLED || cpunumber >= nr_cpu_ids)
return ret;
if (up) {
if(is_lp_cluster()) {
cpumask_set_cpu(cpunumber, &cr_online_requests);
ret = -EBUSY;
} else {
if (tegra_cpu_edp_favor_up(nr_cpus, mp_overhead) &&
nr_cpus < max_cpus)
ret = cpu_up(cpunumber);
}
} else {
if (is_lp_cluster()) {
ret = -EBUSY;
} else {
if (nr_cpus > min_cpus)
ret = cpu_down(cpunumber);
}
}
return ret;
}
开发者ID:BxMxK,项目名称:android_kernel_asus_tf700t,代码行数:30,代码来源:cpuquiet.c
示例2: gk20a_scale_qos_notify
static int gk20a_scale_qos_notify(struct notifier_block *nb,
unsigned long n, void *p)
{
struct gk20a_scale_profile *profile =
container_of(nb, struct gk20a_scale_profile,
qos_notify_block);
struct gk20a_platform *platform = platform_get_drvdata(profile->pdev);
struct gk20a *g = get_gk20a(profile->pdev);
unsigned long freq;
if (!platform->postscale)
return NOTIFY_OK;
/* get the frequency requirement. if devfreq is enabled, check if it
* has higher demand than qos */
freq = gk20a_clk_round_rate(g, pm_qos_request(platform->qos_id));
if (g->devfreq)
freq = max(g->devfreq->previous_freq, freq);
/* Update gpu load because we may scale the emc target
* if the gpu load changed. */
gk20a_pmu_load_update(g);
platform->postscale(profile->pdev, freq);
return NOTIFY_OK;
}
开发者ID:Toradex-Apalis-TK1-AndroidTV,项目名称:android_kernel_nvidia_mm,代码行数:26,代码来源:gk20a_scale.c
示例3: cpufreq_get_touch_boost_press
unsigned int cpufreq_get_touch_boost_press(void)
{
touch_boost_press_value = pm_qos_request(PM_QOS_TOUCH_PRESS);
return touch_boost_press_value;
}
开发者ID:Valera1978,项目名称:Android_b2_Kernel,代码行数:7,代码来源:cpufreq_pmqos.c
示例4: ladder_select_state
/**
* ladder_select_state - selects the next state to enter
* @drv: cpuidle driver
* @dev: the CPU
*/
static int ladder_select_state(struct cpuidle_driver *drv,
struct cpuidle_device *dev)
{
struct ladder_device *ldev = this_cpu_ptr(&ladder_devices);
struct ladder_device_state *last_state;
int last_residency, last_idx = ldev->last_state_idx;
int latency_req = pm_qos_request(PM_QOS_CPU_DMA_LATENCY);
/* Special case when user has set very strict latency requirement */
if (unlikely(latency_req == 0)) {
ladder_do_selection(ldev, last_idx, 0);
return 0;
}
last_state = &ldev->states[last_idx];
last_residency = cpuidle_get_last_residency(dev) - drv->states[last_idx].exit_latency;
/* consider promotion */
if (last_idx < drv->state_count - 1 &&
!drv->states[last_idx + 1].disabled &&
!dev->states_usage[last_idx + 1].disable &&
last_residency > last_state->threshold.promotion_time &&
drv->states[last_idx + 1].exit_latency <= latency_req) {
last_state->stats.promotion_count++;
last_state->stats.demotion_count = 0;
if (last_state->stats.promotion_count >= last_state->threshold.promotion_count) {
ladder_do_selection(ldev, last_idx, last_idx + 1);
return last_idx + 1;
}
}
/* consider demotion */
if (last_idx > CPUIDLE_DRIVER_STATE_START &&
(drv->states[last_idx].disabled ||
dev->states_usage[last_idx].disable ||
drv->states[last_idx].exit_latency > latency_req)) {
int i;
for (i = last_idx - 1; i > CPUIDLE_DRIVER_STATE_START; i--) {
if (drv->states[i].exit_latency <= latency_req)
break;
}
ladder_do_selection(ldev, last_idx, i);
return i;
}
if (last_idx > CPUIDLE_DRIVER_STATE_START &&
last_residency < last_state->threshold.demotion_time) {
last_state->stats.demotion_count++;
last_state->stats.promotion_count = 0;
if (last_state->stats.demotion_count >= last_state->threshold.demotion_count) {
ladder_do_selection(ldev, last_idx, last_idx - 1);
return last_idx - 1;
}
}
/* otherwise remain at the current state */
return last_idx;
}
开发者ID:0x000000FF,项目名称:edison-linux,代码行数:65,代码来源:ladder.c
示例5: show_bus_int_freq_min
static ssize_t show_bus_int_freq_min(struct kobject *kobj,
struct attribute *attr, char *buf)
{
unsigned int ret = 0;
ret = sprintf(buf, "%d\n", pm_qos_request(PM_QOS_DEVICE_THROUGHPUT));
return ret;
}
开发者ID:Valera1978,项目名称:Android_b2_Kernel,代码行数:7,代码来源:cpufreq_pmqos.c
示例6: show_bimc_freq_min
static ssize_t show_bimc_freq_min(struct kobject *kobj,
struct attribute *attr, char *buf)
{
unsigned int ret = 0;
ret = sprintf(buf, "%d\n", pm_qos_request(PM_QOS_BIMC_FREQ_MIN));
return ret;
}
开发者ID:erickwill,项目名称:Gear_S_Kernel,代码行数:7,代码来源:cpufreq_pmqos.c
示例7: tegra_cpu_speed_balance
static noinline int tegra_cpu_speed_balance(void)
{
unsigned long highest_speed = tegra_cpu_highest_speed();
unsigned long balanced_speed = highest_speed * balance_level / 100;
unsigned long skewed_speed = balanced_speed / 2;
unsigned int nr_cpus = num_online_cpus();
unsigned int max_cpus = pm_qos_request(PM_QOS_MAX_ONLINE_CPUS) ? : 4;
unsigned int min_cpus = pm_qos_request(PM_QOS_MIN_ONLINE_CPUS);
/* balanced: freq targets for all CPUs are above 50% of highest speed
biased: freq target for at least one CPU is below 50% threshold
skewed: freq targets for at least 2 CPUs are below 25% threshold */
if (((tegra_count_slow_cpus(skewed_speed) >= 2) ||
tegra_cpu_edp_favor_down(nr_cpus, mp_overhead) ||
(highest_speed <= idle_bottom_freq) || (nr_cpus > max_cpus)) &&
(nr_cpus > min_cpus))
return TEGRA_CPU_SPEED_SKEWED;
if (((tegra_count_slow_cpus(balanced_speed) >= 1) ||
(!tegra_cpu_edp_favor_up(nr_cpus, mp_overhead)) ||
(highest_speed <= idle_bottom_freq) || (nr_cpus == max_cpus)) &&
(nr_cpus >= min_cpus))
return TEGRA_CPU_SPEED_BIASED;
return TEGRA_CPU_SPEED_BALANCED;
}
开发者ID:AndroidDeveloperAlliance,项目名称:ZenKernel_Grouper,代码行数:26,代码来源:cpu-tegra3.c
示例8: update_runnables_state
static void update_runnables_state(void)
{
unsigned int nr_cpus = num_online_cpus();
int max_cpus = pm_qos_request(PM_QOS_MAX_ONLINE_CPUS) ? : 4;
int min_cpus = pm_qos_request(PM_QOS_MIN_ONLINE_CPUS);
unsigned int avg_nr_run = avg_nr_running();
unsigned int nr_run;
if (runnables_state == DISABLED)
return;
for (nr_run = 1; nr_run < ARRAY_SIZE(nr_run_thresholds); nr_run++) {
unsigned int nr_threshold = nr_run_thresholds[nr_run - 1];
if (nr_run_last <= nr_run)
nr_threshold += NR_FSHIFT / nr_run_hysteresis;
if (avg_nr_run <= (nr_threshold << (FSHIFT - NR_FSHIFT_EXP)))
break;
}
nr_run_last = nr_run;
if ((nr_cpus > max_cpus || nr_run < nr_cpus) && nr_cpus >= min_cpus) {
runnables_state = DOWN;
} else if (nr_cpus < min_cpus || nr_run > nr_cpus) {
runnables_state = UP;
} else {
runnables_state = IDLE;
}
}
开发者ID:Alex-V2,项目名称:Alex-V_SE_OneX,代码行数:28,代码来源:runnable_threads.c
示例9: show_cpu_online_min
static ssize_t show_cpu_online_min(struct kobject *kobj,
struct attribute *attr, char *buf)
{
unsigned int ret = 0;
ret = sprintf(buf, "%d\n", pm_qos_request(PM_QOS_CPU_ONLINE_MIN));
return ret;
}
开发者ID:Valera1978,项目名称:Android_b2_Kernel,代码行数:7,代码来源:cpufreq_pmqos.c
示例10: devfreq_simple_ondemand_func
static int devfreq_simple_ondemand_func(struct devfreq *df,
unsigned long *freq)
{
struct devfreq_dev_status stat;
int err;
unsigned long long a, b;
unsigned int dfso_upthreshold = DFSO_UPTHRESHOLD;
unsigned int dfso_downdifferential = DFSO_DOWNDIFFERENCTIAL;
unsigned int dfso_multiplication_weight = DFSO_WEIGHT;
struct devfreq_simple_ondemand_data *data = df->data;
unsigned long max = (df->max_freq) ? df->max_freq : UINT_MAX;
unsigned long pm_qos_min = 0;
if (data) {
pm_qos_min = pm_qos_request(data->pm_qos_class);
if (pm_qos_min >= data->cal_qos_max) {
*freq = pm_qos_min;
return 0;
}
}
if (df->profile->get_dev_status) {
err = df->profile->get_dev_status(df->dev.parent, &stat);
} else {
*freq = pm_qos_min;
return 0;
}
if (err)
return err;
if (data) {
if (data->upthreshold)
dfso_upthreshold = data->upthreshold;
if (data->downdifferential)
dfso_downdifferential = data->downdifferential;
if (data->multiplication_weight)
dfso_multiplication_weight = data->multiplication_weight;
}
if (dfso_upthreshold > 100 ||
dfso_upthreshold < dfso_downdifferential)
return -EINVAL;
if (data && data->cal_qos_max)
max = (df->max_freq) ? df->max_freq : 0;
/* Assume MAX if it is going to be divided by zero */
if (stat.total_time == 0) {
if (data && data->cal_qos_max)
max = max3(max, data->cal_qos_max, pm_qos_min);
*freq = max;
return 0;
}
/* Prevent overflow */
if (stat.busy_time >= (1 << 24) || stat.total_time >= (1 << 24)) {
stat.busy_time >>= 7;
stat.total_time >>= 7;
}
开发者ID:HRTKernel,项目名称:Hybridmax_Kernel_S6,代码行数:59,代码来源:governor_simpleondemand.c
示例11: cpu_up
int __cpuinit cpu_up(unsigned int cpu)
{
int err = 0;
#ifdef CONFIG_MEMORY_HOTPLUG
int nid;
pg_data_t *pgdat;
#endif
if (num_online_cpus() >= pm_qos_request(PM_QOS_CPU_ONLINE_MAX))
return 0;
if (!cpu_possible(cpu)) {
printk(KERN_ERR "can't online cpu %d because it is not "
"configured as may-hotadd at boot time\n", cpu);
#if defined(CONFIG_IA64)
printk(KERN_ERR "please check additional_cpus= boot "
"parameter\n");
#endif
return -EINVAL;
}
#ifdef CONFIG_MEMORY_HOTPLUG
nid = cpu_to_node(cpu);
if (!node_online(nid)) {
err = mem_online_node(nid);
if (err)
return err;
}
pgdat = NODE_DATA(nid);
if (!pgdat) {
printk(KERN_ERR
"Can't online cpu %d due to NULL pgdat\n", cpu);
return -ENOMEM;
}
if (pgdat->node_zonelists->_zonerefs->zone == NULL) {
mutex_lock(&zonelists_mutex);
build_all_zonelists(NULL);
mutex_unlock(&zonelists_mutex);
}
#endif
cpu_maps_update_begin();
if (cpu_hotplug_disabled) {
err = -EBUSY;
goto out;
}
err = _cpu_up(cpu, 0);
out:
cpu_maps_update_done();
return err;
}
开发者ID:aramos1988,项目名称:Android_b2_Kernel,代码行数:57,代码来源:cpu.c
示例12: show_cpufreq_max
static ssize_t show_cpufreq_max(struct kobject *kobj,
struct attribute *attr, char *buf)
{
unsigned int ret = 0;
max_cpu_freq = pm_qos_request(PM_QOS_CPU_FREQ_MAX);
ret += snprintf(buf + ret, PAGE_SIZE - ret, "%d\n", max_cpu_freq);
return ret;
}
开发者ID:erickwill,项目名称:Gear_S_Kernel,代码行数:9,代码来源:cpufreq_pmqos.c
示例13: store_cpu_online_max
static ssize_t store_cpu_online_max(struct kobject *a, struct attribute *b,
const char *buf, size_t count)
{
set_pmqos_data(cpu_online_max_qos_array, PM_QOS_CPU_ONLINE_MAX, buf);
if (num_online_cpus() > pm_qos_request(PM_QOS_CPU_ONLINE_MAX))
cpu_down(1);
return count;
}
开发者ID:Valera1978,项目名称:Android_b2_Kernel,代码行数:9,代码来源:cpufreq_pmqos.c
示例14: store_cpu_online_min
static ssize_t store_cpu_online_min(struct kobject *a, struct attribute *b,
const char *buf, size_t count)
{
set_pmqos_data(cpu_online_min_qos_array, PM_QOS_CPU_ONLINE_MIN, buf);
if (num_online_cpus() < pm_qos_request(PM_QOS_CPU_ONLINE_MIN)) {
pr_info("%s cpu_up\n", __FUNCTION__);
cpu_up(1);
}
return count;
}
开发者ID:Valera1978,项目名称:Android_b2_Kernel,代码行数:11,代码来源:cpufreq_pmqos.c
示例15: find_coupled_state
/*
* find_couple_state - Find the maximum state platform can enter
*
* @index: pointer to variable which stores the maximum state
* @cluster: cluster number
*
* Must be called with function holds mmp_lpm_lock
*/
static void find_coupled_state(int *index, int cluster)
{
int i;
int platform_lpm = DEFAULT_LPM_FLAG;
for (i = 0; i < MAX_CPUS_PER_CLUSTER; i++)
platform_lpm &= mmp_enter_lpm[cluster][i];
*index = min(find_first_zero_bit((void *)&platform_lpm, LPM_NUM),
pm_qos_request(PM_QOS_CPUIDLE_BLOCK)) - 1;
}
开发者ID:acorn-marvell,项目名称:brillo_pxa_kernel,代码行数:20,代码来源:mmp_cpuidle.c
示例16: tegra_cpu_speed_balance
static noinline int tegra_cpu_speed_balance(void)
{
unsigned long highest_speed = tegra_cpu_highest_speed();
unsigned long balanced_speed = highest_speed * balance_level / 100;
unsigned long skewed_speed = balanced_speed / 2;
unsigned int nr_cpus = num_online_cpus();
unsigned int max_cpus = pm_qos_request(PM_QOS_MAX_ONLINE_CPUS) ? : 4;
unsigned int min_cpus = pm_qos_request(PM_QOS_MIN_ONLINE_CPUS);
unsigned int avg_nr_run = avg_nr_running();
unsigned int nr_run;
/* Evaluate:
* - distribution of freq targets for already on-lined CPUs
* - average number of runnable threads
* - effective MIPS available within EDP frequency limits,
* and return:
* TEGRA_CPU_SPEED_BALANCED to bring one more CPU core on-line
* TEGRA_CPU_SPEED_BIASED to keep CPU core composition unchanged
* TEGRA_CPU_SPEED_SKEWED to remove CPU core off-line
*/
unsigned int *current_profile = rt_profiles[rt_profile_sel];
for (nr_run = 1; nr_run < ARRAY_SIZE(rt_profile_default); nr_run++) {
unsigned int nr_threshold = current_profile[nr_run - 1];
if (nr_run_last <= nr_run)
nr_threshold += nr_run_hysteresis;
if (avg_nr_run <= (nr_threshold << (FSHIFT - NR_FSHIFT)))
break;
}
nr_run_last = nr_run;
//
#ifdef CONFIG_MACH_X3
if(threads_count_hotplug_control_enable == 0 && highest_speed >= 640000 )
nr_run++;
#endif
if (((tegra_count_slow_cpus(skewed_speed) >= 2) ||
(nr_run < nr_cpus) ||
tegra_cpu_edp_favor_down(nr_cpus, mp_overhead) ||
(highest_speed <= idle_bottom_freq) || (nr_cpus > max_cpus)) &&
(nr_cpus > min_cpus))
return TEGRA_CPU_SPEED_SKEWED;
if (((tegra_count_slow_cpus(balanced_speed) >= 1) ||
(nr_run <= nr_cpus) ||
(!tegra_cpu_edp_favor_up(nr_cpus, mp_overhead)) ||
(highest_speed <= idle_bottom_freq) || (nr_cpus == max_cpus)) &&
(nr_cpus >= min_cpus))
return TEGRA_CPU_SPEED_BIASED;
return TEGRA_CPU_SPEED_BALANCED;
}
开发者ID:JoinTheRealms,项目名称:OptimusPlay,代码行数:53,代码来源:cpu-tegra3.c
示例17: store_cpu_online_min
static ssize_t __ref store_cpu_online_min(struct kobject *a, struct attribute *b,
const char *buf, size_t count)
{
int ret = 0;
ret = set_pmqos_data(cpu_online_min_qos_array, PM_QOS_CPU_ONLINE_MIN, buf);
if (ret)
return ret;
if (num_online_cpus() < pm_qos_request(PM_QOS_CPU_ONLINE_MIN))
cpu_up(1);
return count;
}
开发者ID:erickwill,项目名称:Gear_S_Kernel,代码行数:13,代码来源:cpufreq_pmqos.c
示例18: debugfs_request_value
static int debugfs_request_value(int users)
{
struct debugfs_pm_qos_user *user = NULL;
struct pm_qos_request *req;
if (users > pm_qos_users) {
pr_info("[DDR DEVFREQ DEBUGFS] no such user\n");
return -1;
}
users--;
user = pm_qos_user[users];
req = &user->req;
return pm_qos_request(req->pm_qos_class);
}
开发者ID:XMelancholy,项目名称:android_kernel_huawei_h60,代码行数:15,代码来源:hisi_ddr_devfreq_debugfs.c
示例19: tegra_cpuquiet_work_func
static void tegra_cpuquiet_work_func(struct work_struct *work)
{
int device_busy = -1;
mutex_lock(tegra3_cpu_lock);
switch(cpq_state) {
case TEGRA_CPQ_DISABLED:
case TEGRA_CPQ_IDLE:
break;
case TEGRA_CPQ_SWITCH_TO_G:
if (is_lp_cluster()) {
if(!clk_set_parent(cpu_clk, cpu_g_clk)) {
/*catch-up with governor target speed */
tegra_cpu_set_speed_cap(NULL);
/* process pending core requests*/
device_busy = 0;
}
}
break;
case TEGRA_CPQ_SWITCH_TO_LP:
if (!is_lp_cluster() && !no_lp &&
!pm_qos_request(PM_QOS_MIN_ONLINE_CPUS)
&& num_online_cpus() == 1) {
if (!clk_set_parent(cpu_clk, cpu_lp_clk)) {
/*catch-up with governor target speed*/
tegra_cpu_set_speed_cap(NULL);
device_busy = 1;
}
}
break;
default:
pr_err("%s: invalid tegra hotplug state %d\n",
__func__, cpq_state);
}
mutex_unlock(tegra3_cpu_lock);
if (device_busy == 1) {
cpuquiet_device_busy();
} else if (!device_busy) {
apply_core_config();
cpuquiet_device_free();
}
}
开发者ID:BxMxK,项目名称:android_kernel_asus_tf700t,代码行数:45,代码来源:cpuquiet.c
示例20: tegra_auto_hotplug_governor
void tegra_auto_hotplug_governor(unsigned int cpu_freq, bool suspend)
{
if (!is_g_cluster_present())
return;
if (cpq_state == TEGRA_CPQ_DISABLED)
return;
if (suspend) {
cpq_state = TEGRA_CPQ_IDLE;
/* Switch to G-mode if suspend rate is high enough */
if (is_lp_cluster() && (cpu_freq >= idle_bottom_freq)) {
clk_set_parent(cpu_clk, cpu_g_clk);
cpuquiet_device_free();
}
return;
}
if (is_lp_cluster() && pm_qos_request(PM_QOS_MIN_ONLINE_CPUS) >= 2) {
if (cpq_state != TEGRA_CPQ_SWITCH_TO_G) {
/* Force switch */
cpq_state = TEGRA_CPQ_SWITCH_TO_G;
queue_delayed_work(
cpuquiet_wq, &cpuquiet_work, up_delay);
}
return;
}
if (is_lp_cluster() && (cpu_freq >= idle_top_freq || no_lp)) {
cpq_state = TEGRA_CPQ_SWITCH_TO_G;
queue_delayed_work(cpuquiet_wq, &cpuquiet_work, up_delay);
} else if (!is_lp_cluster() && !no_lp &&
cpu_freq <= idle_bottom_freq) {
cpq_state = TEGRA_CPQ_SWITCH_TO_LP;
queue_delayed_work(cpuquiet_wq, &cpuquiet_work, down_delay);
} else {
cpq_state = TEGRA_CPQ_IDLE;
}
}
开发者ID:BxMxK,项目名称:android_kernel_asus_tf700t,代码行数:40,代码来源:cpuquiet.c
注:本文中的pm_qos_request函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论