All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Laxman Dewangan <ldewangan@nvidia.com>
Cc: alsa-devel@alsa-project.org, swarren@nvidia.com, tiwai@suse.de,
	broonie@opensource.wolfsonmicro.com,
	linux-kernel@vger.kernel.org, lrg@ti.com
Subject: Re: [PATCH] ASoC: snd_dmaengine: add common api for pcm_mmap
Date: Thu, 28 Jun 2012 13:09:36 +0200	[thread overview]
Message-ID: <4FEC3B70.5030902@metafoo.de> (raw)
In-Reply-To: <1340866886-24432-1-git-send-email-ldewangan@nvidia.com>

On 06/28/2012 09:01 AM, Laxman Dewangan wrote:
> The pcm mmap for the substream dma buffer is done using the
> dma_mmap_writecombine().
> Some of the chip sound driver like Spear, Tegra, Davinci,
> ep93xx,snd_imx, snd_mxs, NUC900, OMAP, Samsung are doing this
> mapping locally.
> Add api in the snd dmaengine driver so that different client of
> snd dmaengine can use this rather than implementing locally.
> 

This is not really related to the dmaengine pcm driver. It's more of a
coincidence that all upstream drivers which use the dmaengine pcm driver
also use write-combined memory. In my opinion it would be better to add this
to the ALSA core. Now that there is a generic dma_mmap_writecombine it may
make sense to integrate this with snd_pcm_lib_default_mmap.

- Lars

> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
> ---
>  include/sound/dmaengine_pcm.h |    2 ++
>  sound/soc/soc-dmaengine-pcm.c |   17 +++++++++++++++++
>  2 files changed, 19 insertions(+), 0 deletions(-)
> 
> diff --git a/include/sound/dmaengine_pcm.h b/include/sound/dmaengine_pcm.h
> index b877334..15c0d3c 100644
> --- a/include/sound/dmaengine_pcm.h
> +++ b/include/sound/dmaengine_pcm.h
> @@ -47,4 +47,6 @@ int snd_dmaengine_pcm_close(struct snd_pcm_substream *substream);
>  
>  struct dma_chan *snd_dmaengine_pcm_get_chan(struct snd_pcm_substream *substream);
>  
> +int snd_dmaengine_pcm_mmap_writecombine(struct snd_pcm_substream *substream,
> +		struct vm_area_struct *vma);
>  #endif
> diff --git a/sound/soc/soc-dmaengine-pcm.c b/sound/soc/soc-dmaengine-pcm.c
> index 5df529e..6535eb3 100644
> --- a/sound/soc/soc-dmaengine-pcm.c
> +++ b/sound/soc/soc-dmaengine-pcm.c
> @@ -21,6 +21,7 @@
>  #include <linux/module.h>
>  #include <linux/init.h>
>  #include <linux/dmaengine.h>
> +#include <linux/dma-mapping.h>
>  #include <linux/slab.h>
>  #include <sound/pcm.h>
>  #include <sound/pcm_params.h>
> @@ -313,3 +314,19 @@ int snd_dmaengine_pcm_close(struct snd_pcm_substream *substream)
>  	return 0;
>  }
>  EXPORT_SYMBOL_GPL(snd_dmaengine_pcm_close);
> +
> +/**
> + * snd_dmaengine_pcm_mmap_writecombine - mmap stream dma buffer using
> + * dma_mmap_writecombine().
> + * @substream: PCM substream
> + * @vma: VM area.
> + */
> +int snd_dmaengine_pcm_mmap_writecombine(struct snd_pcm_substream *substream,
> +			struct vm_area_struct *vma)
> +{
> +	struct snd_pcm_runtime *runtime = substream->runtime;
> +
> +	return dma_mmap_writecombine(substream->pcm->card->dev, vma,
> +		runtime->dma_area, runtime->dma_addr, runtime->dma_bytes);
> +}
> +EXPORT_SYMBOL_GPL(snd_dmaengine_pcm_mmap_writecombine);

WARNING: multiple messages have this Message-ID (diff)
From: Lars-Peter Clausen <lars@metafoo.de>
To: Laxman Dewangan <ldewangan@nvidia.com>
Cc: perex@perex.cz, broonie@opensource.wolfsonmicro.com,
	tiwai@suse.de, lrg@ti.com, alsa-devel@alsa-project.org,
	linux-kernel@vger.kernel.org, swarren@nvidia.com
Subject: Re: [PATCH] ASoC: snd_dmaengine: add common api for pcm_mmap
Date: Thu, 28 Jun 2012 13:09:36 +0200	[thread overview]
Message-ID: <4FEC3B70.5030902@metafoo.de> (raw)
In-Reply-To: <1340866886-24432-1-git-send-email-ldewangan@nvidia.com>

On 06/28/2012 09:01 AM, Laxman Dewangan wrote:
> The pcm mmap for the substream dma buffer is done using the
> dma_mmap_writecombine().
> Some of the chip sound driver like Spear, Tegra, Davinci,
> ep93xx,snd_imx, snd_mxs, NUC900, OMAP, Samsung are doing this
> mapping locally.
> Add api in the snd dmaengine driver so that different client of
> snd dmaengine can use this rather than implementing locally.
> 

