summaryrefslogtreecommitdiff
path: root/sound/pci/hda/hda_intel.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2011-07-12 17:27:46 +0200
committerTakashi Iwai <tiwai@suse.de>2011-07-12 17:31:46 +0200
commitacfa634f7e199193ec28282e82a5a6dd8edebcb7 (patch)
tree49193fcf5bb5c21f61d1ff7d8a7e404ce4e774ad /sound/pci/hda/hda_intel.c
parent30b4503378c976cf66201a1e81820519f6bd79ac (diff)
ALSA: hda - Add Kconfig for the default buffer size
Add a Kconfig entry to specify the default buffer size. Distros using PulseAudio can choose a larger value here. Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound/pci/hda/hda_intel.c')
-rw-r--r--sound/pci/hda/hda_intel.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index 25619cd18831..5ce9531cba67 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -2075,6 +2075,8 @@ static void azx_pcm_free(struct snd_pcm *pcm)
}
}
+#define MAX_PREALLOC_SIZE (32 * 1024 * 1024)
+
static int
azx_attach_pcm_stream(struct hda_bus *bus, struct hda_codec *codec,
struct hda_pcm *cpcm)
@@ -2083,6 +2085,7 @@ azx_attach_pcm_stream(struct hda_bus *bus, struct hda_codec *codec,
struct snd_pcm *pcm;
struct azx_pcm *apcm;
int pcm_dev = cpcm->device;
+ unsigned int size;
int s, err;
if (pcm_dev >= HDA_MAX_PCMS) {
@@ -2118,9 +2121,12 @@ azx_attach_pcm_stream(struct hda_bus *bus, struct hda_codec *codec,
snd_pcm_set_ops(pcm, s, &azx_pcm_ops);
}
/* buffer pre-allocation */
+ size = CONFIG_SND_HDA_PREALLOC_SIZE * 1024;
+ if (size > MAX_PREALLOC_SIZE)
+ size = MAX_PREALLOC_SIZE;
snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
snd_dma_pci_data(chip->pci),
- 1024 * 64, 32 * 1024 * 1024);
+ size, MAX_PREALLOC_SIZE);
return 0;
}