• Home
  • Raw
  • Download

Lines Matching refs:substream

51 static int preallocate_pcm_pages(struct snd_pcm_substream *substream, size_t size)  in preallocate_pcm_pages()  argument
53 struct snd_dma_buffer *dmab = &substream->dma_buffer; in preallocate_pcm_pages()
68 substream->pcm->card->number, substream->pcm->device, in preallocate_pcm_pages()
69 substream->stream ? 'c' : 'p', substream->number, in preallocate_pcm_pages()
70 substream->pcm->name, orig_size); in preallocate_pcm_pages()
77 static void snd_pcm_lib_preallocate_dma_free(struct snd_pcm_substream *substream) in snd_pcm_lib_preallocate_dma_free() argument
79 if (substream->dma_buffer.area == NULL) in snd_pcm_lib_preallocate_dma_free()
81 snd_dma_free_pages(&substream->dma_buffer); in snd_pcm_lib_preallocate_dma_free()
82 substream->dma_buffer.area = NULL; in snd_pcm_lib_preallocate_dma_free()
93 int snd_pcm_lib_preallocate_free(struct snd_pcm_substream *substream) in snd_pcm_lib_preallocate_free() argument
95 snd_pcm_lib_preallocate_dma_free(substream); in snd_pcm_lib_preallocate_free()
97 snd_info_free_entry(substream->proc_prealloc_max_entry); in snd_pcm_lib_preallocate_free()
98 substream->proc_prealloc_max_entry = NULL; in snd_pcm_lib_preallocate_free()
99 snd_info_free_entry(substream->proc_prealloc_entry); in snd_pcm_lib_preallocate_free()
100 substream->proc_prealloc_entry = NULL; in snd_pcm_lib_preallocate_free()
115 struct snd_pcm_substream *substream; in snd_pcm_lib_preallocate_free_for_all() local
119 for (substream = pcm->streams[stream].substream; substream; substream = substream->next) in snd_pcm_lib_preallocate_free_for_all()
120 snd_pcm_lib_preallocate_free(substream); in snd_pcm_lib_preallocate_free_for_all()
134 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_lib_preallocate_proc_read() local
135 snd_iprintf(buffer, "%lu\n", (unsigned long) substream->dma_buffer.bytes / 1024); in snd_pcm_lib_preallocate_proc_read()
146 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_lib_preallocate_max_proc_read() local
147 snd_iprintf(buffer, "%lu\n", (unsigned long) substream->dma_max / 1024); in snd_pcm_lib_preallocate_max_proc_read()
158 struct snd_pcm_substream *substream = entry->private_data; in snd_pcm_lib_preallocate_proc_write() local
163 if (substream->runtime) { in snd_pcm_lib_preallocate_proc_write()
170 if ((size != 0 && size < 8192) || size > substream->dma_max) { in snd_pcm_lib_preallocate_proc_write()
174 if (substream->dma_buffer.bytes == size) in snd_pcm_lib_preallocate_proc_write()
177 new_dmab.dev = substream->dma_buffer.dev; in snd_pcm_lib_preallocate_proc_write()
179 if (snd_dma_alloc_pages(substream->dma_buffer.dev.type, in snd_pcm_lib_preallocate_proc_write()
180 substream->dma_buffer.dev.dev, in snd_pcm_lib_preallocate_proc_write()
185 substream->buffer_bytes_max = size; in snd_pcm_lib_preallocate_proc_write()
187 substream->buffer_bytes_max = UINT_MAX; in snd_pcm_lib_preallocate_proc_write()
189 if (substream->dma_buffer.area) in snd_pcm_lib_preallocate_proc_write()
190 snd_dma_free_pages(&substream->dma_buffer); in snd_pcm_lib_preallocate_proc_write()
191 substream->dma_buffer = new_dmab; in snd_pcm_lib_preallocate_proc_write()
197 static inline void preallocate_info_init(struct snd_pcm_substream *substream) in preallocate_info_init() argument
201 …if ((entry = snd_info_create_card_entry(substream->pcm->card, "prealloc", substream->proc_root)) !… in preallocate_info_init()
205 entry->private_data = substream; in preallocate_info_init()
211 substream->proc_prealloc_entry = entry; in preallocate_info_init()
212 …if ((entry = snd_info_create_card_entry(substream->pcm->card, "prealloc_max", substream->proc_root… in preallocate_info_init()
214 entry->private_data = substream; in preallocate_info_init()
220 substream->proc_prealloc_max_entry = entry; in preallocate_info_init()
230 static int snd_pcm_lib_preallocate_pages1(struct snd_pcm_substream *substream, in snd_pcm_lib_preallocate_pages1() argument
234 if (size > 0 && preallocate_dma && substream->number < maximum_substreams) in snd_pcm_lib_preallocate_pages1()
235 preallocate_pcm_pages(substream, size); in snd_pcm_lib_preallocate_pages1()
237 if (substream->dma_buffer.bytes > 0) in snd_pcm_lib_preallocate_pages1()
238 substream->buffer_bytes_max = substream->dma_buffer.bytes; in snd_pcm_lib_preallocate_pages1()
239 substream->dma_max = max; in snd_pcm_lib_preallocate_pages1()
240 preallocate_info_init(substream); in snd_pcm_lib_preallocate_pages1()
257 int snd_pcm_lib_preallocate_pages(struct snd_pcm_substream *substream, in snd_pcm_lib_preallocate_pages() argument
261 substream->dma_buffer.dev.type = type; in snd_pcm_lib_preallocate_pages()
262 substream->dma_buffer.dev.dev = data; in snd_pcm_lib_preallocate_pages()
263 return snd_pcm_lib_preallocate_pages1(substream, size, max); in snd_pcm_lib_preallocate_pages()
284 struct snd_pcm_substream *substream; in snd_pcm_lib_preallocate_pages_for_all() local
288 for (substream = pcm->streams[stream].substream; substream; substream = substream->next) in snd_pcm_lib_preallocate_pages_for_all()
289 if ((err = snd_pcm_lib_preallocate_pages(substream, type, data, size, max)) < 0) in snd_pcm_lib_preallocate_pages_for_all()
305 struct page *snd_pcm_sgbuf_ops_page(struct snd_pcm_substream *substream, unsigned long offset) in snd_pcm_sgbuf_ops_page() argument
307 struct snd_sg_buf *sgbuf = snd_pcm_substream_sgbuf(substream); in snd_pcm_sgbuf_ops_page()
328 int snd_pcm_lib_malloc_pages(struct snd_pcm_substream *substream, size_t size) in snd_pcm_lib_malloc_pages() argument
333 if (PCM_RUNTIME_CHECK(substream)) in snd_pcm_lib_malloc_pages()
335 if (snd_BUG_ON(substream->dma_buffer.dev.type == in snd_pcm_lib_malloc_pages()
338 runtime = substream->runtime; in snd_pcm_lib_malloc_pages()
348 snd_pcm_lib_free_pages(substream); in snd_pcm_lib_malloc_pages()
350 if (substream->dma_buffer.area != NULL && in snd_pcm_lib_malloc_pages()
351 substream->dma_buffer.bytes >= size) { in snd_pcm_lib_malloc_pages()
352 dmab = &substream->dma_buffer; /* use the pre-allocated buffer */ in snd_pcm_lib_malloc_pages()
357 dmab->dev = substream->dma_buffer.dev; in snd_pcm_lib_malloc_pages()
358 if (snd_dma_alloc_pages(substream->dma_buffer.dev.type, in snd_pcm_lib_malloc_pages()
359 substream->dma_buffer.dev.dev, in snd_pcm_lib_malloc_pages()
365 snd_pcm_set_runtime_buffer(substream, dmab); in snd_pcm_lib_malloc_pages()
379 int snd_pcm_lib_free_pages(struct snd_pcm_substream *substream) in snd_pcm_lib_free_pages() argument
383 if (PCM_RUNTIME_CHECK(substream)) in snd_pcm_lib_free_pages()
385 runtime = substream->runtime; in snd_pcm_lib_free_pages()
388 if (runtime->dma_buffer_p != &substream->dma_buffer) { in snd_pcm_lib_free_pages()
393 snd_pcm_set_runtime_buffer(substream, NULL); in snd_pcm_lib_free_pages()
398 int _snd_pcm_lib_alloc_vmalloc_buffer(struct snd_pcm_substream *substream, in _snd_pcm_lib_alloc_vmalloc_buffer() argument
403 if (PCM_RUNTIME_CHECK(substream)) in _snd_pcm_lib_alloc_vmalloc_buffer()
405 runtime = substream->runtime; in _snd_pcm_lib_alloc_vmalloc_buffer()
426 int snd_pcm_lib_free_vmalloc_buffer(struct snd_pcm_substream *substream) in snd_pcm_lib_free_vmalloc_buffer() argument
430 if (PCM_RUNTIME_CHECK(substream)) in snd_pcm_lib_free_vmalloc_buffer()
432 runtime = substream->runtime; in snd_pcm_lib_free_vmalloc_buffer()
449 struct page *snd_pcm_lib_get_vmalloc_page(struct snd_pcm_substream *substream, in snd_pcm_lib_get_vmalloc_page() argument
452 return vmalloc_to_page(substream->runtime->dma_area + offset); in snd_pcm_lib_get_vmalloc_page()