Lines Matching defs:entity
13 #include <media/media-entity.h>
23 void vsp1_entity_route_setup(struct vsp1_entity *entity,
30 if (entity->type == VSP1_ENTITY_HGO) {
37 source = entity->sources[0];
38 smppt = (pipe->output->entity.index << VI6_DPR_SMPPT_TGW_SHIFT)
43 } else if (entity->type == VSP1_ENTITY_HGT) {
50 source = entity->sources[0];
51 smppt = (pipe->output->entity.index << VI6_DPR_SMPPT_TGW_SHIFT)
58 source = entity;
77 void vsp1_entity_configure_stream(struct vsp1_entity *entity,
83 if (entity->ops->configure_stream)
84 entity->ops->configure_stream(entity, state, pipe, dl, dlb);
87 void vsp1_entity_configure_frame(struct vsp1_entity *entity,
92 if (entity->ops->configure_frame)
93 entity->ops->configure_frame(entity, pipe, dl, dlb);
96 void vsp1_entity_configure_partition(struct vsp1_entity *entity,
102 if (entity->ops->configure_partition)
103 entity->ops->configure_partition(entity, pipe, partition,
126 * vsp1_entity_get_state - Get the subdev state for an entity
127 * @entity: the entity
132 * the entity lock to access the returned configuration.
136 * returned when requested. The ACTIVE state comes from the entity structure.
139 vsp1_entity_get_state(struct vsp1_entity *entity,
145 return entity->state;
165 struct vsp1_entity *entity = to_vsp1_entity(subdev);
168 state = vsp1_entity_get_state(entity, sd_state, fmt->which);
172 mutex_lock(&entity->lock);
174 mutex_unlock(&entity->lock);
197 struct vsp1_entity *entity = to_vsp1_entity(subdev);
209 * The entity can't perform format conversion, the sink format
215 state = vsp1_entity_get_state(entity, sd_state, code->which);
219 mutex_lock(&entity->lock);
222 mutex_unlock(&entity->lock);
249 struct vsp1_entity *entity = to_vsp1_entity(subdev);
254 state = vsp1_entity_get_state(entity, sd_state, fse->which);
260 mutex_lock(&entity->lock);
284 mutex_unlock(&entity->lock);
313 struct vsp1_entity *entity = to_vsp1_entity(subdev);
320 mutex_lock(&entity->lock);
322 state = vsp1_entity_get_state(entity, sd_state, fmt->which);
330 if (fmt->pad == entity->source_pad) {
362 format = v4l2_subdev_state_get_format(state, entity->source_pad);
379 mutex_unlock(&entity->lock);
389 for (pad = 0; pad < subdev->entity.num_pads - 1; ++pad) {
411 media_entity_to_vsp1_entity(struct media_entity *entity)
413 return container_of(entity, struct vsp1_entity, subdev.entity);
422 source = media_entity_to_vsp1_entity(source_pad->entity);
429 = media_entity_to_vsp1_entity(sink_pad->entity);
457 sink = media_entity_to_vsp1_entity(sink_pad->entity);
458 source = media_entity_to_vsp1_entity(source_pad->entity);
473 int vsp1_entity_link_setup(struct media_entity *entity,
504 list_for_each_entry(link, &pad->entity->links, list) {
505 struct vsp1_entity *entity;
518 if (!is_media_entity_v4l2_subdev(link->sink->entity))
521 entity = media_entity_to_vsp1_entity(link->sink->entity);
522 if (entity->type != VSP1_ENTITY_HGO &&
523 entity->type != VSP1_ENTITY_HGT)
590 int vsp1_entity_init(struct vsp1_device *vsp1, struct vsp1_entity *entity,
600 if (vsp1_routes[i].type == entity->type &&
601 vsp1_routes[i].index == entity->index) {
602 entity->route = &vsp1_routes[i];
610 mutex_init(&entity->lock);
612 entity->vsp1 = vsp1;
613 entity->source_pad = num_pads - 1;
616 entity->pads = devm_kcalloc(vsp1->dev,
617 num_pads, sizeof(*entity->pads),
619 if (entity->pads == NULL)
623 entity->pads[i].flags = MEDIA_PAD_FL_SINK;
625 entity->sources = devm_kcalloc(vsp1->dev, max(num_pads - 1, 1U),
626 sizeof(*entity->sources), GFP_KERNEL);
627 if (entity->sources == NULL)
631 entity->pads[num_pads - 1].flags = num_pads > 1 ? MEDIA_PAD_FL_SOURCE
634 /* Initialize the media entity. */
635 ret = media_entity_pads_init(&entity->subdev.entity, num_pads,
636 entity->pads);
641 subdev = &entity->subdev;
645 subdev->entity.function = function;
646 subdev->entity.ops = &vsp1->media_ops;
662 entity->state = __v4l2_subdev_state_alloc(&entity->subdev,
664 if (IS_ERR(entity->state)) {
665 media_entity_cleanup(&entity->subdev.entity);
666 return PTR_ERR(entity->state);
672 void vsp1_entity_destroy(struct vsp1_entity *entity)
674 if (entity->ops && entity->ops->destroy)
675 entity->ops->destroy(entity);
676 if (entity->subdev.ctrl_handler)
677 v4l2_ctrl_handler_free(entity->subdev.ctrl_handler);
678 __v4l2_subdev_state_free(entity->state);
679 media_entity_cleanup(&entity->subdev.entity);