Lines Matching full:runtime
426 void (*private_free)(struct snd_pcm_runtime *runtime);
477 /* -- runtime information -- */
478 struct snd_pcm_runtime *runtime; member
713 return (substream->runtime->state == SNDRV_PCM_STATE_RUNNING || in snd_pcm_running()
714 (substream->runtime->state == SNDRV_PCM_STATE_DRAINING && in snd_pcm_running()
720 * @runtime: PCM runtime to set
725 static inline void __snd_pcm_set_state(struct snd_pcm_runtime *runtime, in __snd_pcm_set_state() argument
728 runtime->state = state; in __snd_pcm_set_state()
729 runtime->status->state = state; /* copy for mmap */ in __snd_pcm_set_state()
734 * @runtime: PCM runtime instance
739 static inline ssize_t bytes_to_samples(struct snd_pcm_runtime *runtime, ssize_t size) in bytes_to_samples() argument
741 return size * 8 / runtime->sample_bits; in bytes_to_samples()
746 * @runtime: PCM runtime instance
751 static inline snd_pcm_sframes_t bytes_to_frames(struct snd_pcm_runtime *runtime, ssize_t size) in bytes_to_frames() argument
753 return size * 8 / runtime->frame_bits; in bytes_to_frames()
758 * @runtime: PCM runtime instance
763 static inline ssize_t samples_to_bytes(struct snd_pcm_runtime *runtime, ssize_t size) in samples_to_bytes() argument
765 return size * runtime->sample_bits / 8; in samples_to_bytes()
770 * @runtime: PCM runtime instance
775 static inline ssize_t frames_to_bytes(struct snd_pcm_runtime *runtime, snd_pcm_sframes_t size) in frames_to_bytes() argument
777 return size * runtime->frame_bits / 8; in frames_to_bytes()
782 * @runtime: PCM runtime instance
787 static inline int frame_aligned(struct snd_pcm_runtime *runtime, ssize_t bytes) in frame_aligned() argument
789 return bytes % runtime->byte_align == 0; in frame_aligned()
800 struct snd_pcm_runtime *runtime = substream->runtime; in snd_pcm_lib_buffer_bytes() local
801 return frames_to_bytes(runtime, runtime->buffer_size); in snd_pcm_lib_buffer_bytes()
812 struct snd_pcm_runtime *runtime = substream->runtime; in snd_pcm_lib_period_bytes() local
813 return frames_to_bytes(runtime, runtime->period_size); in snd_pcm_lib_period_bytes()
818 * @runtime: PCM runtime instance
824 static inline snd_pcm_uframes_t snd_pcm_playback_avail(struct snd_pcm_runtime *runtime) in snd_pcm_playback_avail() argument
826 …snd_pcm_sframes_t avail = runtime->status->hw_ptr + runtime->buffer_size - runtime->control->appl_… in snd_pcm_playback_avail()
828 avail += runtime->boundary; in snd_pcm_playback_avail()
829 else if ((snd_pcm_uframes_t) avail >= runtime->boundary) in snd_pcm_playback_avail()
830 avail -= runtime->boundary; in snd_pcm_playback_avail()
836 * @runtime: PCM runtime instance
842 static inline snd_pcm_uframes_t snd_pcm_capture_avail(struct snd_pcm_runtime *runtime) in snd_pcm_capture_avail() argument
844 snd_pcm_sframes_t avail = runtime->status->hw_ptr - runtime->control->appl_ptr; in snd_pcm_capture_avail()
846 avail += runtime->boundary; in snd_pcm_capture_avail()
852 * @runtime: PCM runtime instance
856 static inline snd_pcm_sframes_t snd_pcm_playback_hw_avail(struct snd_pcm_runtime *runtime) in snd_pcm_playback_hw_avail() argument
858 return runtime->buffer_size - snd_pcm_playback_avail(runtime); in snd_pcm_playback_hw_avail()
863 * @runtime: PCM runtime instance
867 static inline snd_pcm_sframes_t snd_pcm_capture_hw_avail(struct snd_pcm_runtime *runtime) in snd_pcm_capture_hw_avail() argument
869 return runtime->buffer_size - snd_pcm_capture_avail(runtime); in snd_pcm_capture_hw_avail()
882 struct snd_pcm_runtime *runtime = substream->runtime; in snd_pcm_playback_ready() local
883 return snd_pcm_playback_avail(runtime) >= runtime->control->avail_min; in snd_pcm_playback_ready()
896 struct snd_pcm_runtime *runtime = substream->runtime; in snd_pcm_capture_ready() local
897 return snd_pcm_capture_avail(runtime) >= runtime->control->avail_min; in snd_pcm_capture_ready()
911 struct snd_pcm_runtime *runtime = substream->runtime; in snd_pcm_playback_data() local
913 if (runtime->stop_threshold >= runtime->boundary) in snd_pcm_playback_data()
915 return snd_pcm_playback_avail(runtime) < runtime->buffer_size; in snd_pcm_playback_data()
928 struct snd_pcm_runtime *runtime = substream->runtime; in snd_pcm_playback_empty() local
929 return snd_pcm_playback_avail(runtime) >= runtime->buffer_size; in snd_pcm_playback_empty()
942 struct snd_pcm_runtime *runtime = substream->runtime; in snd_pcm_capture_empty() local
943 return snd_pcm_capture_avail(runtime) == 0; in snd_pcm_capture_empty()
963 substream->runtime->trigger_master = master; in snd_pcm_trigger_done()
1082 int snd_pcm_hw_constraint_mask64(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var,
1084 int snd_pcm_hw_constraint_minmax(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var,
1086 int snd_pcm_hw_constraint_integer(struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var);
1087 int snd_pcm_hw_constraint_list(struct snd_pcm_runtime *runtime,
1091 int snd_pcm_hw_constraint_ranges(struct snd_pcm_runtime *runtime,
1095 int snd_pcm_hw_constraint_ratnums(struct snd_pcm_runtime *runtime,
1099 int snd_pcm_hw_constraint_ratdens(struct snd_pcm_runtime *runtime,
1103 int snd_pcm_hw_constraint_msbits(struct snd_pcm_runtime *runtime,
1107 int snd_pcm_hw_constraint_step(struct snd_pcm_runtime *runtime,
1111 int snd_pcm_hw_constraint_pow2(struct snd_pcm_runtime *runtime,
1114 int snd_pcm_hw_rule_noresample(struct snd_pcm_runtime *runtime,
1116 int snd_pcm_hw_rule_add(struct snd_pcm_runtime *runtime,
1124 * @runtime: PCM runtime instance
1132 struct snd_pcm_runtime *runtime, snd_pcm_hw_param_t var, in snd_pcm_hw_constraint_single() argument
1135 return snd_pcm_hw_constraint_minmax(runtime, var, val, val); in snd_pcm_hw_constraint_single()
1176 substream->runtime->std_sync_id = true; in snd_pcm_set_sync()
1245 snd_pcm_limit_hw_rates(struct snd_pcm_runtime *runtime) in snd_pcm_limit_hw_rates() argument
1247 return snd_pcm_hw_limit_rates(&runtime->hw); in snd_pcm_limit_hw_rates()
1258 * snd_pcm_set_runtime_buffer - Set the PCM runtime buffer
1262 * Copy the buffer information to runtime->dma_buffer when @bufp is non-NULL.
1268 struct snd_pcm_runtime *runtime = substream->runtime; in snd_pcm_set_runtime_buffer() local
1270 runtime->dma_buffer_p = bufp; in snd_pcm_set_runtime_buffer()
1271 runtime->dma_area = bufp->area; in snd_pcm_set_runtime_buffer()
1272 runtime->dma_addr = bufp->addr; in snd_pcm_set_runtime_buffer()
1273 runtime->dma_bytes = bufp->bytes; in snd_pcm_set_runtime_buffer()
1275 runtime->dma_buffer_p = NULL; in snd_pcm_set_runtime_buffer()
1276 runtime->dma_area = NULL; in snd_pcm_set_runtime_buffer()
1277 runtime->dma_addr = 0; in snd_pcm_set_runtime_buffer()
1278 runtime->dma_bytes = 0; in snd_pcm_set_runtime_buffer()
1284 * @runtime: PCM runtime instance
1287 static inline void snd_pcm_gettime(struct snd_pcm_runtime *runtime, in snd_pcm_gettime() argument
1290 switch (runtime->tstamp_type) { in snd_pcm_gettime()
1365 #define snd_pcm_get_dma_buf(substream) ((substream)->runtime->dma_buffer_p)