Lines Matching defs:pipe
88 * @pipe: The pipeline
97 static int xvip_pipeline_start_stop(struct xvip_pipeline *pipe, bool start)
99 struct xvip_dma *dma = pipe->output;
128 * @pipe: The pipeline
151 static int xvip_pipeline_set_stream(struct xvip_pipeline *pipe, bool on)
155 mutex_lock(&pipe->lock);
158 if (pipe->stream_count == pipe->num_dmas - 1) {
159 ret = xvip_pipeline_start_stop(pipe, true);
163 pipe->stream_count++;
165 if (--pipe->stream_count == 0)
166 xvip_pipeline_start_stop(pipe, false);
170 mutex_unlock(&pipe->lock);
174 static int xvip_pipeline_validate(struct xvip_pipeline *pipe,
204 pipe->output = dma;
219 pipe->num_dmas = num_inputs + num_outputs;
224 static void __xvip_pipeline_cleanup(struct xvip_pipeline *pipe)
226 pipe->num_dmas = 0;
227 pipe->output = NULL;
232 * @pipe: the pipeline
236 static void xvip_pipeline_cleanup(struct xvip_pipeline *pipe)
238 mutex_lock(&pipe->lock);
241 if (--pipe->use_count == 0)
242 __xvip_pipeline_cleanup(pipe);
244 mutex_unlock(&pipe->lock);
249 * @pipe: the pipeline
257 static int xvip_pipeline_prepare(struct xvip_pipeline *pipe,
262 mutex_lock(&pipe->lock);
265 if (pipe->use_count == 0) {
266 ret = xvip_pipeline_validate(pipe, dma);
268 __xvip_pipeline_cleanup(pipe);
273 pipe->use_count++;
277 mutex_unlock(&pipe->lock);
394 struct xvip_pipeline *pipe;
406 pipe = dma->video.entity.pipe
407 ? to_xvip_pipeline(&dma->video.entity) : &dma->pipe;
409 ret = media_pipeline_start(&dma->video.entity, &pipe->pipe);
420 ret = xvip_pipeline_prepare(pipe, dma);
430 xvip_pipeline_set_stream(pipe, true);
452 struct xvip_pipeline *pipe = to_xvip_pipeline(&dma->video.entity);
456 xvip_pipeline_set_stream(pipe, false);
462 xvip_pipeline_cleanup(pipe);
659 mutex_init(&dma->pipe.lock);
762 mutex_destroy(&dma->pipe.lock);