mirror of https://github.com/thesofproject/sof.git
[PATCH] pipeline: make CPC data "opt-in" with fallback
CPC is used to select the correct clock for the desired pipeline workload. In the case where the CPC data is not available from the manifest and the kernel driver sends a CPC of 0 then SOF should pick a platform safe level to ensure operational glitch free audio at the expense of power consumption. i.e. it's better to prioritize and preserve audio quality over audio power when CPC data is missing. Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@linux.intel.com>
This commit is contained in:
parent
f4af8cadde
commit
5f0c4e4c31
|
@ -296,14 +296,18 @@ static int add_pipeline_cps_consumption(struct comp_dev *current,
|
||||||
cd = &md->cfg.base_cfg;
|
cd = &md->cfg.base_cfg;
|
||||||
}
|
}
|
||||||
|
|
||||||
int kcps = cd->cpc * 1000 / ppl_data->p->period;
|
if (cd->cpc == 0) {
|
||||||
if (kcps == 0) {
|
/* Use maximum clock budget, assume 1ms chunk size */
|
||||||
tr_warn(pipe, "0 KCPS for module: %#x, core: %d", current->ipc_config.id, ppl_data->p->core);
|
cd->cpc = CLK_MAX_CPU_HZ / 1000;
|
||||||
} else {
|
tr_warn(pipe,
|
||||||
core_kcps_adjust(ppl_data->p->core, kcps);
|
"0 CPS requested for module: %#x, core: %d using safe max CPC: %u",
|
||||||
tr_info(pipe, "Registering KCPS consumption: %d, core: %d", kcps, ppl_data->p->core);
|
current->ipc_config.id, ppl_data->p->core, cd->cpc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int kcps = cd->cpc * 1000 / ppl_data->p->period;
|
||||||
|
tr_info(pipe, "Registering KCPS consumption: %d, core: %d", kcps, ppl_data->p->core);
|
||||||
|
core_kcps_adjust(ppl_data->p->core, kcps);
|
||||||
|
|
||||||
int summary_cps = core_kcps_get(ppl_data->p->core);
|
int summary_cps = core_kcps_get(ppl_data->p->core);
|
||||||
tr_info(pipe, "Sum of KCPS consumption: %d, core: %d", summary_cps, ppl_data->p->core);
|
tr_info(pipe, "Sum of KCPS consumption: %d, core: %d", summary_cps, ppl_data->p->core);
|
||||||
return pipeline_for_each_comp(current, ctx, dir);
|
return pipeline_for_each_comp(current, ctx, dir);
|
||||||
|
|
Loading…
Reference in New Issue