Lines Matching refs:runtime
172 static void check_buf_block_i(struct pcmtst_buf_iter *v_iter, struct snd_pcm_runtime *runtime) in check_buf_block_i() argument
179 current_byte = runtime->dma_area[v_iter->buf_pos]; in check_buf_block_i()
182 ch_num = (v_iter->total_bytes / v_iter->sample_bytes) % runtime->channels; in check_buf_block_i()
184 runtime->channels, in check_buf_block_i()
190 inc_buf_pos(v_iter, 1, runtime->dma_bytes); in check_buf_block_i()
193 inc_buf_pos(v_iter, v_iter->b_rw - i, runtime->dma_bytes); in check_buf_block_i()
196 static void check_buf_block_ni(struct pcmtst_buf_iter *v_iter, struct snd_pcm_runtime *runtime) in check_buf_block_ni() argument
198 unsigned int channels = runtime->channels; in check_buf_block_ni()
205 current_byte = runtime->dma_area[buf_pos_n(v_iter, channels, ch_num)]; in check_buf_block_ni()
213 inc_buf_pos(v_iter, 1, runtime->dma_bytes); in check_buf_block_ni()
215 inc_buf_pos(v_iter, v_iter->b_rw - i, runtime->dma_bytes); in check_buf_block_ni()
223 static void check_buf_block(struct pcmtst_buf_iter *v_iter, struct snd_pcm_runtime *runtime) in check_buf_block() argument
226 check_buf_block_i(v_iter, runtime); in check_buf_block()
228 check_buf_block_ni(v_iter, runtime); in check_buf_block()
239 static void fill_block_pattern_n(struct pcmtst_buf_iter *v_iter, struct snd_pcm_runtime *runtime) in fill_block_pattern_n() argument
242 unsigned int channels = runtime->channels; in fill_block_pattern_n()
247 runtime->dma_area[buf_pos_n(v_iter, channels, ch_num)] = in fill_block_pattern_n()
250 inc_buf_pos(v_iter, 1, runtime->dma_bytes); in fill_block_pattern_n()
255 static void fill_block_pattern_i(struct pcmtst_buf_iter *v_iter, struct snd_pcm_runtime *runtime) in fill_block_pattern_i() argument
261 pos_in_ch = ch_pos_i(v_iter->total_bytes, runtime->channels, v_iter->sample_bytes); in fill_block_pattern_i()
264 for (ch = 0; ch < runtime->channels; ch++) { in fill_block_pattern_i()
268 runtime->dma_area[v_iter->buf_pos] = patt_bufs[ch].buf[pos_pattern]; in fill_block_pattern_i()
269 inc_buf_pos(v_iter, 1, runtime->dma_bytes); in fill_block_pattern_i()
275 static void fill_block_pattern(struct pcmtst_buf_iter *v_iter, struct snd_pcm_runtime *runtime) in fill_block_pattern() argument
278 fill_block_pattern_i(v_iter, runtime); in fill_block_pattern()
280 fill_block_pattern_n(v_iter, runtime); in fill_block_pattern()
283 static void fill_block_rand_n(struct pcmtst_buf_iter *v_iter, struct snd_pcm_runtime *runtime) in fill_block_rand_n() argument
285 unsigned int channels = runtime->channels; in fill_block_rand_n()
287 size_t bytes_remain = runtime->dma_bytes - v_iter->buf_pos; in fill_block_rand_n()
293 get_random_bytes(runtime->dma_area + buf_pos_n(v_iter, channels, i), in fill_block_rand_n()
297 get_random_bytes(runtime->dma_area + buf_pos_n(v_iter, channels, i), in fill_block_rand_n()
299 get_random_bytes(runtime->dma_area + v_iter->chan_block * i, in fill_block_rand_n()
303 inc_buf_pos(v_iter, v_iter->b_rw, runtime->dma_bytes); in fill_block_rand_n()
306 static void fill_block_rand_i(struct pcmtst_buf_iter *v_iter, struct snd_pcm_runtime *runtime) in fill_block_rand_i() argument
308 size_t in_cur_block = runtime->dma_bytes - v_iter->buf_pos; in fill_block_rand_i()
311 get_random_bytes(&runtime->dma_area[v_iter->buf_pos], v_iter->b_rw); in fill_block_rand_i()
313 get_random_bytes(&runtime->dma_area[v_iter->buf_pos], in_cur_block); in fill_block_rand_i()
314 get_random_bytes(runtime->dma_area, v_iter->b_rw - in_cur_block); in fill_block_rand_i()
316 inc_buf_pos(v_iter, v_iter->b_rw, runtime->dma_bytes); in fill_block_rand_i()
319 static void fill_block_random(struct pcmtst_buf_iter *v_iter, struct snd_pcm_runtime *runtime) in fill_block_random() argument
322 fill_block_rand_i(v_iter, runtime); in fill_block_random()
324 fill_block_rand_n(v_iter, runtime); in fill_block_random()
327 static void fill_block(struct pcmtst_buf_iter *v_iter, struct snd_pcm_runtime *runtime) in fill_block() argument
331 fill_block_random(v_iter, runtime); in fill_block()
334 fill_block_pattern(v_iter, runtime); in fill_block()
356 check_buf_block(v_iter, substream->runtime); in timer_timeout()
358 fill_block(v_iter, substream->runtime); in timer_timeout()
360 inc_buf_pos(v_iter, v_iter->b_rw, substream->runtime->dma_bytes); in timer_timeout()
374 struct snd_pcm_runtime *runtime = substream->runtime; in snd_pcmtst_pcm_open() local
385 runtime->hw = snd_pcmtst_hw; in snd_pcmtst_pcm_open()
386 runtime->private_data = v_iter; in snd_pcmtst_pcm_open()
398 struct pcmtst_buf_iter *v_iter = substream->runtime->private_data; in snd_pcmtst_pcm_close()
422 struct pcmtst_buf_iter *v_iter = substream->runtime->private_data; in snd_pcmtst_pcm_trigger()
447 struct pcmtst_buf_iter *v_iter = substream->runtime->private_data; in snd_pcmtst_pcm_pointer()
449 return bytes_to_frames(substream->runtime, v_iter->buf_pos); in snd_pcmtst_pcm_pointer()
472 struct snd_pcm_runtime *runtime = substream->runtime; in snd_pcmtst_pcm_prepare() local
473 struct pcmtst_buf_iter *v_iter = runtime->private_data; in snd_pcmtst_pcm_prepare()
478 v_iter->sample_bytes = samples_to_bytes(runtime, 1); in snd_pcmtst_pcm_prepare()
481 if (runtime->access == SNDRV_PCM_ACCESS_RW_NONINTERLEAVED || in snd_pcmtst_pcm_prepare()
482 runtime->access == SNDRV_PCM_ACCESS_MMAP_NONINTERLEAVED) { in snd_pcmtst_pcm_prepare()
483 v_iter->chan_block = snd_pcm_lib_buffer_bytes(substream) / runtime->channels; in snd_pcmtst_pcm_prepare()
487 v_iter->s_rw_ch = runtime->rate / TIMER_PER_SEC; in snd_pcmtst_pcm_prepare()
488 v_iter->b_rw = v_iter->s_rw_ch * v_iter->sample_bytes * runtime->channels; in snd_pcmtst_pcm_prepare()
518 struct pcmtst_buf_iter *v_iter = substream->runtime->private_data; in snd_pcmtst_sync_stop()