[Sound-open-firmware] [PATCH] ipc: no need to set up host page table for hostless pipelines

Liam Girdwood liam.r.girdwood at intel.com
Thu May 31 09:43:01 CEST 2018


On Tue, 2018-05-29 at 12:11 -0700, Ranjani Sridharan wrote:
> Hostless pipelines such as the tone pipeline do not need
> host page table set up.
> 
> Signed-off-by: Ranjani Sridharan <ranjani.sridharan at 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) {

Better to make it 

if (type != COMP_X)
	goto some_code;

This way it reduces the patch size and makes logic easier to follow.

Btw, we have 2 host comp types in the enum.

Liam


> +		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
>  
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47

This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.


More information about the Sound-open-firmware mailing list