Alsa-Devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Nicolin Chen <b42378@freescale.com>
Cc: tiwai@suse.de, alsa-devel@alsa-project.org, broonie@kernel.org,
	lgirdwood@gmail.com
Subject: Re: [PATCH 2/2] ASoC: generic-dmaengine-pcm: Support on-chip internal memory for DMA buffer
Date: Wed, 16 Oct 2013 10:56:06 +0200	[thread overview]
Message-ID: <525E54A6.80303@metafoo.de> (raw)
In-Reply-To: <764ec7a383968296dbd3988aee2f3e30b951c7d1.1381911378.git.b42378@freescale.com>

On 10/16/2013 10:18 AM, Nicolin Chen wrote:
[...]
>   * struct snd_dmaengine_pcm_config - Configuration data for dmaengine based PCM
> diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c
> index e29ec3c..dd72964 100644
> --- a/sound/soc/soc-generic-dmaengine-pcm.c
> +++ b/sound/soc/soc-generic-dmaengine-pcm.c
> @@ -142,7 +142,7 @@ static int dmaengine_pcm_new(struct snd_soc_pcm_runtime *rtd)
>  	struct dmaengine_pcm *pcm = soc_platform_to_pcm(rtd->platform);
>  	const struct snd_dmaengine_pcm_config *config = pcm->config;
>  	struct snd_pcm_substream *substream;
> -	unsigned int i;
> +	unsigned int i, type = SNDRV_DMA_TYPE_DEV;
>  	int ret;
>  
>  	for (i = SNDRV_PCM_STREAM_PLAYBACK; i <= SNDRV_PCM_STREAM_CAPTURE; i++) {
> @@ -162,8 +162,10 @@ static int dmaengine_pcm_new(struct snd_soc_pcm_runtime *rtd)
>  			goto err_free;
>  		}
>  
> -		ret = snd_pcm_lib_preallocate_pages(substream,
> -				SNDRV_DMA_TYPE_DEV,
> +		if (pcm->flags & SND_DMAENGINE_PCM_FLAG_DMA_IRAM)
> +			type = SNDRV_DMA_TYPE_DEV_IRAM;

Should we just make this the default, after all it will fallback to normal
memory if no iram region has been specified.

> +
> +		ret = snd_pcm_lib_preallocate_pages(substream, type,
>  				dmaengine_dma_dev(pcm, substream),
>  				config->prealloc_buffer_size,
>  				config->pcm_hardware->buffer_bytes_max);
> 

  reply	other threads:[~2013-10-16  8:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-16  8:18 [PATCH 1/2] ALSA: Add SoC on-chip internal memory support for DMA buffer allocation Nicolin Chen
2013-10-16  8:18 ` [PATCH 2/2] ASoC: generic-dmaengine-pcm: Support on-chip internal memory for DMA buffer Nicolin Chen
2013-10-16  8:56   ` Lars-Peter Clausen [this message]
2013-10-16  8:51     ` Nicolin Chen
2013-10-16  8:55 ` [PATCH 1/2] ALSA: Add SoC on-chip internal memory support for DMA buffer allocation Lars-Peter Clausen
2013-10-16  8:48   ` Nicolin Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=525E54A6.80303@metafoo.de \
    --to=lars@metafoo.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=b42378@freescale.com \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox