summaryrefslogtreecommitdiff
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-09-24 12:16:29 +0200
committerbuildbot <buildbot@intel.com>2012-04-10 20:50:50 -0700
commit780b8e0ca68a7a05aa78aabff2fecc0aa5f44954 (patch)
treec582085cde679953a11818889ffe38a76a8098b4 /sound
parent3ceae79e0ffb9df230b4f66251bdfcd498f39286 (diff)
downloadkernel-mfld-blackbay-780b8e0ca68a7a05aa78aabff2fecc0aa5f44954.tar.gz
kernel-mfld-blackbay-780b8e0ca68a7a05aa78aabff2fecc0aa5f44954.tar.bz2
kernel-mfld-blackbay-780b8e0ca68a7a05aa78aabff2fecc0aa5f44954.zip
ALSA: aloop - Use vmalloc buffer
BZ: 30009 This patch is back ported ICS kernel from k3.2 rc1 snd-aloop driver is virtual and has no need for allocating contiguous pages. It'll be more system-friendly to use vmalloc buffers. Change-Id: I8cc6901f38706daa5cb1dfbddb34cc6b648236da Tested-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Ramesh Babu K V <ramesh.babu@linux.intel.com> Reviewed-on: http://android.intel.com:8080/42441 Reviewed-by: Babu, Ramesh <ramesh.babu@intel.com> Reviewed-by: Koul, Vinod <vinod.koul@intel.com> Reviewed-by: Abdullah, Omair M <omair.m.abdullah@intel.com> Reviewed-by: Agarwal, Vaibhav <vaibhav.agarwal@intel.com> Reviewed-by: Balguri, Mamatha <mamatha.balguri@intel.com> Reviewed-by: Gupta, ArvindX K <arvindx.k.gupta@intel.com> Reviewed-by: Hibare, PramodX <pramodx.hibare@intel.com> Tested-by: Hibare, PramodX <pramodx.hibare@intel.com> Reviewed-by: buildbot <buildbot@intel.com> Tested-by: buildbot <buildbot@intel.com>
Diffstat (limited to 'sound')
-rw-r--r--sound/drivers/aloop.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c
index a0da7755fce..4067f154894 100644
--- a/sound/drivers/aloop.c
+++ b/sound/drivers/aloop.c
@@ -575,7 +575,8 @@ static void loopback_runtime_free(struct snd_pcm_runtime *runtime)
static int loopback_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
- return snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(params));
+ return snd_pcm_lib_alloc_vmalloc_buffer(substream,
+ params_buffer_bytes(params));
}
static int loopback_hw_free(struct snd_pcm_substream *substream)
@@ -587,7 +588,7 @@ static int loopback_hw_free(struct snd_pcm_substream *substream)
mutex_lock(&dpcm->loopback->cable_lock);
cable->valid &= ~(1 << substream->stream);
mutex_unlock(&dpcm->loopback->cable_lock);
- return snd_pcm_lib_free_pages(substream);
+ return snd_pcm_lib_free_vmalloc_buffer(substream);
}
static unsigned int get_cable_index(struct snd_pcm_substream *substream)
@@ -740,6 +741,8 @@ static struct snd_pcm_ops loopback_playback_ops = {
.prepare = loopback_prepare,
.trigger = loopback_trigger,
.pointer = loopback_pointer,
+ .page = snd_pcm_lib_get_vmalloc_page,
+ .mmap = snd_pcm_lib_mmap_vmalloc,
};
static struct snd_pcm_ops loopback_capture_ops = {
@@ -751,6 +754,8 @@ static struct snd_pcm_ops loopback_capture_ops = {
.prepare = loopback_prepare,
.trigger = loopback_trigger,
.pointer = loopback_pointer,
+ .page = snd_pcm_lib_get_vmalloc_page,
+ .mmap = snd_pcm_lib_mmap_vmalloc,
};
static int __devinit loopback_pcm_new(struct loopback *loopback,
@@ -771,10 +776,6 @@ static int __devinit loopback_pcm_new(struct loopback *loopback,
strcpy(pcm->name, "Loopback PCM");
loopback->pcm[device] = pcm;
-
- snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_CONTINUOUS,
- snd_dma_continuous_data(GFP_KERNEL),
- 0, 2 * 1024 * 1024);
return 0;
}