Lines Matching refs:pipe

101 static int xvip_pipeline_start_stop(struct xvip_pipeline *pipe, bool start)  in xvip_pipeline_start_stop()  argument
103 struct xvip_dma *dma = pipe->output; in xvip_pipeline_start_stop()
156 static int xvip_pipeline_set_stream(struct xvip_pipeline *pipe, bool on) in xvip_pipeline_set_stream() argument
160 mutex_lock(&pipe->lock); in xvip_pipeline_set_stream()
163 if (pipe->stream_count == pipe->num_dmas - 1) { in xvip_pipeline_set_stream()
164 ret = xvip_pipeline_start_stop(pipe, true); in xvip_pipeline_set_stream()
168 pipe->stream_count++; in xvip_pipeline_set_stream()
170 if (--pipe->stream_count == 0) in xvip_pipeline_set_stream()
171 xvip_pipeline_start_stop(pipe, false); in xvip_pipeline_set_stream()
175 mutex_unlock(&pipe->lock); in xvip_pipeline_set_stream()
179 static int xvip_pipeline_validate(struct xvip_pipeline *pipe, in xvip_pipeline_validate() argument
202 pipe->output = dma; in xvip_pipeline_validate()
215 pipe->num_dmas = num_inputs + num_outputs; in xvip_pipeline_validate()
220 static void __xvip_pipeline_cleanup(struct xvip_pipeline *pipe) in __xvip_pipeline_cleanup() argument
222 pipe->num_dmas = 0; in __xvip_pipeline_cleanup()
223 pipe->output = NULL; in __xvip_pipeline_cleanup()
232 static void xvip_pipeline_cleanup(struct xvip_pipeline *pipe) in xvip_pipeline_cleanup() argument
234 mutex_lock(&pipe->lock); in xvip_pipeline_cleanup()
237 if (--pipe->use_count == 0) in xvip_pipeline_cleanup()
238 __xvip_pipeline_cleanup(pipe); in xvip_pipeline_cleanup()
240 mutex_unlock(&pipe->lock); in xvip_pipeline_cleanup()
253 static int xvip_pipeline_prepare(struct xvip_pipeline *pipe, in xvip_pipeline_prepare() argument
258 mutex_lock(&pipe->lock); in xvip_pipeline_prepare()
261 if (pipe->use_count == 0) { in xvip_pipeline_prepare()
262 ret = xvip_pipeline_validate(pipe, dma); in xvip_pipeline_prepare()
264 __xvip_pipeline_cleanup(pipe); in xvip_pipeline_prepare()
269 pipe->use_count++; in xvip_pipeline_prepare()
273 mutex_unlock(&pipe->lock); in xvip_pipeline_prepare()
390 struct xvip_pipeline *pipe; in xvip_dma_start_streaming() local
402 pipe = dma->video.entity.pipe in xvip_dma_start_streaming()
403 ? to_xvip_pipeline(&dma->video.entity) : &dma->pipe; in xvip_dma_start_streaming()
405 ret = media_entity_pipeline_start(&dma->video.entity, &pipe->pipe); in xvip_dma_start_streaming()
416 ret = xvip_pipeline_prepare(pipe, dma); in xvip_dma_start_streaming()
426 xvip_pipeline_set_stream(pipe, true); in xvip_dma_start_streaming()
448 struct xvip_pipeline *pipe = to_xvip_pipeline(&dma->video.entity); in xvip_dma_stop_streaming() local
452 xvip_pipeline_set_stream(pipe, false); in xvip_dma_stop_streaming()
458 xvip_pipeline_cleanup(pipe); in xvip_dma_stop_streaming()
662 mutex_init(&dma->pipe.lock); in xvip_dma_init()
765 mutex_destroy(&dma->pipe.lock); in xvip_dma_cleanup()