Repository navigation
ipc4: multi pipeline set state on different cores #7962
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 |
|---|---|---|
|
|
@@ -215,7 +215,7 @@ static bool is_any_ppl_active(void) | |
| * ERROR Stop EOS |______\ SAVE | ||
| * / | ||
| */ | ||
| static int set_pipeline_state(struct ipc_comp_dev *ppl_icd, uint32_t cmd, | ||
| int set_pipeline_state(struct ipc_comp_dev *ppl_icd, uint32_t cmd, | ||
| bool *delayed) | ||
| { | ||
| struct ipc_comp_dev *host = NULL; | ||
|
|
@@ -404,6 +404,8 @@ static int ipc4_set_pipeline_state(struct ipc4_message_request *ipc4) | |
| struct ipc *ipc = ipc_get(); | ||
| uint32_t cmd, ppl_count, id; | ||
| const uint32_t *ppl_id; | ||
| bool use_idc = false; | ||
|
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. I think it is not about using or not using IDCs, it's about whether all pipelines are on the same core or on different. Maybe call the variable like
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. ... it's also about IDC usage as that's what in the end happens. Cause-versus-effect , I'm happy with both namings.
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. @kv2019i sorry, I meant, that IDCs are used in both cases, just that in one case the use is explicit and in the other case it's hidden under Zephyr API calls. So, using IDCs isn't a differentiating factor between the cases |
||
| uint32_t idx; | ||
| int ret = 0; | ||
| int i; | ||
|
|
||
|
|
@@ -425,6 +427,21 @@ static int ipc4_set_pipeline_state(struct ipc4_message_request *ipc4) | |
| ppl_id = &id; | ||
| } | ||
|
|
||
| for (i = 0; i < ppl_count; i++) { | ||
| ppl_icd = ipc_get_comp_by_ppl_id(ipc, COMP_TYPE_PIPELINE, ppl_id[i]); | ||
| if (!ppl_icd) { | ||
| tr_err(&ipc_tr, "ipc: comp %d not found", ppl_id[i]); | ||
| return IPC4_INVALID_RESOURCE_ID; | ||
| } | ||
|
|
||
| if (i) { | ||
| if (ppl_icd->core != idx) | ||
| use_idc = true; | ||
| } else { | ||
| idx = ppl_icd->core; | ||
| } | ||
|
btian1 marked this conversation as resolved.
|
||
| } | ||
|
|
||
|
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. can we simplify the loop below to do this right after the first one? |
||
| for (i = 0; i < ppl_count; i++) { | ||
| bool delayed = false; | ||
|
|
||
|
|
@@ -435,15 +452,23 @@ static int ipc4_set_pipeline_state(struct ipc4_message_request *ipc4) | |
| } | ||
|
|
||
| /* Pass IPC to target core | ||
| * Note: current implementation supports only a case with | ||
| * all pipelines in cmd allocated on the same core | ||
| * or use idc if more than one core used | ||
| */ | ||
| if (!cpu_is_me(ppl_icd->core)) | ||
| return ipc4_process_on_core(ppl_icd->core, false); | ||
|
|
||
| ipc_compound_pre_start(state.primary.r.type); | ||
| ret = set_pipeline_state(ppl_icd, cmd, &delayed); | ||
| ipc_compound_post_start(state.primary.r.type, ret, delayed); | ||
| if (!cpu_is_me(ppl_icd->core)) { | ||
| if (use_idc) { | ||
| struct idc_msg msg = { IDC_MSG_PPL_STATE, | ||
| IDC_MSG_PPL_STATE_EXT(ppl_id[i]), ppl_icd->core, sizeof(cmd), | ||
| &cmd, }; | ||
|
|
||
| ret = idc_send_msg(&msg, IDC_BLOCKING); | ||
|
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. ignoring error? And this is not an IPC4 error code
Contributor
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. line 473-474, althrough have a long distance to reach.
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. still |
||
| } else { | ||
| return ipc4_process_on_core(ppl_icd->core, false); | ||
| } | ||
| } else { | ||
| ipc_compound_pre_start(state.primary.r.type); | ||
| ret = set_pipeline_state(ppl_icd, cmd, &delayed); | ||
| ipc_compound_post_start(state.primary.r.type, ret, delayed); | ||
| } | ||
|
|
||
| if (ret != 0) | ||
| return ret; | ||
|
|
||
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.
zephyr + tgl IPC3 failed so I added this check