Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/audio/pipeline/pipeline-graph.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,7 @@ void pipeline_posn_init(struct sof *sof)
}

/* create new pipeline - returns pipeline id or negative error */
struct pipeline *pipeline_new(struct comp_dev *cd, uint32_t pipeline_id,
uint32_t priority, uint32_t comp_id)
struct pipeline *pipeline_new(uint32_t pipeline_id, uint32_t priority, uint32_t comp_id)
{
struct sof_ipc_stream_posn posn;
struct pipeline *p;
Expand All @@ -121,7 +120,6 @@ struct pipeline *pipeline_new(struct comp_dev *cd, uint32_t pipeline_id,
}

/* init pipeline */
p->sched_comp = cd;
p->comp_id = comp_id;
p->priority = priority;
p->pipeline_id = pipeline_id;
Expand Down
4 changes: 1 addition & 3 deletions src/include/sof/audio/pipeline.h
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,12 @@ struct pipeline_data {

/**
* \brief Creates a new pipeline.
* \param[in,out] cd Pipeline component device.
* \param[in] pipeline_id Pipeline ID number.
* \param[in] priority Pipeline scheduling priority.
* \param[in] comp_id Pipeline component ID number.
* \return New pipeline pointer or NULL.
*/
struct pipeline *pipeline_new(struct comp_dev *cd, uint32_t pipeline_id,
uint32_t priority, uint32_t comp_id);
struct pipeline *pipeline_new(uint32_t pipeline_id, uint32_t priority, uint32_t comp_id);

/**
* \brief Free's a pipeline.
Expand Down
49 changes: 27 additions & 22 deletions src/ipc/helper-ipc3.c
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ int ipc_pipeline_new(struct ipc *ipc,
{
struct ipc_comp_dev *ipc_pipe;
struct pipeline *pipe;
struct ipc_comp_dev *icd;
int ret;

/* check whether the pipeline already exists */
Expand All @@ -301,28 +300,8 @@ int ipc_pipeline_new(struct ipc *ipc,
return -EINVAL;
}

/* find the scheduling component */
icd = ipc_get_comp_by_id(ipc, pipe_desc->sched_id);
if (!icd) {
tr_err(&ipc_tr, "ipc_pipeline_new(): cannot find the scheduling component, pipe_desc->sched_id = %u",
pipe_desc->sched_id);
return -EINVAL;
}

if (icd->type != COMP_TYPE_COMPONENT) {
tr_err(&ipc_tr, "ipc_pipeline_new(): icd->type (%d) != COMP_TYPE_COMPONENT for pipeline scheduling component icd->id %d",
icd->type, icd->id);
return -EINVAL;
}

if (icd->core != pipe_desc->core) {
tr_err(&ipc_tr, "ipc_pipeline_new(): icd->core (%d) != pipe_desc->core (%d) for pipeline scheduling component icd->id %d",
icd->core, pipe_desc->core, icd->id);
return -EINVAL;
}

/* create the pipeline */
pipe = pipeline_new(icd->cd, pipe_desc->pipeline_id, pipe_desc->priority,
pipe = pipeline_new(pipe_desc->pipeline_id, pipe_desc->priority,
pipe_desc->comp_id);
if (!pipe) {
tr_err(&ipc_tr, "ipc_pipeline_new(): pipeline_new() failed");
Expand Down Expand Up @@ -396,6 +375,8 @@ int ipc_pipeline_free(struct ipc *ipc, uint32_t comp_id)
int ipc_pipeline_complete(struct ipc *ipc, uint32_t comp_id)
{
struct ipc_comp_dev *ipc_pipe;
struct ipc_comp_dev *icd;
struct pipeline *p;
uint32_t pipeline_id;
struct ipc_comp_dev *ipc_ppl_source;
struct ipc_comp_dev *ipc_ppl_sink;
Expand All @@ -413,6 +394,30 @@ int ipc_pipeline_complete(struct ipc *ipc, uint32_t comp_id)
if (!cpu_is_me(ipc_pipe->core))
return ipc_process_on_core(ipc_pipe->core);

p = ipc_pipe->pipeline;

/* find the scheduling component */
icd = ipc_get_comp_by_id(ipc, p->sched_id);
if (!icd) {
tr_err(&ipc_tr, "ipc_pipeline_complete(): cannot find the scheduling component, p->sched_id = %u",
p->sched_id);
return -EINVAL;
}

if (icd->type != COMP_TYPE_COMPONENT) {
tr_err(&ipc_tr, "ipc_pipeline_complete(): icd->type (%d) != COMP_TYPE_COMPONENT for pipeline scheduling component icd->id %d",
icd->type, icd->id);
return -EINVAL;
}

if (icd->core != ipc_pipe->core) {
tr_err(&ipc_tr, "ipc_pipeline_complete(): icd->core (%d) != ipc_pipe->core (%d) for pipeline scheduling component icd->id %d",
icd->core, ipc_pipe->core, icd->id);
return -EINVAL;
}

p->sched_comp = icd->cd;

pipeline_id = ipc_pipe->pipeline->pipeline_id;

tr_dbg(&ipc_tr, "ipc: pipe %d -> complete on comp %d", pipeline_id,
Expand Down
3 changes: 1 addition & 2 deletions test/cmocka/src/audio/pipeline/pipeline_new.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ static void test_audio_pipeline_pipeline_new_creation(void **state)
struct pipeline_new_setup_data *test_data = *state;

/*Testing component*/
struct pipeline *result = pipeline_new(test_data->comp_data,
test_data->pipe_id,
struct pipeline *result = pipeline_new(test_data->pipe_id,
test_data->priority,
test_data->comp_id);

Expand Down