Lines Matching refs:entity

3  * Media entity
28 * @MEDIA_GRAPH_ENTITY: Identify a media entity
70 * @bmap: Bit map in which each bit represents one entity at struct
85 * @stack.entity: pointer to &struct media_entity at the graph.
92 struct media_entity *entity;
145 * @ent_enum: The entity enumeration tracker
157 * @list: Linked list associated with an entity or an interface that
169 * @entity: Part of a union. Used only if the second object (gobj1) is
170 * an entity.
187 struct media_entity *entity;
226 * @entity: Entity this pad belongs to
227 * @index: Pad index in the entity pads array, numbered from 0 to n
238 struct media_entity *entity;
252 * struct media_entity_operations - Media entity operations
256 * @link_setup: Notify the entity of link changes. The operation can
259 * @link_validate: Return whether a link is valid from the entity point of
262 * @has_pad_interdep: Return whether two pads of the entity are
279 int (*get_fwnode_pad)(struct media_entity *entity,
281 int (*link_setup)(struct media_entity *entity,
285 bool (*has_pad_interdep)(struct media_entity *entity, unsigned int pad0,
290 * enum media_entity_type - Media entity type
293 * The entity isn't embedded in another subsystem structure.
295 * The entity is embedded in a struct video_device instance.
297 * The entity is embedded in a struct v4l2_subdev instance.
299 * Media entity objects are often not instantiated directly, but the media
300 * entity structure is inherited by (through embedding) other subsystem-specific
301 * structures. The media entity type identifies the type of the subclass
302 * structure that implements a media entity instance.
305 * the correct object type. For instance, a media entity structure instance
317 * struct media_entity - A media entity graph object.
331 * @internal_idx: An unique internal entity specific number. The numbers are
336 * @use_count: Use count for the entity.
377 * media_entity_for_each_pad - Iterate on all pads in an entity
378 * @entity: The entity the pads belong to
381 * Iterate on all pads in a media entity.
383 #define media_entity_for_each_pad(entity, iter) \
384 for (iter = (entity)->pads; \
385 iter < &(entity)->pads[(entity)->num_pads]; \
427 * media_entity_id() - return the media entity graph object id
429 * @entity: pointer to &media_entity
431 static inline u32 media_entity_id(struct media_entity *entity)
433 return entity->graph_obj.id;
473 * is_media_entity_v4l2_video_device() - Check if the entity is a video_device
474 * @entity: pointer to entity
476 * Return: %true if the entity is an instance of a video_device object and can
480 static inline bool is_media_entity_v4l2_video_device(struct media_entity *entity)
482 return entity && entity->obj_type == MEDIA_ENTITY_TYPE_VIDEO_DEVICE;
486 * is_media_entity_v4l2_subdev() - Check if the entity is a v4l2_subdev
487 * @entity: pointer to entity
489 * Return: %true if the entity is an instance of a &v4l2_subdev object and can
493 static inline bool is_media_entity_v4l2_subdev(struct media_entity *entity)
495 return entity && entity->obj_type == MEDIA_ENTITY_TYPE_V4L2_SUBDEV;
499 * media_entity_enum_init - Initialise an entity enumeration
510 * media_entity_enum_cleanup - Release resources of an entity enumeration
527 * media_entity_enum_set - Mark a single entity in the enum
530 * @entity: Entity to be marked
533 struct media_entity *entity)
535 if (WARN_ON(entity->internal_idx >= ent_enum->idx_max))
538 __set_bit(entity->internal_idx, ent_enum->bmap);
542 * media_entity_enum_clear - Unmark a single entity in the enum
545 * @entity: Entity to be unmarked
548 struct media_entity *entity)
550 if (WARN_ON(entity->internal_idx >= ent_enum->idx_max))
553 __clear_bit(entity->internal_idx, ent_enum->bmap);
557 * media_entity_enum_test - Test whether the entity is marked
560 * @entity: Entity to be tested
562 * Returns %true if the entity was marked.
565 struct media_entity *entity)
567 if (WARN_ON(entity->internal_idx >= ent_enum->idx_max))
570 return test_bit(entity->internal_idx, ent_enum->bmap);
574 * media_entity_enum_test_and_set - Test whether the entity is marked,
578 * @entity: Entity to be tested
580 * Returns %true if the entity was marked, and mark it before doing so.
584 struct media_entity *entity)
586 if (WARN_ON(entity->internal_idx >= ent_enum->idx_max))
589 return __test_and_set_bit(entity->internal_idx, ent_enum->bmap);
597 * Return: %true if the entity was empty.
607 * @ent_enum1: First entity enumeration
608 * @ent_enum2: Second entity enumeration
610 * Return: %true if entity enumerations @ent_enum1 and @ent_enum2 intersect,
677 * function calls are used. However, if the object (entity, link, pad,
696 * media_entity_pads_init() - Initialize the entity pads
698 * @entity: entity where the pads belong
702 * The pads array is managed by the entity driver and passed to
711 * dynamically but is managed by the entity driver. Most drivers will embed the
717 int media_entity_pads_init(struct media_entity *entity, u16 num_pads,
721 * media_entity_cleanup() - free resources associated with an entity
723 * @entity: entity where the pads belong
726 * the entity (currently, it does nothing).
733 static inline void media_entity_cleanup(struct media_entity *entity) {}
735 #define media_entity_cleanup(entity) do { } while (false)
739 * media_get_pad_index() - retrieves a pad index from an entity
741 * @entity: entity where the pads belong
745 * This helper function finds the first pad index inside an entity that
751 * entity is a NULL pointer, return -EINVAL.
753 int media_get_pad_index(struct media_entity *entity, u32 pad_type,
841 void __media_entity_remove_links(struct media_entity *entity);
844 * media_entity_remove_links() - remove all links associated with an entity
846 * @entity: pointer to &media_entity
850 * This is called automatically when an entity is unregistered via
853 void media_entity_remove_links(struct media_entity *entity);
884 * link_setup call is made on the first entity to restore the original link
905 * on media_create_intf_link(), for interface to entity links.
951 * media_entity_remote_pad_unique - Find a remote pad connected to an entity
952 * @entity: The entity
955 * Search for and return a remote pad of @type connected to @entity through an
969 media_entity_remote_pad_unique(const struct media_entity *entity,
974 * an entity
975 * @entity: The entity
977 * Search for and return a remote source pad connected to @entity through an
991 media_entity_remote_source_pad_unique(const struct media_entity *entity)
993 return media_entity_remote_pad_unique(entity, MEDIA_PAD_FL_SOURCE);
1009 * media_entity_is_streaming - Test if an entity is part of a streaming pipeline
1010 * @entity: The entity
1012 * Return: True if the entity is part of a pipeline started with the
1015 static inline bool media_entity_is_streaming(const struct media_entity *entity)
1019 media_entity_for_each_pad(entity, pad) {
1028 * media_entity_pipeline - Get the media pipeline an entity is part of
1029 * @entity: The entity
1033 * This function returns the media pipeline that an entity has been associated
1042 * Return: The media_pipeline the entity is part of, or NULL if the entity is
1045 struct media_pipeline *media_entity_pipeline(struct media_entity *entity);
1063 * @entity: The entity
1073 * If the entity does not implement the get_fwnode_pad() operation
1074 * then this function searches the entity for the first pad that
1079 int media_entity_get_fwnode_pad(struct media_entity *entity,
1110 * given entity
1113 * @entity: Starting entity
1120 * entities graph starting at the given entity. The traversal
1126 struct media_entity *entity);
1129 * media_graph_walk_next - Get the next entity in the graph
1139 * Return: returns the next entity in the graph or %NULL if the whole graph
1215 * media_pipeline_entity_iter_init - Initialize a pipeline entity iterator
1233 * media_pipeline_entity_iter_cleanup - Destroy a pipeline entity iterator
1244 struct media_entity *entity);
1250 * @entity: The iterator entity
1259 #define media_pipeline_for_each_entity(pipe, iter, entity) \
1260 for (entity = __media_pipeline_entity_iter_next((pipe), iter, NULL); \
1261 entity != NULL; \
1262 entity = __media_pipeline_entity_iter_next((pipe), iter, entity))
1312 * media_create_intf_link() - creates a link between an entity and an interface
1314 * @entity: pointer to %media_entity
1324 * Indicates that the interface is connected to the entity hardware.
1341 __must_check media_create_intf_link(struct media_entity *entity,
1378 * #) This is called automatically when an entity is unregistered via
1387 * an entity
1389 * @entity: entity where the @operation will be called
1394 * it will issue a call to @operation\(@entity, @args\).
1397 #define media_entity_call(entity, operation, args...) \
1398 (((entity)->ops && (entity)->ops->operation) ? \
1399 (entity)->ops->operation((entity) , ##args) : -ENOIOCTLCMD)
1423 * @entity: pointer to the &media_entity
1427 * Return the next link against an entity matching a specific link type. This
1428 * allows iteration through an entity's links whilst guaranteeing all of the
1431 struct media_link *__media_entity_next_link(struct media_entity *entity,
1436 * for_each_media_entity_data_link() - Iterate through an entity's data links
1438 * @entity: pointer to the &media_entity
1443 #define for_each_media_entity_data_link(entity, link) \
1444 for (link = __media_entity_next_link(entity, NULL, \
1447 link = __media_entity_next_link(entity, link, \