• Home
  • Raw
  • Download

Lines Matching refs:pipe

193 static void vsp1_video_calculate_partition(struct vsp1_pipeline *pipe,  in vsp1_video_calculate_partition()  argument
206 format = vsp1_entity_get_pad_format(&pipe->output->entity, in vsp1_video_calculate_partition()
207 pipe->output->entity.config, in vsp1_video_calculate_partition()
211 if (pipe->partitions <= 1) { in vsp1_video_calculate_partition()
215 vsp1_pipeline_propagate_partition(pipe, partition, index, in vsp1_video_calculate_partition()
240 unsigned int partitions = pipe->partitions - 1; in vsp1_video_calculate_partition()
256 vsp1_pipeline_propagate_partition(pipe, partition, index, &window); in vsp1_video_calculate_partition()
259 static int vsp1_video_pipeline_setup_partitions(struct vsp1_pipeline *pipe) in vsp1_video_pipeline_setup_partitions() argument
261 struct vsp1_device *vsp1 = pipe->output->entity.vsp1; in vsp1_video_pipeline_setup_partitions()
271 format = vsp1_entity_get_pad_format(&pipe->output->entity, in vsp1_video_pipeline_setup_partitions()
272 pipe->output->entity.config, in vsp1_video_pipeline_setup_partitions()
281 list_for_each_entry(entity, &pipe->entities, list_pipe) { in vsp1_video_pipeline_setup_partitions()
287 entity_max = entity->ops->max_width(entity, pipe); in vsp1_video_pipeline_setup_partitions()
293 pipe->partitions = DIV_ROUND_UP(format->width, div_size); in vsp1_video_pipeline_setup_partitions()
294 pipe->part_table = kcalloc(pipe->partitions, sizeof(*pipe->part_table), in vsp1_video_pipeline_setup_partitions()
296 if (!pipe->part_table) in vsp1_video_pipeline_setup_partitions()
299 for (i = 0; i < pipe->partitions; ++i) in vsp1_video_pipeline_setup_partitions()
300 vsp1_video_calculate_partition(pipe, &pipe->part_table[i], in vsp1_video_pipeline_setup_partitions()
327 struct vsp1_pipeline *pipe = video->rwpf->pipe; in vsp1_video_complete_buffer() local
344 if (pipe->lif && list_is_singular(&video->irqqueue)) { in vsp1_video_complete_buffer()
357 done->buf.sequence = pipe->sequence; in vsp1_video_complete_buffer()
367 static void vsp1_video_frame_end(struct vsp1_pipeline *pipe, in vsp1_video_frame_end() argument
378 pipe->buffers_ready |= 1 << video->pipe_index; in vsp1_video_frame_end()
381 static void vsp1_video_pipeline_run_partition(struct vsp1_pipeline *pipe, in vsp1_video_pipeline_run_partition() argument
387 pipe->partition = &pipe->part_table[partition]; in vsp1_video_pipeline_run_partition()
389 list_for_each_entry(entity, &pipe->entities, list_pipe) { in vsp1_video_pipeline_run_partition()
391 entity->ops->configure(entity, pipe, dl, in vsp1_video_pipeline_run_partition()
396 static void vsp1_video_pipeline_run(struct vsp1_pipeline *pipe) in vsp1_video_pipeline_run() argument
398 struct vsp1_device *vsp1 = pipe->output->entity.vsp1; in vsp1_video_pipeline_run()
402 if (!pipe->dl) in vsp1_video_pipeline_run()
403 pipe->dl = vsp1_dl_list_get(pipe->output->dlm); in vsp1_video_pipeline_run()
410 list_for_each_entry(entity, &pipe->entities, list_pipe) { in vsp1_video_pipeline_run()
412 entity->ops->configure(entity, pipe, pipe->dl, in vsp1_video_pipeline_run()
417 vsp1_video_pipeline_run_partition(pipe, pipe->dl, 0); in vsp1_video_pipeline_run()
420 for (partition = 1; partition < pipe->partitions; ++partition) { in vsp1_video_pipeline_run()
423 dl = vsp1_dl_list_get(pipe->output->dlm); in vsp1_video_pipeline_run()
435 vsp1_video_pipeline_run_partition(pipe, dl, partition); in vsp1_video_pipeline_run()
436 vsp1_dl_list_add_chain(pipe->dl, dl); in vsp1_video_pipeline_run()
440 vsp1_dl_list_commit(pipe->dl); in vsp1_video_pipeline_run()
441 pipe->dl = NULL; in vsp1_video_pipeline_run()
443 vsp1_pipeline_run(pipe); in vsp1_video_pipeline_run()
446 static void vsp1_video_pipeline_frame_end(struct vsp1_pipeline *pipe, in vsp1_video_pipeline_frame_end() argument
449 struct vsp1_device *vsp1 = pipe->output->entity.vsp1; in vsp1_video_pipeline_frame_end()
457 spin_lock_irqsave(&pipe->irqlock, flags); in vsp1_video_pipeline_frame_end()
461 if (!pipe->inputs[i]) in vsp1_video_pipeline_frame_end()
464 vsp1_video_frame_end(pipe, pipe->inputs[i]); in vsp1_video_pipeline_frame_end()
467 vsp1_video_frame_end(pipe, pipe->output); in vsp1_video_pipeline_frame_end()
469 state = pipe->state; in vsp1_video_pipeline_frame_end()
470 pipe->state = VSP1_PIPELINE_STOPPED; in vsp1_video_pipeline_frame_end()
477 wake_up(&pipe->wq); in vsp1_video_pipeline_frame_end()
478 else if (vsp1_pipeline_ready(pipe)) in vsp1_video_pipeline_frame_end()
479 vsp1_video_pipeline_run(pipe); in vsp1_video_pipeline_frame_end()
481 spin_unlock_irqrestore(&pipe->irqlock, flags); in vsp1_video_pipeline_frame_end()
484 static int vsp1_video_pipeline_build_branch(struct vsp1_pipeline *pipe, in vsp1_video_pipeline_build_branch() argument
550 if (pipe->uds) { in vsp1_video_pipeline_build_branch()
555 pipe->uds = entity; in vsp1_video_pipeline_build_branch()
556 pipe->uds_input = bru ? &bru->entity : &input->entity; in vsp1_video_pipeline_build_branch()
574 static int vsp1_video_pipeline_build(struct vsp1_pipeline *pipe, in vsp1_video_pipeline_build() argument
600 list_add_tail(&e->list_pipe, &pipe->entities); in vsp1_video_pipeline_build()
605 pipe->inputs[rwpf->entity.index] = rwpf; in vsp1_video_pipeline_build()
606 rwpf->video->pipe_index = ++pipe->num_inputs; in vsp1_video_pipeline_build()
607 rwpf->pipe = pipe; in vsp1_video_pipeline_build()
612 pipe->output = rwpf; in vsp1_video_pipeline_build()
614 rwpf->pipe = pipe; in vsp1_video_pipeline_build()
618 pipe->lif = e; in vsp1_video_pipeline_build()
623 pipe->bru = e; in vsp1_video_pipeline_build()
627 pipe->hgo = e; in vsp1_video_pipeline_build()
628 to_hgo(subdev)->histo.pipe = pipe; in vsp1_video_pipeline_build()
632 pipe->hgt = e; in vsp1_video_pipeline_build()
633 to_hgt(subdev)->histo.pipe = pipe; in vsp1_video_pipeline_build()
644 if (pipe->num_inputs == 0 || !pipe->output) in vsp1_video_pipeline_build()
652 if (!pipe->inputs[i]) in vsp1_video_pipeline_build()
655 ret = vsp1_video_pipeline_build_branch(pipe, pipe->inputs[i], in vsp1_video_pipeline_build()
656 pipe->output); in vsp1_video_pipeline_build()
664 static int vsp1_video_pipeline_init(struct vsp1_pipeline *pipe, in vsp1_video_pipeline_init() argument
667 vsp1_pipeline_init(pipe); in vsp1_video_pipeline_init()
669 pipe->frame_end = vsp1_video_pipeline_frame_end; in vsp1_video_pipeline_init()
671 return vsp1_video_pipeline_build(pipe, video); in vsp1_video_pipeline_init()
676 struct vsp1_pipeline *pipe; in vsp1_video_pipeline_get() local
685 if (!video->rwpf->pipe) { in vsp1_video_pipeline_get()
686 pipe = kzalloc(sizeof(*pipe), GFP_KERNEL); in vsp1_video_pipeline_get()
687 if (!pipe) in vsp1_video_pipeline_get()
690 ret = vsp1_video_pipeline_init(pipe, video); in vsp1_video_pipeline_get()
692 vsp1_pipeline_reset(pipe); in vsp1_video_pipeline_get()
693 kfree(pipe); in vsp1_video_pipeline_get()
697 pipe = video->rwpf->pipe; in vsp1_video_pipeline_get()
698 kref_get(&pipe->kref); in vsp1_video_pipeline_get()
701 return pipe; in vsp1_video_pipeline_get()
706 struct vsp1_pipeline *pipe = container_of(kref, typeof(*pipe), kref); in vsp1_video_pipeline_release() local
708 vsp1_pipeline_reset(pipe); in vsp1_video_pipeline_release()
709 kfree(pipe); in vsp1_video_pipeline_release()
712 static void vsp1_video_pipeline_put(struct vsp1_pipeline *pipe) in vsp1_video_pipeline_put() argument
714 struct media_device *mdev = &pipe->output->entity.vsp1->media_dev; in vsp1_video_pipeline_put()
717 kref_put(&pipe->kref, vsp1_video_pipeline_release); in vsp1_video_pipeline_put()
780 struct vsp1_pipeline *pipe = video->rwpf->pipe; in vsp1_video_buffer_queue() local
793 spin_lock_irqsave(&pipe->irqlock, flags); in vsp1_video_buffer_queue()
796 pipe->buffers_ready |= 1 << video->pipe_index; in vsp1_video_buffer_queue()
799 vsp1_pipeline_ready(pipe)) in vsp1_video_buffer_queue()
800 vsp1_video_pipeline_run(pipe); in vsp1_video_buffer_queue()
802 spin_unlock_irqrestore(&pipe->irqlock, flags); in vsp1_video_buffer_queue()
805 static int vsp1_video_setup_pipeline(struct vsp1_pipeline *pipe) in vsp1_video_setup_pipeline() argument
811 ret = vsp1_video_pipeline_setup_partitions(pipe); in vsp1_video_setup_pipeline()
816 pipe->dl = vsp1_dl_list_get(pipe->output->dlm); in vsp1_video_setup_pipeline()
817 if (!pipe->dl) in vsp1_video_setup_pipeline()
820 if (pipe->uds) { in vsp1_video_setup_pipeline()
821 struct vsp1_uds *uds = to_uds(&pipe->uds->subdev); in vsp1_video_setup_pipeline()
830 if (pipe->uds_input->type == VSP1_ENTITY_BRU || in vsp1_video_setup_pipeline()
831 pipe->uds_input->type == VSP1_ENTITY_BRS) { in vsp1_video_setup_pipeline()
835 to_rwpf(&pipe->uds_input->subdev); in vsp1_video_setup_pipeline()
841 list_for_each_entry(entity, &pipe->entities, list_pipe) { in vsp1_video_setup_pipeline()
842 vsp1_entity_route_setup(entity, pipe, pipe->dl); in vsp1_video_setup_pipeline()
845 entity->ops->configure(entity, pipe, pipe->dl, in vsp1_video_setup_pipeline()
865 static void vsp1_video_cleanup_pipeline(struct vsp1_pipeline *pipe) in vsp1_video_cleanup_pipeline() argument
867 lockdep_assert_held(&pipe->lock); in vsp1_video_cleanup_pipeline()
870 kfree(pipe->part_table); in vsp1_video_cleanup_pipeline()
871 pipe->part_table = NULL; in vsp1_video_cleanup_pipeline()
873 vsp1_dl_list_put(pipe->dl); in vsp1_video_cleanup_pipeline()
874 pipe->dl = NULL; in vsp1_video_cleanup_pipeline()
880 struct vsp1_pipeline *pipe = video->rwpf->pipe; in vsp1_video_start_streaming() local
885 mutex_lock(&pipe->lock); in vsp1_video_start_streaming()
886 if (pipe->stream_count == pipe->num_inputs) { in vsp1_video_start_streaming()
887 ret = vsp1_video_setup_pipeline(pipe); in vsp1_video_start_streaming()
890 vsp1_video_cleanup_pipeline(pipe); in vsp1_video_start_streaming()
891 mutex_unlock(&pipe->lock); in vsp1_video_start_streaming()
898 pipe->stream_count++; in vsp1_video_start_streaming()
899 mutex_unlock(&pipe->lock); in vsp1_video_start_streaming()
911 spin_lock_irqsave(&pipe->irqlock, flags); in vsp1_video_start_streaming()
912 if (vsp1_pipeline_ready(pipe)) in vsp1_video_start_streaming()
913 vsp1_video_pipeline_run(pipe); in vsp1_video_start_streaming()
914 spin_unlock_irqrestore(&pipe->irqlock, flags); in vsp1_video_start_streaming()
922 struct vsp1_pipeline *pipe = video->rwpf->pipe; in vsp1_video_stop_streaming() local
931 pipe->buffers_ready &= ~(1 << video->pipe_index); in vsp1_video_stop_streaming()
934 mutex_lock(&pipe->lock); in vsp1_video_stop_streaming()
935 if (--pipe->stream_count == pipe->num_inputs) { in vsp1_video_stop_streaming()
937 ret = vsp1_pipeline_stop(pipe); in vsp1_video_stop_streaming()
941 vsp1_video_cleanup_pipeline(pipe); in vsp1_video_stop_streaming()
943 mutex_unlock(&pipe->lock); in vsp1_video_stop_streaming()
947 vsp1_video_pipeline_put(pipe); in vsp1_video_stop_streaming()
1053 struct vsp1_pipeline *pipe; in vsp1_video_streamon() local
1066 pipe = vsp1_video_pipeline_get(video); in vsp1_video_streamon()
1067 if (IS_ERR(pipe)) { in vsp1_video_streamon()
1069 return PTR_ERR(pipe); in vsp1_video_streamon()
1072 ret = __media_pipeline_start(&video->video.entity, &pipe->pipe); in vsp1_video_streamon()
1098 vsp1_video_pipeline_put(pipe); in vsp1_video_streamon()