Lines Matching full:pipe

33 static void vsp1_du_pipeline_frame_end(struct vsp1_pipeline *pipe,  in vsp1_du_pipeline_frame_end()  argument
36 struct vsp1_drm_pipeline *drm_pipe = to_vsp1_drm_pipeline(pipe); in vsp1_du_pipeline_frame_end()
64 struct vsp1_pipeline *pipe, in vsp1_du_insert_uif() argument
116 struct vsp1_pipeline *pipe, in vsp1_du_pipeline_setup_rpf() argument
190 ret = vsp1_du_insert_uif(vsp1, pipe, uif, &rpf->entity, RWPF_PAD_SOURCE, in vsp1_du_pipeline_setup_rpf()
191 pipe->brx, brx_input); in vsp1_du_pipeline_setup_rpf()
198 ret = v4l2_subdev_call(&pipe->brx->subdev, pad, set_fmt, NULL, in vsp1_du_pipeline_setup_rpf()
205 format.format.code, BRX_NAME(pipe->brx), format.pad); in vsp1_du_pipeline_setup_rpf()
211 ret = v4l2_subdev_call(&pipe->brx->subdev, pad, set_selection, NULL, in vsp1_du_pipeline_setup_rpf()
218 BRX_NAME(pipe->brx), sel.pad); in vsp1_du_pipeline_setup_rpf()
225 struct vsp1_pipeline *pipe);
226 static void vsp1_du_pipeline_configure(struct vsp1_pipeline *pipe);
229 struct vsp1_pipeline *pipe) in vsp1_du_pipeline_setup_brx() argument
231 struct vsp1_drm_pipeline *drm_pipe = to_vsp1_drm_pipeline(pipe); in vsp1_du_pipeline_setup_brx()
244 if (pipe->num_inputs > 2) in vsp1_du_pipeline_setup_brx()
246 else if (pipe->brx && !drm_pipe->force_brx_release) in vsp1_du_pipeline_setup_brx()
247 brx = pipe->brx; in vsp1_du_pipeline_setup_brx()
248 else if (vsp1_feature(vsp1, VSP1_HAS_BRU) && !vsp1->bru->entity.pipe) in vsp1_du_pipeline_setup_brx()
254 if (brx != pipe->brx) { in vsp1_du_pipeline_setup_brx()
258 if (pipe->brx) { in vsp1_du_pipeline_setup_brx()
259 dev_dbg(vsp1->dev, "%s: pipe %u: releasing %s\n", in vsp1_du_pipeline_setup_brx()
260 __func__, pipe->lif->index, in vsp1_du_pipeline_setup_brx()
261 BRX_NAME(pipe->brx)); in vsp1_du_pipeline_setup_brx()
277 released_brx = pipe->brx; in vsp1_du_pipeline_setup_brx()
279 list_del(&pipe->brx->list_pipe); in vsp1_du_pipeline_setup_brx()
280 pipe->brx->sink = NULL; in vsp1_du_pipeline_setup_brx()
281 pipe->brx->pipe = NULL; in vsp1_du_pipeline_setup_brx()
282 pipe->brx = NULL; in vsp1_du_pipeline_setup_brx()
289 if (brx->pipe) { in vsp1_du_pipeline_setup_brx()
292 dev_dbg(vsp1->dev, "%s: pipe %u: waiting for %s\n", in vsp1_du_pipeline_setup_brx()
293 __func__, pipe->lif->index, BRX_NAME(brx)); in vsp1_du_pipeline_setup_brx()
295 owner_pipe = to_vsp1_drm_pipeline(brx->pipe); in vsp1_du_pipeline_setup_brx()
298 vsp1_du_pipeline_setup_inputs(vsp1, &owner_pipe->pipe); in vsp1_du_pipeline_setup_brx()
299 vsp1_du_pipeline_configure(&owner_pipe->pipe); in vsp1_du_pipeline_setup_brx()
307 owner_pipe->pipe.lif->index); in vsp1_du_pipeline_setup_brx()
313 * the pipe pointer NULL) to let vsp1_du_pipeline_configure() in vsp1_du_pipeline_setup_brx()
316 if (released_brx && !released_brx->pipe) in vsp1_du_pipeline_setup_brx()
318 &pipe->entities); in vsp1_du_pipeline_setup_brx()
324 dev_dbg(vsp1->dev, "%s: pipe %u: acquired %s\n", in vsp1_du_pipeline_setup_brx()
325 __func__, pipe->lif->index, BRX_NAME(brx)); in vsp1_du_pipeline_setup_brx()
327 pipe->brx = brx; in vsp1_du_pipeline_setup_brx()
328 pipe->brx->pipe = pipe; in vsp1_du_pipeline_setup_brx()
329 pipe->brx->sink = &pipe->output->entity; in vsp1_du_pipeline_setup_brx()
330 pipe->brx->sink_pad = 0; in vsp1_du_pipeline_setup_brx()
332 list_add_tail(&pipe->brx->list_pipe, in vsp1_du_pipeline_setup_brx()
333 &pipe->output->entity.list_pipe); in vsp1_du_pipeline_setup_brx()
372 struct vsp1_pipeline *pipe) in vsp1_du_pipeline_setup_inputs() argument
374 struct vsp1_drm_pipeline *drm_pipe = to_vsp1_drm_pipeline(pipe); in vsp1_du_pipeline_setup_inputs()
383 pipe->num_inputs = 0; in vsp1_du_pipeline_setup_inputs()
389 if (!pipe->inputs[i]) in vsp1_du_pipeline_setup_inputs()
393 for (j = pipe->num_inputs++; j > 0; --j) { in vsp1_du_pipeline_setup_inputs()
407 ret = vsp1_du_pipeline_setup_brx(vsp1, pipe); in vsp1_du_pipeline_setup_inputs()
410 BRX_NAME(pipe->brx)); in vsp1_du_pipeline_setup_inputs()
414 brx = to_brx(&pipe->brx->subdev); in vsp1_du_pipeline_setup_inputs()
417 for (i = 0; i < pipe->brx->source_pad; ++i) { in vsp1_du_pipeline_setup_inputs()
425 if (!rpf->entity.pipe) { in vsp1_du_pipeline_setup_inputs()
426 rpf->entity.pipe = pipe; in vsp1_du_pipeline_setup_inputs()
427 list_add(&rpf->entity.list_pipe, &pipe->entities); in vsp1_du_pipeline_setup_inputs()
432 rpf->entity.sink = pipe->brx; in vsp1_du_pipeline_setup_inputs()
436 __func__, rpf->entity.index, BRX_NAME(pipe->brx), i); in vsp1_du_pipeline_setup_inputs()
442 ret = vsp1_du_pipeline_setup_rpf(vsp1, pipe, rpf, uif, i); in vsp1_du_pipeline_setup_inputs()
455 ret = vsp1_du_insert_uif(vsp1, pipe, uif, in vsp1_du_pipeline_setup_inputs()
456 pipe->brx, pipe->brx->source_pad, in vsp1_du_pipeline_setup_inputs()
457 &pipe->output->entity, 0); in vsp1_du_pipeline_setup_inputs()
460 __func__, BRX_NAME(pipe->brx)); in vsp1_du_pipeline_setup_inputs()
462 /* If the DRM pipe does not have a UIF there is nothing we can update. */ in vsp1_du_pipeline_setup_inputs()
467 * If the UIF is not in use schedule it for removal by setting its pipe in vsp1_du_pipeline_setup_inputs()
474 drm_pipe->uif->pipe = NULL; in vsp1_du_pipeline_setup_inputs()
475 } else if (!drm_pipe->uif->pipe) { in vsp1_du_pipeline_setup_inputs()
476 drm_pipe->uif->pipe = pipe; in vsp1_du_pipeline_setup_inputs()
477 list_add_tail(&drm_pipe->uif->list_pipe, &pipe->entities); in vsp1_du_pipeline_setup_inputs()
485 struct vsp1_pipeline *pipe) in vsp1_du_pipeline_setup_output() argument
487 struct vsp1_drm_pipeline *drm_pipe = to_vsp1_drm_pipeline(pipe); in vsp1_du_pipeline_setup_output()
499 ret = v4l2_subdev_call(&pipe->output->entity.subdev, pad, set_fmt, NULL, in vsp1_du_pipeline_setup_output()
506 format.format.code, pipe->output->entity.index); in vsp1_du_pipeline_setup_output()
509 ret = v4l2_subdev_call(&pipe->output->entity.subdev, pad, get_fmt, NULL, in vsp1_du_pipeline_setup_output()
516 format.format.code, pipe->output->entity.index); in vsp1_du_pipeline_setup_output()
519 ret = v4l2_subdev_call(&pipe->lif->subdev, pad, set_fmt, NULL, in vsp1_du_pipeline_setup_output()
526 format.format.code, pipe->lif->index); in vsp1_du_pipeline_setup_output()
536 pipe->lif->index); in vsp1_du_pipeline_setup_output()
544 static void vsp1_du_pipeline_configure(struct vsp1_pipeline *pipe) in vsp1_du_pipeline_configure() argument
546 struct vsp1_drm_pipeline *drm_pipe = to_vsp1_drm_pipeline(pipe); in vsp1_du_pipeline_configure()
553 vsp1_pipeline_calculate_partition(pipe, &pipe->part_table[0], in vsp1_du_pipeline_configure()
558 if (pipe->output->writeback) in vsp1_du_pipeline_configure()
561 dl = vsp1_dl_list_get(pipe->output->dlm); in vsp1_du_pipeline_configure()
564 list_for_each_entry_safe(entity, next, &pipe->entities, list_pipe) { in vsp1_du_pipeline_configure()
566 if (!entity->pipe) { in vsp1_du_pipeline_configure()
576 vsp1_entity_route_setup(entity, pipe, dlb); in vsp1_du_pipeline_configure()
577 vsp1_entity_configure_stream(entity, entity->state, pipe, in vsp1_du_pipeline_configure()
579 vsp1_entity_configure_frame(entity, pipe, dl, dlb); in vsp1_du_pipeline_configure()
580 vsp1_entity_configure_partition(entity, pipe, in vsp1_du_pipeline_configure()
581 &pipe->part_table[0], dl, dlb); in vsp1_du_pipeline_configure()
658 struct vsp1_pipeline *pipe; in vsp1_du_setup_lif() local
666 drm_pipe = &vsp1->drm->pipe[pipe_index]; in vsp1_du_setup_lif()
667 pipe = &drm_pipe->pipe; in vsp1_du_setup_lif()
674 brx = to_brx(&pipe->brx->subdev); in vsp1_du_setup_lif()
680 ret = vsp1_pipeline_stop(pipe); in vsp1_du_setup_lif()
684 for (i = 0; i < ARRAY_SIZE(pipe->inputs); ++i) { in vsp1_du_setup_lif()
685 struct vsp1_rwpf *rpf = pipe->inputs[i]; in vsp1_du_setup_lif()
691 * Remove the RPF from the pipe and the list of BRx in vsp1_du_setup_lif()
694 WARN_ON(!rpf->entity.pipe); in vsp1_du_setup_lif()
695 rpf->entity.pipe = NULL; in vsp1_du_setup_lif()
697 pipe->inputs[i] = NULL; in vsp1_du_setup_lif()
703 pipe->num_inputs = 0; in vsp1_du_setup_lif()
705 dev_dbg(vsp1->dev, "%s: pipe %u: releasing %s\n", in vsp1_du_setup_lif()
706 __func__, pipe->lif->index, in vsp1_du_setup_lif()
707 BRX_NAME(pipe->brx)); in vsp1_du_setup_lif()
709 list_del(&pipe->brx->list_pipe); in vsp1_du_setup_lif()
710 pipe->brx->pipe = NULL; in vsp1_du_setup_lif()
711 pipe->brx = NULL; in vsp1_du_setup_lif()
715 vsp1_dlm_reset(pipe->output->dlm); in vsp1_du_setup_lif()
724 pipe->underrun_count = 0; in vsp1_du_setup_lif()
728 pipe->interlaced = cfg->interlaced; in vsp1_du_setup_lif()
732 pipe->interlaced ? "i" : ""); in vsp1_du_setup_lif()
737 ret = vsp1_du_pipeline_setup_inputs(vsp1, pipe); in vsp1_du_setup_lif()
741 ret = vsp1_du_pipeline_setup_output(vsp1, pipe); in vsp1_du_setup_lif()
745 vsp1_pipeline_dump(pipe, "LIF setup"); in vsp1_du_setup_lif()
764 vsp1_du_pipeline_configure(pipe); in vsp1_du_setup_lif()
773 spin_lock_irqsave(&pipe->irqlock, flags); in vsp1_du_setup_lif()
774 vsp1_pipeline_run(pipe); in vsp1_du_setup_lif()
775 spin_unlock_irqrestore(&pipe->irqlock, flags); in vsp1_du_setup_lif()
828 struct vsp1_drm_pipeline *drm_pipe = &vsp1->drm->pipe[pipe_index]; in vsp1_du_atomic_update()
846 rpf->entity.pipe = NULL; in vsp1_du_atomic_update()
847 drm_pipe->pipe.inputs[rpf_index] = NULL; in vsp1_du_atomic_update()
880 drm_pipe->pipe.inputs[rpf_index] = rpf; in vsp1_du_atomic_update()
890 * @cfg: atomic pipe configuration
896 struct vsp1_drm_pipeline *drm_pipe = &vsp1->drm->pipe[pipe_index]; in vsp1_du_atomic_flush()
897 struct vsp1_pipeline *pipe = &drm_pipe->pipe; in vsp1_du_atomic_flush() local
907 ret = vsp1_du_pipeline_set_rwpf_format(vsp1, pipe->output, in vsp1_du_atomic_flush()
913 pipe->output->mem.addr[0] = wb_cfg->mem[0]; in vsp1_du_atomic_flush()
914 pipe->output->mem.addr[1] = wb_cfg->mem[1]; in vsp1_du_atomic_flush()
915 pipe->output->mem.addr[2] = wb_cfg->mem[2]; in vsp1_du_atomic_flush()
916 pipe->output->writeback = true; in vsp1_du_atomic_flush()
919 vsp1_du_pipeline_setup_inputs(vsp1, pipe); in vsp1_du_atomic_flush()
921 vsp1_pipeline_dump(pipe, "atomic update"); in vsp1_du_atomic_flush()
923 vsp1_du_pipeline_configure(pipe); in vsp1_du_atomic_flush()
969 struct vsp1_drm_pipeline *drm_pipe = &vsp1->drm->pipe[i]; in vsp1_drm_init()
970 struct vsp1_pipeline *pipe = &drm_pipe->pipe; in vsp1_drm_init() local
974 vsp1_pipeline_init(pipe); in vsp1_drm_init()
976 pipe->partitions = 1; in vsp1_drm_init()
977 pipe->part_table = &drm_pipe->partition; in vsp1_drm_init()
979 pipe->frame_end = vsp1_du_pipeline_frame_end; in vsp1_drm_init()
985 pipe->output = vsp1->wpf[i]; in vsp1_drm_init()
986 pipe->lif = &vsp1->lif[i]->entity; in vsp1_drm_init()
988 pipe->output->entity.pipe = pipe; in vsp1_drm_init()
989 pipe->output->entity.sink = pipe->lif; in vsp1_drm_init()
990 pipe->output->entity.sink_pad = 0; in vsp1_drm_init()
991 list_add_tail(&pipe->output->entity.list_pipe, &pipe->entities); in vsp1_drm_init()
993 pipe->lif->pipe = pipe; in vsp1_drm_init()
994 list_add_tail(&pipe->lif->list_pipe, &pipe->entities); in vsp1_drm_init()