This is not really related to the dmaengine pcm driver. It's more of a
coincidence that all upstream drivers which use the dmaengine pcm driver
also use write-combined memory. In my opinion it would be better to add this
to the ALSA core. Now that there is a generic dma_mmap_writecombine it may
make sense to integrate this with snd_pcm_lib_default_mmap.

- Lars

> Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
> ---
>  include/sound/dmaengine_pcm.h |    2 ++
>  sound/soc/soc-dmaengine-pcm.c |   17 +++++++++++++++++
>  2 files changed, 19 insertions(+), 0 deletions(-)
> 
> diff --git a/include/sound/dmaengine_pcm.h b/include/sound/dmaengine_pcm.h
> index b877334..15c0d3c 100644
> --- a/include/sound/dmaengine_pcm.h
> +++ b/include/sound/dmaengine_pcm.h
> @@ -47,4 +47,6 @@ int snd_dmaengine_pcm_close(struct snd_pcm_substream *substream);
>  
>  struct dma_chan *snd_dmaengine_pcm_get_chan(struct snd_pcm_substream *substream);
>  
> +int snd_dmaengine_pcm_mmap_writecombine(struct snd_pcm_substream *substream,
> +		struct vm_area_struct *vma);
>  #endif
> diff --git a/sound/soc/soc-dmaengine-pcm.c b/sound/soc/soc-dmaengine-pcm.c
> index 5df529e..6535eb3 100644
> --- a/sound/soc/soc-dmaengine-pcm.c
> +++ b/sound/soc/soc-dmaengine-pcm.c
> @@ -21,6 +21,7 @@
>  #include <linux/module.h>
>  #include <linux/init.h>
>  #include <linux/dmaengine.h>
> +#include <linux/dma-mapping.h>
>  #include <linux/slab.h>
>  #include <sound/pcm.h>
>  #include <sound/pcm_params.h>
> @@ -313,3 +314,19 @@ int snd_dmaengine_pcm_close(struct snd_pcm_substream *substream)
>  	return 0;
>  }
>  EXPORT_SYMBOL_GPL(snd_dmaengine_pcm_close);
> +
> +/**
> + * snd_dmaengine_pcm_mmap_writecombine - mmap stream dma buffer using
> + * dma_mmap_writecombine().
> + * @substream: PCM substream
> + * @vma: VM area.
> + */
> +int snd_dmaengine_pcm_mmap_writecombine(struct snd_pcm_substream *substream,
> +			struct vm_area_struct *vma)
> +{
> +	struct snd_pcm_runtime *runtime = substream->runtime;
> +
> +	return dma_mmap_writecombine(substream->pcm->card->dev, vma,
> +		runtime->dma_area, runtime->dma_addr, runtime->dma_bytes);
> +}
> +EXPORT_SYMBOL_GPL(snd_dmaengine_pcm_mmap_writecombine);


  parent reply	other threads:[~2012-06-28 11:05 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-28  7:01 [PATCH] ASoC: snd_dmaengine: add common api for pcm_mmap Laxman Dewangan
2012-06-28  7:01 ` Laxman Dewangan
2012-06-28 10:51 ` Mark Brown
2012-06-28 10:51   ` Mark Brown
2012-06-28 11:56   ` Laxman Dewangan
2012-06-28 12:02     ` Mark Brown
2012-06-28 12:07       ` Laxman Dewangan
2012-06-28 12:44     ` Lars-Peter Clausen
2012-06-28 14:03       ` Takashi Iwai
2012-06-28 14:03         ` [alsa-devel] " Takashi Iwai
2012-06-28 11:09 ` Lars-Peter Clausen [this message]
2012-06-28 11:09   ` Lars-Peter Clausen
2012-06-28 12:15   ` Takashi Iwai
2012-06-28 12:18     ` Mark Brown
2012-06-28 12:18       ` [alsa-devel] " Mark Brown
2012-06-28 12:30       ` Lars-Peter Clausen
2012-06-28 12:30         ` [alsa-devel] " Lars-Peter Clausen
2012-06-28 12:28         ` Mark Brown
2012-06-28 12:35           ` Laxman Dewangan
2012-06-28 12:57             ` Takashi Iwai
2012-06-28 12:57               ` [alsa-devel] " Takashi Iwai
2012-06-28 13:04               ` Laxman Dewangan
2012-06-28 13:28                 ` Takashi Iwai
2012-06-28 13:28                   ` [alsa-devel] " Takashi Iwai
2012-06-28 13:36                   ` Laxman Dewangan
2012-06-28 13:51                     ` Takashi Iwai
2012-06-28 14:00                       ` Laxman Dewangan
2012-06-28 14:10                         ` Takashi Iwai
2012-06-29 16:42                       ` Lars-Peter Clausen
2012-06-29 16:42                         ` [alsa-devel] " Lars-Peter Clausen
2012-07-02 12:50         ` Marek Szyprowski
2012-06-28 12:32       ` Clemens Ladisch

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=4FEC3B70.5030902@metafoo.de \
    --to=lars@metafoo.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=ldewangan@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lrg@ti.com \
    --cc=swarren@nvidia.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.