mbox series

[v2,0/5] ASoC: qdsp6: add compress offload support

Message ID 20180926102349.23481-1-srinivas.kandagatla@linaro.org
Headers show
Series ASoC: qdsp6: add compress offload support | expand

Message

Srinivas Kandagatla Sept. 26, 2018, 10:23 a.m. UTC
This patchset adds support to very basic MP3 playback compress offload
support via QDSP ASM module.

Tested this patchset on DB410c with APQ8016 and DB820c with APQ8096 using
tinycompress library.

Adding other codec support should be trivial w.r.t qdsp6 side, however
there are other dependencies like compress UAPI header changes and
FastRPC which are being worked in parallel. Once ready will post them!

thanks,
srini

Changes since v1 (https://patchwork.kernel.org/cover/10585805/)
- added support to snd_compr_set_runtime_buffer()
- make use of generic copy function
- few trivial cleanups suggested by Vinod Koul

Srinivas Kandagatla (5):
  ALSA: soc-compress: add support to snd_compr_set_runtime_buffer()
  ALSA: compress: make use of runtime buffer for copy
  ASoC: q6asm-dai: dt-bindings: Add support to compress dais
  ASoC: qdsp6: q6asm: add support to MP3 format
  ASoC: qdsp6: q6asm-dai: Add support to compress offload

 .../devicetree/bindings/sound/qcom,q6asm.txt  |  27 ++
 include/sound/compress_driver.h               |  19 +
 sound/core/compress_offload.c                 |  18 +-
 sound/soc/qcom/Kconfig                        |   1 +
 sound/soc/qcom/qdsp6/q6asm-dai.c              | 377 +++++++++++++++++-
 sound/soc/qcom/qdsp6/q6asm.c                  |   5 +
 6 files changed, 443 insertions(+), 4 deletions(-)

-- 
2.19.0

Comments

Vinod Koul Oct. 5, 2018, 12:31 a.m. UTC | #1
On 26-09-18, 11:23, Srinivas Kandagatla wrote:
> This patch adds support to set runtime dma buffer on compressed stream.


The change is fine as is, but I feel we need to document the motivation
in the changelog. The core changes need a bit more explanation on why we
should add this..

> 

> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>

> ---

>  include/sound/compress_driver.h | 19 +++++++++++++++++++

>  1 file changed, 19 insertions(+)

> 

> diff --git a/include/sound/compress_driver.h b/include/sound/compress_driver.h

> index ea8c93bbb0e0..0cdc3999ecfa 100644

> --- a/include/sound/compress_driver.h

> +++ b/include/sound/compress_driver.h

> @@ -23,6 +23,7 @@ struct snd_compr_ops;

>   * struct snd_compr_runtime: runtime stream description

>   * @state: stream state

>   * @ops: pointer to DSP callbacks

> + * @dma_buffer_p: runtime dma buffer pointer

>   * @buffer: pointer to kernel buffer, valid only when not in mmap mode or

>   *	DSP doesn't implement copy

>   * @buffer_size: size of the above buffer

> @@ -37,6 +38,7 @@ struct snd_compr_ops;

>  struct snd_compr_runtime {

>  	snd_pcm_state_t state;

>  	struct snd_compr_ops *ops;

> +	struct snd_dma_buffer *dma_buffer_p;

>  	void *buffer;

>  	u64 buffer_size;

>  	u32 fragment_size;

> @@ -175,6 +177,23 @@ static inline void snd_compr_drain_notify(struct snd_compr_stream *stream)

>  	wake_up(&stream->runtime->sleep);

>  }

>  

> +/**

> + * snd_compr_set_runtime_buffer - Set the Compress runtime buffer

> + * @substream: compress substream to set

> + * @bufp: the buffer information, NULL to clear

> + *

> + * Copy the buffer information to runtime buffer when @bufp is non-NULL.

> + * Otherwise it clears the current buffer information.

> + */

> +static inline void snd_compr_set_runtime_buffer(

> +					struct snd_compr_stream *substream,

> +					struct snd_dma_buffer *bufp)

> +{

> +	struct snd_compr_runtime *runtime = substream->runtime;

> +

> +	runtime->dma_buffer_p = bufp;

> +}

> +

>  int snd_compr_stop_error(struct snd_compr_stream *stream,

>  			 snd_pcm_state_t state);

>  

> -- 

> 2.19.0


-- 
~Vinod