Lines Matching refs:pipe
244 void vsp1_pipeline_reset(struct vsp1_pipeline *pipe) in vsp1_pipeline_reset() argument
249 if (pipe->brx) { in vsp1_pipeline_reset()
250 struct vsp1_brx *brx = to_brx(&pipe->brx->subdev); in vsp1_pipeline_reset()
256 for (i = 0; i < ARRAY_SIZE(pipe->inputs); ++i) in vsp1_pipeline_reset()
257 pipe->inputs[i] = NULL; in vsp1_pipeline_reset()
259 pipe->output = NULL; in vsp1_pipeline_reset()
261 list_for_each_entry(entity, &pipe->entities, list_pipe) in vsp1_pipeline_reset()
262 entity->pipe = NULL; in vsp1_pipeline_reset()
264 INIT_LIST_HEAD(&pipe->entities); in vsp1_pipeline_reset()
265 pipe->state = VSP1_PIPELINE_STOPPED; in vsp1_pipeline_reset()
266 pipe->buffers_ready = 0; in vsp1_pipeline_reset()
267 pipe->num_inputs = 0; in vsp1_pipeline_reset()
268 pipe->brx = NULL; in vsp1_pipeline_reset()
269 pipe->hgo = NULL; in vsp1_pipeline_reset()
270 pipe->hgt = NULL; in vsp1_pipeline_reset()
271 pipe->lif = NULL; in vsp1_pipeline_reset()
272 pipe->uds = NULL; in vsp1_pipeline_reset()
275 void vsp1_pipeline_init(struct vsp1_pipeline *pipe) in vsp1_pipeline_init() argument
277 mutex_init(&pipe->lock); in vsp1_pipeline_init()
278 spin_lock_init(&pipe->irqlock); in vsp1_pipeline_init()
279 init_waitqueue_head(&pipe->wq); in vsp1_pipeline_init()
280 kref_init(&pipe->kref); in vsp1_pipeline_init()
282 INIT_LIST_HEAD(&pipe->entities); in vsp1_pipeline_init()
283 pipe->state = VSP1_PIPELINE_STOPPED; in vsp1_pipeline_init()
287 void vsp1_pipeline_run(struct vsp1_pipeline *pipe) in vsp1_pipeline_run() argument
289 struct vsp1_device *vsp1 = pipe->output->entity.vsp1; in vsp1_pipeline_run()
291 if (pipe->state == VSP1_PIPELINE_STOPPED) { in vsp1_pipeline_run()
292 vsp1_write(vsp1, VI6_CMD(pipe->output->entity.index), in vsp1_pipeline_run()
294 pipe->state = VSP1_PIPELINE_RUNNING; in vsp1_pipeline_run()
297 pipe->buffers_ready = 0; in vsp1_pipeline_run()
300 bool vsp1_pipeline_stopped(struct vsp1_pipeline *pipe) in vsp1_pipeline_stopped() argument
305 spin_lock_irqsave(&pipe->irqlock, flags); in vsp1_pipeline_stopped()
306 stopped = pipe->state == VSP1_PIPELINE_STOPPED; in vsp1_pipeline_stopped()
307 spin_unlock_irqrestore(&pipe->irqlock, flags); in vsp1_pipeline_stopped()
312 int vsp1_pipeline_stop(struct vsp1_pipeline *pipe) in vsp1_pipeline_stop() argument
314 struct vsp1_device *vsp1 = pipe->output->entity.vsp1; in vsp1_pipeline_stop()
319 if (pipe->lif) { in vsp1_pipeline_stop()
324 ret = vsp1_reset_wpf(vsp1, pipe->output->entity.index); in vsp1_pipeline_stop()
326 spin_lock_irqsave(&pipe->irqlock, flags); in vsp1_pipeline_stop()
327 pipe->state = VSP1_PIPELINE_STOPPED; in vsp1_pipeline_stop()
328 spin_unlock_irqrestore(&pipe->irqlock, flags); in vsp1_pipeline_stop()
332 spin_lock_irqsave(&pipe->irqlock, flags); in vsp1_pipeline_stop()
333 if (pipe->state == VSP1_PIPELINE_RUNNING) in vsp1_pipeline_stop()
334 pipe->state = VSP1_PIPELINE_STOPPING; in vsp1_pipeline_stop()
335 spin_unlock_irqrestore(&pipe->irqlock, flags); in vsp1_pipeline_stop()
337 ret = wait_event_timeout(pipe->wq, vsp1_pipeline_stopped(pipe), in vsp1_pipeline_stop()
342 list_for_each_entry(entity, &pipe->entities, list_pipe) { in vsp1_pipeline_stop()
348 if (pipe->hgo) in vsp1_pipeline_stop()
353 if (pipe->hgt) in vsp1_pipeline_stop()
358 v4l2_subdev_call(&pipe->output->entity.subdev, video, s_stream, 0); in vsp1_pipeline_stop()
363 bool vsp1_pipeline_ready(struct vsp1_pipeline *pipe) in vsp1_pipeline_ready() argument
367 mask = ((1 << pipe->num_inputs) - 1) << 1; in vsp1_pipeline_ready()
368 if (!pipe->lif) in vsp1_pipeline_ready()
371 return pipe->buffers_ready == mask; in vsp1_pipeline_ready()
374 void vsp1_pipeline_frame_end(struct vsp1_pipeline *pipe) in vsp1_pipeline_frame_end() argument
378 if (pipe == NULL) in vsp1_pipeline_frame_end()
386 flags = vsp1_dlm_irq_frame_end(pipe->output->dlm); in vsp1_pipeline_frame_end()
388 if (pipe->hgo) in vsp1_pipeline_frame_end()
389 vsp1_hgo_frame_end(pipe->hgo); in vsp1_pipeline_frame_end()
391 if (pipe->hgt) in vsp1_pipeline_frame_end()
392 vsp1_hgt_frame_end(pipe->hgt); in vsp1_pipeline_frame_end()
398 if (pipe->frame_end) in vsp1_pipeline_frame_end()
399 pipe->frame_end(pipe, flags); in vsp1_pipeline_frame_end()
401 pipe->sequence++; in vsp1_pipeline_frame_end()
412 void vsp1_pipeline_propagate_alpha(struct vsp1_pipeline *pipe, in vsp1_pipeline_propagate_alpha() argument
415 if (!pipe->uds) in vsp1_pipeline_propagate_alpha()
422 if (pipe->uds_input->type == VSP1_ENTITY_BRU || in vsp1_pipeline_propagate_alpha()
423 pipe->uds_input->type == VSP1_ENTITY_BRS) in vsp1_pipeline_propagate_alpha()
426 vsp1_uds_set_alpha(pipe->uds, dlb, alpha); in vsp1_pipeline_propagate_alpha()
437 void vsp1_pipeline_propagate_partition(struct vsp1_pipeline *pipe, in vsp1_pipeline_propagate_partition() argument
444 list_for_each_entry_reverse(entity, &pipe->entities, list_pipe) { in vsp1_pipeline_propagate_partition()
446 entity->ops->partition(entity, pipe, partition, index, in vsp1_pipeline_propagate_partition()