Lines Matching full:runtime
171 static void check_buf_block_i(struct pcmtst_buf_iter *v_iter, struct snd_pcm_runtime *runtime) in check_buf_block_i() argument
178 current_byte = runtime->dma_area[v_iter->buf_pos]; in check_buf_block_i()
181 ch_num = (v_iter->total_bytes / v_iter->sample_bytes) % runtime->channels; in check_buf_block_i()
183 runtime->channels, in check_buf_block_i()
189 inc_buf_pos(v_iter, 1, runtime->dma_bytes); in check_buf_block_i()
192 inc_buf_pos(v_iter, v_iter->b_rw - i, runtime->dma_bytes); in check_buf_block_i()
195 static void check_buf_block_ni(struct pcmtst_buf_iter *v_iter, struct snd_pcm_runtime *runtime) in check_buf_block_ni() argument
197 unsigned int channels = runtime->channels; in check_buf_block_ni()
204 current_byte = runtime->dma_area[buf_pos_n(v_iter, channels, ch_num)]; in check_buf_block_ni()
212 inc_buf_pos(v_iter, 1, runtime->dma_bytes); in check_buf_block_ni()
214 inc_buf_pos(v_iter, v_iter->b_rw - i, runtime->dma_bytes); in check_buf_block_ni()
222 static void check_buf_block(struct pcmtst_buf_iter *v_iter, struct snd_pcm_runtime *runtime) in check_buf_block() argument
225 check_buf_block_i(v_iter, runtime); in check_buf_block()
227 check_buf_block_ni(v_iter, runtime); in check_buf_block()
238 static void fill_block_pattern_n(struct pcmtst_buf_iter *v_iter, struct snd_pcm_runtime *runtime) in fill_block_pattern_n() argument
241 unsigned int channels = runtime->channels; in fill_block_pattern_n()
246 runtime->dma_area[buf_pos_n(v_iter, channels, ch_num)] = in fill_block_pattern_n()
249 inc_buf_pos(v_iter, 1, runtime->dma_bytes); in fill_block_pattern_n()
254 static void fill_block_pattern_i(struct pcmtst_buf_iter *v_iter, struct snd_pcm_runtime *runtime) in fill_block_pattern_i() argument
260 pos_in_ch = ch_pos_i(v_iter->total_bytes, runtime->channels, v_iter->sample_bytes); in fill_block_pattern_i()
263 for (ch = 0; ch < runtime->channels; ch++) { in fill_block_pattern_i()
267 runtime->dma_area[v_iter->buf_pos] = patt_bufs[ch].buf[pos_pattern]; in fill_block_pattern_i()
268 inc_buf_pos(v_iter, 1, runtime->dma_bytes); in fill_block_pattern_i()
274 static void fill_block_pattern(struct pcmtst_buf_iter *v_iter, struct snd_pcm_runtime *runtime) in fill_block_pattern() argument
277 fill_block_pattern_i(v_iter, runtime); in fill_block_pattern()
279 fill_block_pattern_n(v_iter, runtime); in fill_block_pattern()
282 static void fill_block_rand_n(struct pcmtst_buf_iter *v_iter, struct snd_pcm_runtime *runtime) in fill_block_rand_n() argument
284 unsigned int channels = runtime->channels; in fill_block_rand_n()
286 size_t bytes_remain = runtime->dma_bytes - v_iter->buf_pos; in fill_block_rand_n()
292 get_random_bytes(runtime->dma_area + buf_pos_n(v_iter, channels, i), in fill_block_rand_n()
296 get_random_bytes(runtime->dma_area + buf_pos_n(v_iter, channels, i), in fill_block_rand_n()
298 get_random_bytes(runtime->dma_area + v_iter->chan_block * i, in fill_block_rand_n()
302 inc_buf_pos(v_iter, v_iter->b_rw, runtime->dma_bytes); in fill_block_rand_n()
305 static void fill_block_rand_i(struct pcmtst_buf_iter *v_iter, struct snd_pcm_runtime *runtime) in fill_block_rand_i() argument
307 size_t in_cur_block = runtime->dma_bytes - v_iter->buf_pos; in fill_block_rand_i()
310 get_random_bytes(&runtime->dma_area[v_iter->buf_pos], v_iter->b_rw); in fill_block_rand_i()
312 get_random_bytes(&runtime->dma_area[v_iter->buf_pos], in_cur_block); in fill_block_rand_i()
313 get_random_bytes(runtime->dma_area, v_iter->b_rw - in_cur_block); in fill_block_rand_i()
315 inc_buf_pos(v_iter, v_iter->b_rw, runtime->dma_bytes); in fill_block_rand_i()
318 static void fill_block_random(struct pcmtst_buf_iter *v_iter, struct snd_pcm_runtime *runtime) in fill_block_random() argument
321 fill_block_rand_i(v_iter, runtime); in fill_block_random()
323 fill_block_rand_n(v_iter, runtime); in fill_block_random()
326 static void fill_block(struct pcmtst_buf_iter *v_iter, struct snd_pcm_runtime *runtime) in fill_block() argument
330 fill_block_random(v_iter, runtime); in fill_block()
333 fill_block_pattern(v_iter, runtime); in fill_block()
355 check_buf_block(v_iter, substream->runtime); in timer_timeout()
357 fill_block(v_iter, substream->runtime); in timer_timeout()
359 inc_buf_pos(v_iter, v_iter->b_rw, substream->runtime->dma_bytes); in timer_timeout()
373 struct snd_pcm_runtime *runtime = substream->runtime; in snd_pcmtst_pcm_open() local
384 runtime->hw = snd_pcmtst_hw; in snd_pcmtst_pcm_open()
385 runtime->private_data = v_iter; in snd_pcmtst_pcm_open()
397 struct pcmtst_buf_iter *v_iter = substream->runtime->private_data; in snd_pcmtst_pcm_close()
421 struct pcmtst_buf_iter *v_iter = substream->runtime->private_data; in snd_pcmtst_pcm_trigger()
446 struct pcmtst_buf_iter *v_iter = substream->runtime->private_data; in snd_pcmtst_pcm_pointer()
448 return bytes_to_frames(substream->runtime, v_iter->buf_pos); in snd_pcmtst_pcm_pointer()
471 struct snd_pcm_runtime *runtime = substream->runtime; in snd_pcmtst_pcm_prepare() local
472 struct pcmtst_buf_iter *v_iter = runtime->private_data; in snd_pcmtst_pcm_prepare()
477 v_iter->sample_bytes = samples_to_bytes(runtime, 1); in snd_pcmtst_pcm_prepare()
480 if (runtime->access == SNDRV_PCM_ACCESS_RW_NONINTERLEAVED || in snd_pcmtst_pcm_prepare()
481 runtime->access == SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED) { in snd_pcmtst_pcm_prepare()
482 v_iter->chan_block = snd_pcm_lib_buffer_bytes(substream) / runtime->channels; in snd_pcmtst_pcm_prepare()
486 v_iter->s_rw_ch = runtime->rate / TIMER_PER_SEC; in snd_pcmtst_pcm_prepare()
487 v_iter->b_rw = v_iter->s_rw_ch * v_iter->sample_bytes * runtime->channels; in snd_pcmtst_pcm_prepare()
517 struct pcmtst_buf_iter *v_iter = substream->runtime->private_data; in snd_pcmtst_sync_stop()