diff options
author | Takashi Iwai <tiwai@suse.de> | 2011-05-03 10:50:51 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2011-05-03 10:50:51 -0400 |
commit | 972505ccde9a3bdc8455f4cf3d3f37d17f8f10a3 (patch) | |
tree | 1de7203fad25ae6bd672993f8e0bac03c2473544 /sound | |
parent | fe3d393eda2a716c2ea7fcd63e105657911ed245 (diff) |
ALSA: lola - Use SG-buffer
Completely switch to SG-buffer now, as it's working stably.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/pci/lola/lola.c | 1 | ||||
-rw-r--r-- | sound/pci/lola/lola_pcm.c | 26 |
2 files changed, 4 insertions, 23 deletions
diff --git a/sound/pci/lola/lola.c b/sound/pci/lola/lola.c index 7c13ace3c33b..3d2516b11f22 100644 --- a/sound/pci/lola/lola.c +++ b/sound/pci/lola/lola.c | |||
@@ -588,7 +588,6 @@ static int __devinit lola_create(struct snd_card *card, struct pci_dev *pci, | |||
588 | chip->irq = -1; | 588 | chip->irq = -1; |
589 | 589 | ||
590 | chip->sample_rate_min = sample_rate_min[dev]; | 590 | chip->sample_rate_min = sample_rate_min[dev]; |
591 | |||
592 | chip->granularity = granularity[dev]; | 591 | chip->granularity = granularity[dev]; |
593 | /* FIXME */ | 592 | /* FIXME */ |
594 | if (chip->granularity != LOLA_GRANULARITY_MAX) { | 593 | if (chip->granularity != LOLA_GRANULARITY_MAX) { |
diff --git a/sound/pci/lola/lola_pcm.c b/sound/pci/lola/lola_pcm.c index ef738e6c9919..dc2e811dcb3c 100644 --- a/sound/pci/lola/lola_pcm.c +++ b/sound/pci/lola/lola_pcm.c | |||
@@ -26,28 +26,10 @@ | |||
26 | #include <sound/pcm.h> | 26 | #include <sound/pcm.h> |
27 | #include "lola.h" | 27 | #include "lola.h" |
28 | 28 | ||
29 | /* #define USE_SG_BUFFER */ | ||
30 | |||
31 | #define LOLA_MAX_BDL_ENTRIES 8 | 29 | #define LOLA_MAX_BDL_ENTRIES 8 |
32 | #define LOLA_MAX_BUF_SIZE (1024*1024*1024) | 30 | #define LOLA_MAX_BUF_SIZE (1024*1024*1024) |
33 | #define LOLA_BDL_ENTRY_SIZE (16 * 16) | 31 | #define LOLA_BDL_ENTRY_SIZE (16 * 16) |
34 | 32 | ||
35 | #ifdef USE_SG_BUFFER | ||
36 | #define get_addr(substream, ofs) \ | ||
37 | snd_pcm_sgbuf_get_addr(substream, ofs) | ||
38 | #define get_size(substream, ofs, size) \ | ||
39 | snd_pcm_sgbuf_get_chunk_size(substream, ofs, size) | ||
40 | #define ops_page snd_pcm_sgbuf_ops_page | ||
41 | #define PREALLOC_TYPE SNDRV_DMA_TYPE_DEV_SG | ||
42 | #else | ||
43 | #define get_addr(substream, ofs) \ | ||
44 | ((substream)->runtime->dma_addr + ofs) | ||
45 | #define get_size(substream, ofs, size) \ | ||
46 | (size) | ||
47 | #define ops_page NULL | ||
48 | #define PREALLOC_TYPE SNDRV_DMA_TYPE_DEV | ||
49 | #endif | ||
50 | |||
51 | static struct lola_pcm *lola_get_pcm(struct snd_pcm_substream *substream) | 33 | static struct lola_pcm *lola_get_pcm(struct snd_pcm_substream *substream) |
52 | { | 34 | { |
53 | struct lola *chip = snd_pcm_substream_chip(substream); | 35 | struct lola *chip = snd_pcm_substream_chip(substream); |
@@ -276,12 +258,12 @@ static int setup_bdle(struct snd_pcm_substream *substream, | |||
276 | if (str->frags >= LOLA_MAX_BDL_ENTRIES) | 258 | if (str->frags >= LOLA_MAX_BDL_ENTRIES) |
277 | return -EINVAL; | 259 | return -EINVAL; |
278 | 260 | ||
279 | addr = get_addr(substream, ofs); | 261 | addr = snd_pcm_sgbuf_get_addr(substream, ofs); |
280 | /* program the address field of the BDL entry */ | 262 | /* program the address field of the BDL entry */ |
281 | bdl[0] = cpu_to_le32((u32)addr); | 263 | bdl[0] = cpu_to_le32((u32)addr); |
282 | bdl[1] = cpu_to_le32(upper_32_bits(addr)); | 264 | bdl[1] = cpu_to_le32(upper_32_bits(addr)); |
283 | /* program the size field of the BDL entry */ | 265 | /* program the size field of the BDL entry */ |
284 | chunk = get_size(substream, ofs, size); | 266 | chunk = snd_pcm_sgbuf_get_chunk_size(substream, ofs, size); |
285 | bdl[2] = cpu_to_le32(chunk); | 267 | bdl[2] = cpu_to_le32(chunk); |
286 | /* program the IOC to enable interrupt | 268 | /* program the IOC to enable interrupt |
287 | * only when the whole fragment is processed | 269 | * only when the whole fragment is processed |
@@ -530,7 +512,7 @@ static struct snd_pcm_ops lola_pcm_ops = { | |||
530 | .prepare = lola_pcm_prepare, | 512 | .prepare = lola_pcm_prepare, |
531 | .trigger = lola_pcm_trigger, | 513 | .trigger = lola_pcm_trigger, |
532 | .pointer = lola_pcm_pointer, | 514 | .pointer = lola_pcm_pointer, |
533 | .page = ops_page, | 515 | .page = snd_pcm_sgbuf_ops_page, |
534 | }; | 516 | }; |
535 | 517 | ||
536 | int __devinit lola_create_pcm(struct lola *chip) | 518 | int __devinit lola_create_pcm(struct lola *chip) |
@@ -559,7 +541,7 @@ int __devinit lola_create_pcm(struct lola *chip) | |||
559 | snd_pcm_set_ops(pcm, i, &lola_pcm_ops); | 541 | snd_pcm_set_ops(pcm, i, &lola_pcm_ops); |
560 | } | 542 | } |
561 | /* buffer pre-allocation */ | 543 | /* buffer pre-allocation */ |
562 | snd_pcm_lib_preallocate_pages_for_all(pcm, PREALLOC_TYPE, | 544 | snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV_SG, |
563 | snd_dma_pci_data(chip->pci), | 545 | snd_dma_pci_data(chip->pci), |
564 | 1024 * 64, 32 * 1024 * 1024); | 546 | 1024 * 64, 32 * 1024 * 1024); |
565 | return 0; | 547 | return 0; |