aboutsummaryrefslogtreecommitdiffstats
path: root/include/sound/pcm.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/sound/pcm.h')
-rw-r--r--include/sound/pcm.h48
1 files changed, 46 insertions, 2 deletions
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index e26fb3c58037..8b611a561985 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -271,6 +271,7 @@ struct snd_pcm_runtime {
271 int overrange; 271 int overrange;
272 snd_pcm_uframes_t avail_max; 272 snd_pcm_uframes_t avail_max;
273 snd_pcm_uframes_t hw_ptr_base; /* Position at buffer restart */ 273 snd_pcm_uframes_t hw_ptr_base; /* Position at buffer restart */
274 snd_pcm_uframes_t hw_ptr_interrupt; /* Position at interrupt time */
274 unsigned long hw_ptr_jiffies; /* Time when hw_ptr is updated */ 275 unsigned long hw_ptr_jiffies; /* Time when hw_ptr is updated */
275 snd_pcm_sframes_t delay; /* extra delay; typically FIFO size */ 276 snd_pcm_sframes_t delay; /* extra delay; typically FIFO size */
276 277
@@ -311,8 +312,9 @@ struct snd_pcm_runtime {
311 struct snd_pcm_mmap_control *control; 312 struct snd_pcm_mmap_control *control;
312 313
313 /* -- locking / scheduling -- */ 314 /* -- locking / scheduling -- */
314 unsigned int nowake: 1; /* no wakeup (data-copy in progress) */ 315 unsigned int twake: 1; /* do transfer (!poll) wakeup */
315 wait_queue_head_t sleep; 316 wait_queue_head_t sleep; /* poll sleep */
317 wait_queue_head_t tsleep; /* transfer sleep */
316 struct fasync_struct *fasync; 318 struct fasync_struct *fasync;
317 319
318 /* -- private section -- */ 320 /* -- private section -- */
@@ -913,6 +915,44 @@ int snd_pcm_lib_preallocate_pages_for_all(struct snd_pcm *pcm,
913int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size); 915int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size);
914int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream); 916int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream);
915 917
918int _snd_pcm_lib_alloc_vmalloc_buffer(struct snd_pcm_substream *substream,
919 size_t size, gfp_t gfp_flags);
920int snd_pcm_lib_free_vmalloc_buffer(struct snd_pcm_substream *substream);
921struct page *snd_pcm_lib_get_vmalloc_page(struct snd_pcm_substream *substream,
922 unsigned long offset);
923#if 0 /* for kernel-doc */
924/**
925 * snd_pcm_lib_alloc_vmalloc_buffer - allocate virtual DMA buffer
926 * @substream: the substream to allocate the buffer to
927 * @size: the requested buffer size, in bytes
928 *
929 * Allocates the PCM substream buffer using vmalloc(), i.e., the memory is
930 * contiguous in kernel virtual space, but not in physical memory. Use this
931 * if the buffer is accessed by kernel code but not by device DMA.
932 *
933 * Returns 1 if the buffer was changed, 0 if not changed, or a negative error
934 * code.
935 */
936static int snd_pcm_lib_alloc_vmalloc_buffer
937 (struct snd_pcm_substream *substream, size_t size);
938/**
939 * snd_pcm_lib_alloc_vmalloc_32_buffer - allocate 32-bit-addressable buffer
940 * @substream: the substream to allocate the buffer to
941 * @size: the requested buffer size, in bytes
942 *
943 * This function works like snd_pcm_lib_alloc_vmalloc_buffer(), but uses
944 * vmalloc_32(), i.e., the pages are allocated from 32-bit-addressable memory.
945 */
946static int snd_pcm_lib_alloc_vmalloc_32_buffer
947 (struct snd_pcm_substream *substream, size_t size);
948#endif
949#define snd_pcm_lib_alloc_vmalloc_buffer(subs, size) \
950 _snd_pcm_lib_alloc_vmalloc_buffer \
951 (subs, size, GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO)
952#define snd_pcm_lib_alloc_vmalloc_32_buffer(subs, size) \
953 _snd_pcm_lib_alloc_vmalloc_buffer \
954 (subs, size, GFP_KERNEL | GFP_DMA32 | __GFP_ZERO)
955
916#ifdef CONFIG_SND_DMA_SGBUF 956#ifdef CONFIG_SND_DMA_SGBUF
917/* 957/*
918 * SG-buffer handling 958 * SG-buffer handling
@@ -983,6 +1023,10 @@ int snd_pcm_lib_mmap_iomem(struct snd_pcm_substream *substream, struct vm_area_s
983#define snd_pcm_lib_mmap_iomem NULL 1023#define snd_pcm_lib_mmap_iomem NULL
984#endif 1024#endif
985 1025
1026int snd_pcm_lib_mmap_noncached(struct snd_pcm_substream *substream,
1027 struct vm_area_struct *area);
1028#define snd_pcm_lib_mmap_vmalloc snd_pcm_lib_mmap_noncached
1029
986static inline void snd_pcm_limit_isa_dma_size(int dma, size_t *max) 1030static inline void snd_pcm_limit_isa_dma_size(int dma, size_t *max)
987{ 1031{
988 *max = dma < 4 ? 64 * 1024 : 128 * 1024; 1032 *max = dma < 4 ? 64 * 1024 : 128 * 1024;