-
Notifications
You must be signed in to change notification settings - Fork 349
ipc4: Ensure pipeline component directions are synchronized #8969
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -251,6 +251,28 @@ static struct ipc_comp_dev *pipeline_get_host_dev(struct ipc_comp_dev *ppl_icd) | |
| struct ipc *ipc = ipc_get(); | ||
| int host_id; | ||
|
|
||
| /* If the source component's direction is not set but the sink's direction is, | ||
| * this block will copy the direction from the sink to the source component and | ||
| * mark the source's direction as set. | ||
| */ | ||
| if (!ppl_icd->pipeline->source_comp->direction_set && | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Identical code and logic is already done in ipc_comp_connect(). It would be interesting to understand better why this can happen in some case. If this cannot be avoided, can we have a shared helped used by both this function and ipc_comp_connect() ?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the choice of a function to place this code into isn't very obvious. Is this function called for each new pipeline before it's activated? Maybe some more obvious place like when a streaming attempt is made would be clearer?
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @lyakh I had the same concern, but looks like it's not so easy to pick another spot. This is called from multiple places, from the state machine implementing pipeline state changes. I'm happy with the extended git commit message to explain the change. |
||
| ppl_icd->pipeline->sink_comp->direction_set) { | ||
| ppl_icd->pipeline->source_comp->direction = | ||
| ppl_icd->pipeline->sink_comp->direction; | ||
| ppl_icd->pipeline->source_comp->direction_set = true; | ||
| } | ||
|
|
||
| /* If the sink component's direction is not set but the source's direction is, | ||
| * this block will copy the direction from the source to the sink component and | ||
| * mark the sink's direction as set. | ||
| */ | ||
| if (!ppl_icd->pipeline->sink_comp->direction_set && | ||
| ppl_icd->pipeline->source_comp->direction_set) { | ||
| ppl_icd->pipeline->sink_comp->direction = | ||
| ppl_icd->pipeline->source_comp->direction; | ||
| ppl_icd->pipeline->sink_comp->direction_set = true; | ||
| } | ||
|
|
||
| if (ppl_icd->pipeline->source_comp->direction == SOF_IPC_STREAM_PLAYBACK) | ||
| host_id = ppl_icd->pipeline->source_comp->ipc_config.id; | ||
| else | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: in commit message
looks like a duplication