aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2008-07-30 09:13:34 -0400
committerJaroslav Kysela <perex@perex.cz>2008-08-25 03:57:40 -0400
commitfc4abee8112ada7b1b66017f620d3de3954759f3 (patch)
treec75b9e248960dc64502cd659f7206bf8b0510aa8 /sound
parent51e9f2e665bf2b6a01be275d64c336d942c59a66 (diff)
ALSA: hda - check page continuity
Check the continuity of allocated pages to reduce the BDL size as much as possible so that it can use more than 1MB buffers. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'sound')
-rw-r--r--sound/pci/hda/hda_intel.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
index e4d038f423fc..4f80248837e5 100644
--- a/sound/pci/hda/hda_intel.c
+++ b/sound/pci/hda/hda_intel.c
@@ -1012,9 +1012,7 @@ static int setup_bdle(struct snd_pcm_substream *substream,
1012 bdl[0] = cpu_to_le32((u32)addr); 1012 bdl[0] = cpu_to_le32((u32)addr);
1013 bdl[1] = cpu_to_le32(upper_32_bits(addr)); 1013 bdl[1] = cpu_to_le32(upper_32_bits(addr));
1014 /* program the size field of the BDL entry */ 1014 /* program the size field of the BDL entry */
1015 chunk = PAGE_SIZE - (ofs % PAGE_SIZE); 1015 chunk = snd_pcm_sgbuf_get_chunk_size(substream, ofs, size);
1016 if (size < chunk)
1017 chunk = size;
1018 bdl[2] = cpu_to_le32(chunk); 1016 bdl[2] = cpu_to_le32(chunk);
1019 /* program the IOC to enable interrupt 1017 /* program the IOC to enable interrupt
1020 * only when the whole fragment is processed 1018 * only when the whole fragment is processed
@@ -1672,7 +1670,7 @@ static int __devinit create_codec_pcm(struct azx *chip, struct hda_codec *codec,
1672 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &azx_pcm_ops); 1670 snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, &azx_pcm_ops);
1673 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG, 1671 snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG,
1674 snd_dma_pci_data(chip->pci), 1672 snd_dma_pci_data(chip->pci),
1675 1024 * 64, 1024 * 1024); 1673 1024 * 64, 32 * 1024 * 1024);
1676 chip->pcm[cpcm->device] = pcm; 1674 chip->pcm[cpcm->device] = pcm;
1677 return 0; 1675 return 0;
1678} 1676}