mirror of https://github.com/thesofproject/sof.git
ipc4: setdx: prevent d0 when ppl are active
This patch prevent driver from requesting FW to enter D0 state when there are still active pipelines. Signed-off-by: Tomasz Leman <tomasz.m.leman@intel.com>
This commit is contained in:
parent
00fce8bd20
commit
edf5866da7
|
@ -177,6 +177,23 @@ static int propagate_state_to_ppl_comp(struct ipc *ipc, uint32_t ppl_id, int cmd
|
|||
return ret;
|
||||
}
|
||||
|
||||
static bool is_any_ppl_active(void)
|
||||
{
|
||||
struct ipc_comp_dev *icd;
|
||||
struct list_item *clist;
|
||||
|
||||
list_for_item(clist, &ipc_get()->comp_list) {
|
||||
icd = container_of(clist, struct ipc_comp_dev, list);
|
||||
if (icd->type != COMP_TYPE_PIPELINE)
|
||||
continue;
|
||||
|
||||
if (icd->pipeline->status == COMP_STATE_ACTIVE)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/* Ipc4 pipeline message <------> ipc3 pipeline message
|
||||
* RUNNING <-------> TRIGGER START
|
||||
* INIT + PAUSED <-------> PIPELINE COMPLETE
|
||||
|
@ -798,6 +815,11 @@ static int ipc4_module_process_dx(union ipc4_message_header *ipc4)
|
|||
return IPC4_BUSY;
|
||||
}
|
||||
|
||||
if (is_any_ppl_active()) {
|
||||
tr_err(&ipc_tr, "some pipelines are still active");
|
||||
return IPC4_BUSY;
|
||||
}
|
||||
|
||||
ipc_get()->pm_prepare_D3 = 1;
|
||||
/* TODO: prepare for D3 */
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue