mirror of https://github.com/thesofproject/sof.git
pipeline: enable copy of connected pipelines
Enables copy of connected pipelines if the pipelines were set to have the same scheduling component. Signed-off-by: Tomasz Lauda <tomasz.lauda@linux.intel.com>
This commit is contained in:
parent
506f5a78d9
commit
dcd825b923
|
@ -562,15 +562,23 @@ int pipeline_reset(struct pipeline *p, struct comp_dev *host)
|
|||
static int pipeline_comp_copy(struct comp_dev *current, void *data, int dir)
|
||||
{
|
||||
struct pipeline_data *ppl_data = data;
|
||||
int is_single_ppl = comp_is_single_pipeline(current, ppl_data->start);
|
||||
int is_same_sched =
|
||||
pipeline_is_same_sched_comp(current->pipeline,
|
||||
ppl_data->start->pipeline);
|
||||
int err = 0;
|
||||
|
||||
tracev_pipe("pipeline_comp_copy(), current->comp.id = %u, dir = %u",
|
||||
current->comp.id, dir);
|
||||
|
||||
if (!comp_is_single_pipeline(current, ppl_data->start) ||
|
||||
!comp_is_active(current)) {
|
||||
tracev_pipe("pipeline_comp_copy(), current is from "
|
||||
"another pipeline or not active");
|
||||
if (!is_single_ppl && !is_same_sched) {
|
||||
tracev_pipe("pipeline_comp_copy(), current is from another "
|
||||
"pipeline and can't be scheduled together");
|
||||
return err;
|
||||
}
|
||||
|
||||
if (!comp_is_active(current)) {
|
||||
tracev_pipe("pipeline_comp_copy(), current is not active");
|
||||
return err;
|
||||
}
|
||||
|
||||
|
|
|
@ -108,6 +108,13 @@ struct pipeline {
|
|||
/* static pipeline */
|
||||
extern struct pipeline *pipeline_static;
|
||||
|
||||
/* checks if two pipelines have the same scheduling component */
|
||||
static inline bool pipeline_is_same_sched_comp(struct pipeline *current,
|
||||
struct pipeline *previous)
|
||||
{
|
||||
return current->sched_comp == previous->sched_comp;
|
||||
}
|
||||
|
||||
/* pipeline creation and destruction */
|
||||
struct pipeline *pipeline_new(struct sof_ipc_pipe_new *pipe_desc,
|
||||
struct comp_dev *cd);
|
||||
|
|
Loading…
Reference in New Issue