Lines Matching refs: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;
72 void vsp1_entity_configure_stream(struct vsp1_entity *entity,
77 if (entity->ops->configure_stream)
78 entity->ops->configure_stream(entity, pipe, dl, dlb);
81 void vsp1_entity_configure_frame(struct vsp1_entity *entity,
86 if (entity->ops->configure_frame)
87 entity->ops->configure_frame(entity, pipe, dl, dlb);
90 void vsp1_entity_configure_partition(struct vsp1_entity *entity,
95 if (entity->ops->configure_partition)
96 entity->ops->configure_partition(entity, pipe, dl, dlb);
104 * vsp1_entity_get_state - Get the subdev state for an entity
105 * @entity: the entity
110 * the entity lock to access the returned configuration.
114 * returned when requested. The ACTIVE state comes from the entity structure.
117 vsp1_entity_get_state(struct vsp1_entity *entity,
123 return entity->state;
131 * vsp1_entity_get_pad_format - Get a pad format from storage for an entity
132 * @entity: the entity
136 * Return the format stored in the given configuration for an entity's pad. The
140 vsp1_entity_get_pad_format(struct vsp1_entity *entity,
148 * vsp1_entity_get_pad_selection - Get a pad selection from storage for entity
149 * @entity: the entity
155 * entity's pad. The configuration can be an ACTIVE or TRY configuration. The
159 vsp1_entity_get_pad_selection(struct vsp1_entity *entity,
186 struct vsp1_entity *entity = to_vsp1_entity(subdev);
189 state = vsp1_entity_get_state(entity, sd_state, fmt->which);
193 mutex_lock(&entity->lock);
194 fmt->format = *vsp1_entity_get_pad_format(entity, state, fmt->pad);
195 mutex_unlock(&entity->lock);
218 struct vsp1_entity *entity = to_vsp1_entity(subdev);
230 * The entity can't perform format conversion, the sink format
236 state = vsp1_entity_get_state(entity, sd_state, code->which);
240 mutex_lock(&entity->lock);
241 format = vsp1_entity_get_pad_format(entity, state, 0);
243 mutex_unlock(&entity->lock);
270 struct vsp1_entity *entity = to_vsp1_entity(subdev);
275 state = vsp1_entity_get_state(entity, sd_state, fse->which);
279 format = vsp1_entity_get_pad_format(entity, state, fse->pad);
281 mutex_lock(&entity->lock);
305 mutex_unlock(&entity->lock);
334 struct vsp1_entity *entity = to_vsp1_entity(subdev);
341 mutex_lock(&entity->lock);
343 state = vsp1_entity_get_state(entity, sd_state, fmt->which);
349 format = vsp1_entity_get_pad_format(entity, state, fmt->pad);
351 if (fmt->pad == entity->source_pad) {
377 format = vsp1_entity_get_pad_format(entity, state, entity->source_pad);
381 selection = vsp1_entity_get_pad_selection(entity, state, fmt->pad,
388 selection = vsp1_entity_get_pad_selection(entity, state, fmt->pad,
396 mutex_unlock(&entity->lock);
406 for (pad = 0; pad < subdev->entity.num_pads - 1; ++pad) {
428 media_entity_to_vsp1_entity(struct media_entity *entity)
430 return container_of(entity, struct vsp1_entity, subdev.entity);
439 source = media_entity_to_vsp1_entity(source_pad->entity);
446 = media_entity_to_vsp1_entity(sink_pad->entity);
474 sink = media_entity_to_vsp1_entity(sink_pad->entity);
475 source = media_entity_to_vsp1_entity(source_pad->entity);
490 int vsp1_entity_link_setup(struct media_entity *entity,
521 list_for_each_entry(link, &pad->entity->links, list) {
522 struct vsp1_entity *entity;
535 if (!is_media_entity_v4l2_subdev(link->sink->entity))
538 entity = media_entity_to_vsp1_entity(link->sink->entity);
539 if (entity->type != VSP1_ENTITY_HGO &&
540 entity->type != VSP1_ENTITY_HGT)
604 int vsp1_entity_init(struct vsp1_device *vsp1, struct vsp1_entity *entity,
614 if (vsp1_routes[i].type == entity->type &&
615 vsp1_routes[i].index == entity->index) {
616 entity->route = &vsp1_routes[i];
624 mutex_init(&entity->lock);
626 entity->vsp1 = vsp1;
627 entity->source_pad = num_pads - 1;
630 entity->pads = devm_kcalloc(vsp1->dev,
631 num_pads, sizeof(*entity->pads),
633 if (entity->pads == NULL)
637 entity->pads[i].flags = MEDIA_PAD_FL_SINK;
639 entity->sources = devm_kcalloc(vsp1->dev, max(num_pads - 1, 1U),
640 sizeof(*entity->sources), GFP_KERNEL);
641 if (entity->sources == NULL)
645 entity->pads[num_pads - 1].flags = num_pads > 1 ? MEDIA_PAD_FL_SOURCE
648 /* Initialize the media entity. */
649 ret = media_entity_pads_init(&entity->subdev.entity, num_pads,
650 entity->pads);
655 subdev = &entity->subdev;
659 subdev->entity.function = function;
660 subdev->entity.ops = &vsp1->media_ops;
676 entity->state = __v4l2_subdev_state_alloc(&entity->subdev,
678 if (IS_ERR(entity->state)) {
679 media_entity_cleanup(&entity->subdev.entity);
680 return PTR_ERR(entity->state);
686 void vsp1_entity_destroy(struct vsp1_entity *entity)
688 if (entity->ops && entity->ops->destroy)
689 entity->ops->destroy(entity);
690 if (entity->subdev.ctrl_handler)
691 v4l2_ctrl_handler_free(entity->subdev.ctrl_handler);
692 __v4l2_subdev_state_free(entity->state);
693 media_entity_cleanup(&entity->subdev.entity);