Hostless pipelines such as the tone pipeline do not need host page table set up.
Signed-off-by: Ranjani Sridharan ranjani.sridharan@linux.intel.com --- src/ipc/handler.c | 61 +++++++++++++++++++++++++---------------------- 1 file changed, 33 insertions(+), 28 deletions(-)
diff --git a/src/ipc/handler.c b/src/ipc/handler.c index 581ce9e..0584feb 100644 --- a/src/ipc/handler.c +++ b/src/ipc/handler.c @@ -126,40 +126,45 @@ static int ipc_stream_pcm_params(uint32_t stream) cd->params = pcm_params->params;
#ifdef CONFIG_HOST_PTABLE + /* no need to set up host page table for hostless pipelines */ + if (cd->comp.type == SOF_COMP_HOST) { + list_init(&elem_list); + + /* + * use DMA to read in compressed page table ringbuffer + * from host + */ + err = ipc_get_page_descriptors(iipc->dmac, iipc->page_table, + &pcm_params->params.buffer); + if (err < 0) { + trace_ipc_error("eAp"); + goto error; + }
- list_init(&elem_list); - - /* use DMA to read in compressed page table ringbuffer from host */ - err = ipc_get_page_descriptors(iipc->dmac, iipc->page_table, - &pcm_params->params.buffer); - if (err < 0) { - trace_ipc_error("eAp"); - goto error; - } - - /* Parse host tables */ - host = (struct sof_ipc_comp_host *)&cd->comp; - ring_size = pcm_params->params.buffer.size; - - err = ipc_parse_page_descriptors(iipc->page_table, - &pcm_params->params.buffer, - &elem_list, host->direction); - if (err < 0) { - trace_ipc_error("eAP"); - goto error; - } - - list_for_item(plist, &elem_list) { - elem = container_of(plist, struct dma_sg_elem, list); + /* Parse host tables */ + host = (struct sof_ipc_comp_host *)&cd->comp; + ring_size = pcm_params->params.buffer.size;
- err = comp_host_buffer(cd, elem, ring_size); + err = ipc_parse_page_descriptors(iipc->page_table, + &pcm_params->params.buffer, + &elem_list, host->direction); if (err < 0) { - trace_ipc_error("ePb"); + trace_ipc_error("eAP"); goto error; }
- list_item_del(&elem->list); - rfree(elem); + list_for_item(plist, &elem_list) { + elem = container_of(plist, struct dma_sg_elem, list); + + err = comp_host_buffer(cd, elem, ring_size); + if (err < 0) { + trace_ipc_error("ePb"); + goto error; + } + + list_item_del(&elem->list); + rfree(elem); + } } #endif