Lines Matching refs:entity
23 void vsp1_entity_route_setup(struct vsp1_entity *entity, in vsp1_entity_route_setup() argument
30 if (entity->type == VSP1_ENTITY_HGO) { in vsp1_entity_route_setup()
37 source = entity->sources[0]; in vsp1_entity_route_setup()
38 smppt = (pipe->output->entity.index << VI6_DPR_SMPPT_TGW_SHIFT) in vsp1_entity_route_setup()
43 } else if (entity->type == VSP1_ENTITY_HGT) { in vsp1_entity_route_setup()
50 source = entity->sources[0]; in vsp1_entity_route_setup()
51 smppt = (pipe->output->entity.index << VI6_DPR_SMPPT_TGW_SHIFT) in vsp1_entity_route_setup()
58 source = entity; in vsp1_entity_route_setup()
72 void vsp1_entity_configure_stream(struct vsp1_entity *entity, in vsp1_entity_configure_stream() argument
76 if (entity->ops->configure_stream) in vsp1_entity_configure_stream()
77 entity->ops->configure_stream(entity, pipe, dlb); in vsp1_entity_configure_stream()
80 void vsp1_entity_configure_frame(struct vsp1_entity *entity, in vsp1_entity_configure_frame() argument
85 if (entity->ops->configure_frame) in vsp1_entity_configure_frame()
86 entity->ops->configure_frame(entity, pipe, dl, dlb); in vsp1_entity_configure_frame()
89 void vsp1_entity_configure_partition(struct vsp1_entity *entity, in vsp1_entity_configure_partition() argument
94 if (entity->ops->configure_partition) in vsp1_entity_configure_partition()
95 entity->ops->configure_partition(entity, pipe, dl, dlb); in vsp1_entity_configure_partition()
117 vsp1_entity_get_pad_config(struct vsp1_entity *entity, in vsp1_entity_get_pad_config() argument
123 return entity->config; in vsp1_entity_get_pad_config()
140 vsp1_entity_get_pad_format(struct vsp1_entity *entity, in vsp1_entity_get_pad_format() argument
144 return v4l2_subdev_get_try_format(&entity->subdev, cfg, pad); in vsp1_entity_get_pad_format()
159 vsp1_entity_get_pad_selection(struct vsp1_entity *entity, in vsp1_entity_get_pad_selection() argument
165 return v4l2_subdev_get_try_compose(&entity->subdev, cfg, pad); in vsp1_entity_get_pad_selection()
167 return v4l2_subdev_get_try_crop(&entity->subdev, cfg, pad); in vsp1_entity_get_pad_selection()
187 for (pad = 0; pad < subdev->entity.num_pads - 1; ++pad) { in vsp1_entity_init_cfg()
213 struct vsp1_entity *entity = to_vsp1_entity(subdev); in vsp1_subdev_get_pad_format() local
216 config = vsp1_entity_get_pad_config(entity, cfg, fmt->which); in vsp1_subdev_get_pad_format()
220 mutex_lock(&entity->lock); in vsp1_subdev_get_pad_format()
221 fmt->format = *vsp1_entity_get_pad_format(entity, config, fmt->pad); in vsp1_subdev_get_pad_format()
222 mutex_unlock(&entity->lock); in vsp1_subdev_get_pad_format()
245 struct vsp1_entity *entity = to_vsp1_entity(subdev); in vsp1_subdev_enum_mbus_code() local
263 config = vsp1_entity_get_pad_config(entity, cfg, code->which); in vsp1_subdev_enum_mbus_code()
267 mutex_lock(&entity->lock); in vsp1_subdev_enum_mbus_code()
268 format = vsp1_entity_get_pad_format(entity, config, 0); in vsp1_subdev_enum_mbus_code()
270 mutex_unlock(&entity->lock); in vsp1_subdev_enum_mbus_code()
297 struct vsp1_entity *entity = to_vsp1_entity(subdev); in vsp1_subdev_enum_frame_size() local
302 config = vsp1_entity_get_pad_config(entity, cfg, fse->which); in vsp1_subdev_enum_frame_size()
306 format = vsp1_entity_get_pad_format(entity, config, fse->pad); in vsp1_subdev_enum_frame_size()
308 mutex_lock(&entity->lock); in vsp1_subdev_enum_frame_size()
332 mutex_unlock(&entity->lock); in vsp1_subdev_enum_frame_size()
361 struct vsp1_entity *entity = to_vsp1_entity(subdev); in vsp1_subdev_set_pad_format() local
368 mutex_lock(&entity->lock); in vsp1_subdev_set_pad_format()
370 config = vsp1_entity_get_pad_config(entity, cfg, fmt->which); in vsp1_subdev_set_pad_format()
376 format = vsp1_entity_get_pad_format(entity, config, fmt->pad); in vsp1_subdev_set_pad_format()
378 if (fmt->pad == entity->source_pad) { in vsp1_subdev_set_pad_format()
404 format = vsp1_entity_get_pad_format(entity, config, entity->source_pad); in vsp1_subdev_set_pad_format()
408 selection = vsp1_entity_get_pad_selection(entity, config, fmt->pad, in vsp1_subdev_set_pad_format()
415 selection = vsp1_entity_get_pad_selection(entity, config, fmt->pad, in vsp1_subdev_set_pad_format()
423 mutex_unlock(&entity->lock); in vsp1_subdev_set_pad_format()
432 media_entity_to_vsp1_entity(struct media_entity *entity) in media_entity_to_vsp1_entity() argument
434 return container_of(entity, struct vsp1_entity, subdev.entity); in media_entity_to_vsp1_entity()
443 source = media_entity_to_vsp1_entity(source_pad->entity); in vsp1_entity_link_setup_source()
450 = media_entity_to_vsp1_entity(sink_pad->entity); in vsp1_entity_link_setup_source()
478 sink = media_entity_to_vsp1_entity(sink_pad->entity); in vsp1_entity_link_setup_sink()
479 source = media_entity_to_vsp1_entity(source_pad->entity); in vsp1_entity_link_setup_sink()
494 int vsp1_entity_link_setup(struct media_entity *entity, in vsp1_entity_link_setup() argument
525 list_for_each_entry(link, &pad->entity->links, list) { in vsp1_entity_remote_pad()
526 struct vsp1_entity *entity; in vsp1_entity_remote_pad() local
539 if (!is_media_entity_v4l2_subdev(link->sink->entity)) in vsp1_entity_remote_pad()
542 entity = media_entity_to_vsp1_entity(link->sink->entity); in vsp1_entity_remote_pad()
543 if (entity->type != VSP1_ENTITY_HGO && in vsp1_entity_remote_pad()
544 entity->type != VSP1_ENTITY_HGT) in vsp1_entity_remote_pad()
608 int vsp1_entity_init(struct vsp1_device *vsp1, struct vsp1_entity *entity, in vsp1_entity_init() argument
617 if (vsp1_routes[i].type == entity->type && in vsp1_entity_init()
618 vsp1_routes[i].index == entity->index) { in vsp1_entity_init()
619 entity->route = &vsp1_routes[i]; in vsp1_entity_init()
627 mutex_init(&entity->lock); in vsp1_entity_init()
629 entity->vsp1 = vsp1; in vsp1_entity_init()
630 entity->source_pad = num_pads - 1; in vsp1_entity_init()
633 entity->pads = devm_kcalloc(vsp1->dev, in vsp1_entity_init()
634 num_pads, sizeof(*entity->pads), in vsp1_entity_init()
636 if (entity->pads == NULL) in vsp1_entity_init()
640 entity->pads[i].flags = MEDIA_PAD_FL_SINK; in vsp1_entity_init()
642 entity->sources = devm_kcalloc(vsp1->dev, max(num_pads - 1, 1U), in vsp1_entity_init()
643 sizeof(*entity->sources), GFP_KERNEL); in vsp1_entity_init()
644 if (entity->sources == NULL) in vsp1_entity_init()
648 entity->pads[num_pads - 1].flags = num_pads > 1 ? MEDIA_PAD_FL_SOURCE in vsp1_entity_init()
652 ret = media_entity_pads_init(&entity->subdev.entity, num_pads, in vsp1_entity_init()
653 entity->pads); in vsp1_entity_init()
658 subdev = &entity->subdev; in vsp1_entity_init()
661 subdev->entity.function = function; in vsp1_entity_init()
662 subdev->entity.ops = &vsp1->media_ops; in vsp1_entity_init()
674 entity->config = v4l2_subdev_alloc_pad_config(&entity->subdev); in vsp1_entity_init()
675 if (entity->config == NULL) { in vsp1_entity_init()
676 media_entity_cleanup(&entity->subdev.entity); in vsp1_entity_init()
683 void vsp1_entity_destroy(struct vsp1_entity *entity) in vsp1_entity_destroy() argument
685 if (entity->ops && entity->ops->destroy) in vsp1_entity_destroy()
686 entity->ops->destroy(entity); in vsp1_entity_destroy()
687 if (entity->subdev.ctrl_handler) in vsp1_entity_destroy()
688 v4l2_ctrl_handler_free(entity->subdev.ctrl_handler); in vsp1_entity_destroy()
689 v4l2_subdev_free_pad_config(entity->config); in vsp1_entity_destroy()
690 media_entity_cleanup(&entity->subdev.entity); in vsp1_entity_destroy()