Lines Matching +full:link +full:- +full:signal +full:- +full:sources

1 /* SPDX-License-Identifier: GPL-2.0-only */
26 * enum media_gobj_type - type of a graph object
30 * @MEDIA_GRAPH_LINK: Identify a media link
42 #define MEDIA_BITS_PER_ID (32 - MEDIA_BITS_PER_TYPE)
43 #define MEDIA_ID_MASK GENMASK_ULL(MEDIA_BITS_PER_ID - 1, 0)
48 * struct media_gobj - Define a graph object.
51 * @id: Non-zero object ID identifier. The ID should be unique
55 * @list: List entry stored in one of the per-type mdev object lists
68 * struct media_entity_enum - An enumeration of media entities.
71 * media_entity->internal_idx.
80 * struct media_graph - Media graph traversal state
86 * @stack.link: pointer to &struct list_head.
93 struct list_head *link; member
101 * struct media_pipeline - Media pipeline related information
106 * @start_count: Media pipeline start - stop count
116 * struct media_pipeline_pad - A pad part of a media pipeline
134 * struct media_link - A link object part of a media graph.
138 * owns the link.
140 * graph_object of the link.
146 * graph_object of the link.
151 * @reverse: Pointer to the link for the reverse direction of a pad to pad
152 * link.
153 * @flags: Link flags, as defined in uapi/media.h (MEDIA_LNK_FL_*)
154 * @is_backlink: Indicate if the link is a backlink.
175 * enum media_pad_signal_type - type of the signal inside a media pad
178 * Default signal. Use this when all inputs or all outputs are
181 * The pad contains an analog signal. It can be Radio Frequency,
182 * Intermediate Frequency, a baseband signal or sub-carriers.
183 * Tuner inputs, IF-PLL demodulators, composite and s-video signals
186 * Contains a digital video signal, with can be a bitstream of samples
190 * Contains an Intermediate Frequency analog signal from an audio
191 * sub-carrier or an audio bitstream. IF signals are provided by tuners
203 * struct media_pad - A media pad graph object.
208 * @sig_type: Type of the signal inside a media pad
230 * struct media_entity_operations - Media entity operations
234 * @link_setup: Notify the entity of link changes. The operation can
235 * return an error, in which case link setup will be
237 * @link_validate: Return whether a link is valid from the entity point of
245 * guaranteed to not both be sinks or sources.
260 int (*link_validate)(struct media_link *link);
266 * enum media_entity_type - Media entity type
276 * entity structure is inherited by (through embedding) other subsystem-specific
293 * struct media_entity - A media entity graph object.
308 * re-used if entities are unregistered or registered again.
357 * media_entity_for_each_pad - Iterate on all pads in an entity
364 for (iter = (entity)->pads; \
365 iter < &(entity)->pads[(entity)->num_pads]; \
369 * struct media_interface - A media interface graph object.
392 * struct media_intf_devnode - A media interface via a device node.
407 * media_entity_id() - return the media entity graph object id
413 return entity->graph_obj.id; in media_entity_id()
417 * media_type() - return the media object type
423 return gobj->id >> MEDIA_BITS_PER_ID; in media_type()
427 * media_id() - return the media object ID
433 return gobj->id & MEDIA_ID_MASK; in media_id()
437 * media_gobj_gen_id() - encapsulates type and ID on at the object ID
453 * is_media_entity_v4l2_video_device() - Check if the entity is a video_device
462 return entity && entity->obj_type == MEDIA_ENTITY_TYPE_VIDEO_DEVICE; in is_media_entity_v4l2_video_device()
466 * is_media_entity_v4l2_subdev() - Check if the entity is a v4l2_subdev
475 return entity && entity->obj_type == MEDIA_ENTITY_TYPE_V4L2_SUBDEV; in is_media_entity_v4l2_subdev()
479 * media_entity_enum_init - Initialise an entity enumeration
490 * media_entity_enum_cleanup - Release resources of an entity enumeration
497 * media_entity_enum_zero - Clear the entire enum
503 bitmap_zero(ent_enum->bmap, ent_enum->idx_max); in media_entity_enum_zero()
507 * media_entity_enum_set - Mark a single entity in the enum
515 if (WARN_ON(entity->internal_idx >= ent_enum->idx_max)) in media_entity_enum_set()
518 __set_bit(entity->internal_idx, ent_enum->bmap); in media_entity_enum_set()
522 * media_entity_enum_clear - Unmark a single entity in the enum
530 if (WARN_ON(entity->internal_idx >= ent_enum->idx_max)) in media_entity_enum_clear()
533 __clear_bit(entity->internal_idx, ent_enum->bmap); in media_entity_enum_clear()
537 * media_entity_enum_test - Test whether the entity is marked
547 if (WARN_ON(entity->internal_idx >= ent_enum->idx_max)) in media_entity_enum_test()
550 return test_bit(entity->internal_idx, ent_enum->bmap); in media_entity_enum_test()
554 * media_entity_enum_test_and_set - Test whether the entity is marked,
566 if (WARN_ON(entity->internal_idx >= ent_enum->idx_max)) in media_entity_enum_test_and_set()
569 return __test_and_set_bit(entity->internal_idx, ent_enum->bmap); in media_entity_enum_test_and_set()
573 * media_entity_enum_empty - Test whether the entire enum is empty
581 return bitmap_empty(ent_enum->bmap, ent_enum->idx_max); in media_entity_enum_empty()
585 * media_entity_enum_intersects - Test whether two enums intersect
597 WARN_ON(ent_enum1->idx_max != ent_enum2->idx_max); in media_entity_enum_intersects()
599 return bitmap_intersects(ent_enum1->bmap, ent_enum2->bmap, in media_entity_enum_intersects()
600 min(ent_enum1->idx_max, ent_enum2->idx_max)); in media_entity_enum_intersects()
604 * gobj_to_entity - returns the struct &media_entity pointer from the
613 * gobj_to_pad - returns the struct &media_pad pointer from the
622 * gobj_to_link - returns the struct &media_link pointer from the
631 * gobj_to_intf - returns the struct &media_interface pointer from the
640 * intf_to_devnode - returns the struct media_intf_devnode pointer from the
649 * media_gobj_create - Initialize a graph object
657 * function calls are used. However, if the object (entity, link, pad,
666 * media_gobj_destroy - Stop using a graph object on a media device
676 * media_entity_pads_init() - Initialize the entity pads
687 * &media_entity->num_pads with 0 and &media_entity->pads with %NULL or call
692 * pads array in a driver-specific structure, avoiding dynamic allocation.
701 * media_entity_cleanup() - free resources associated with an entity
710 * valid and is a no-op.
719 * media_get_pad_index() - retrieves a pad index from an entity
723 * @sig_type: type of signal of the pad to be search
731 * entity is a NULL pointer, return -EINVAL.
737 * media_create_pad_link() - creates a link between two entities.
743 * @flags: Link flags, as defined in
750 * Indicates that the link is enabled and can be used to transfer media data.
755 * Indicates that the link enabled state can't be modified at runtime. If
757 * set, since an immutable link is always enabled.
769 * media_create_pad_links() - creates a link between two entities.
781 * @flags: Link flags, as defined in include/uapi/linux/media.h.
785 * If %false, it will return 0 and won't create any link if both @source
790 * A %MEDIA_LNK_FL_ENABLED flag indicates that the link is enabled and can be
792 * flag is passed as an argument, only the first created link will have
795 * A %MEDIA_LNK_FL_IMMUTABLE flag indicates that the link enabled state can't
797 * %MEDIA_LNK_FL_ENABLED must also be set since an immutable link is
802 * creates link by link, this function is meant to allow 1:n, n:1 and even
803 * cross-bar (n:n) links.
824 * media_entity_remove_links() - remove all links associated with an entity
836 * __media_entity_setup_link - Configure a media link without locking
837 * @link: The link being configured
838 * @flags: Link configuration flags
840 * The bulk of link setup is handled by the two entities connected through the
841 * link. This function notifies both entities of the link configuration change.
843 * If the link is immutable or if the current and new configuration are
846 * The user is expected to hold link->source->parent->mutex. If not,
849 int __media_entity_setup_link(struct media_link *link, u32 flags);
852 * media_entity_setup_link() - changes the link flags properties in runtime
854 * @link: pointer to &media_link
855 * @flags: the requested new link flags
857 * The only configurable property is the %MEDIA_LNK_FL_ENABLED link flag
858 * to enable/disable a link. Links marked with the
859 * %MEDIA_LNK_FL_IMMUTABLE link flag can not be enabled or disabled.
861 * When a link is enabled or disabled, the media framework calls the
863 * link, in that order. If the second link_setup call fails, another
864 * link_setup call is made on the first entity to restore the original link
867 * Media device drivers can be notified of link setup operations by setting the
873 * is non-immutable. The operation must either configure the hardware or store
876 * Link configuration must not have any side effect on other links. If an
877 * enabled link at a sink pad prevents another link at the same pad from
878 * being enabled, the link_setup operation must return %-EBUSY and can't
879 * implicitly disable the first enabled link.
883 * The valid values of the flags for the link is the same as described
887 int media_entity_setup_link(struct media_link *link, u32 flags);
890 * media_entity_find_link - Find a link between two pads
894 * Return: returns a pointer to the link between the two entities. If no
895 * such link exists, return %NULL.
901 * media_pad_remote_pad_first - Find the first pad at the remote end of a link
902 * @pad: Pad at the local end of the link
905 * links originating or terminating at that pad until an enabled link is found.
908 * enabled link, or %NULL if no enabled link has been found.
913 * media_pad_remote_pad_unique - Find a remote pad connected to a pad
917 * link. If multiple (or no) remote pads are found, an error is returned.
925 * * -ENOTUNIQ - Multiple links are enabled
926 * * -ENOLINK - No connected pad found
931 * media_entity_remote_pad_unique - Find a remote pad connected to an entity
936 * enabled link. If multiple (or no) remote pads match these criteria, an error
945 * * -ENOTUNIQ - Multiple links are enabled
946 * * -ENOLINK - No connected pad found
953 * media_entity_remote_source_pad_unique - Find a remote source pad connected to
958 * enabled link. If multiple (or no) remote pads match these criteria, an error
967 * * -ENOTUNIQ - Multiple links are enabled
968 * * -ENOLINK - No connected pad found
977 * media_pad_is_streaming - Test if a pad is part of a streaming pipeline
985 return pad->pipe; in media_pad_is_streaming()
989 * media_entity_is_streaming - Test if an entity is part of a streaming pipeline
1008 * media_entity_pipeline - Get the media pipeline an entity is part of
1028 * media_pad_pipeline - Get the media pipeline a pad is part of
1041 * media_entity_get_fwnode_pad - Get pad number from fwnode
1064 * media_graph_walk_init - Allocate resources used by graph walk.
1078 * media_graph_walk_cleanup - Release resources used by graph walk.
1085 * media_graph_walk_start - Start walking the media graph at a
1103 * media_graph_walk_next - Get the next entity in the graph
1106 * Perform a depth-first traversal of the given media entities graph.
1117 * media_pipeline_start - Mark a pipeline as streaming
1133 * __media_pipeline_start - Mark a pipeline as streaming
1138 * ..note:: This is the non-locking version of media_pipeline_start()
1144 * media_pipeline_stop - Mark a pipeline as not streaming
1158 * __media_pipeline_stop - Mark a pipeline as not streaming
1162 * .. note:: This is the non-locking version of media_pipeline_stop()
1167 * media_pipeline_alloc_start - Mark a pipeline as streaming
1180 * media_devnode_create() - creates and initializes a device node interface
1204 * media_devnode_remove() - removes a device node interface
1214 * media_create_intf_link() - creates a link between an entity and an interface
1218 * @flags: Link flags, as defined in
1240 * interface that will be part of the link.
1247 * __media_remove_intf_link() - remove a single interface link
1249 * @link: pointer to &media_link.
1253 void __media_remove_intf_link(struct media_link *link);
1256 * media_remove_intf_link() - remove a single interface link
1258 * @link: pointer to &media_link.
1262 void media_remove_intf_link(struct media_link *link);
1265 * __media_remove_intf_links() - remove all links associated with an interface
1274 * media_remove_intf_links() - remove all links associated with an interface
1288 * media_entity_call - Calls a struct media_entity_operations operation on
1300 (((entity)->ops && (entity)->ops->operation) ? \
1301 (entity)->ops->operation((entity) , ##args) : -ENOIOCTLCMD)
1304 * media_create_ancillary_link() - create an ancillary link between two
1310 * Create an ancillary link between two entities, indicating that they
1316 * the new link.
1323 * __media_entity_next_link() - Iterate through a &media_entity's links
1326 * @link: pointer to a &media_link to hold the iterated values
1329 * Return the next link against an entity matching a specific link type. This
1334 struct media_link *link,
1338 * for_each_media_entity_data_link() - Iterate through an entity's data links
1341 * @link: pointer to a &media_link to hold the iterated values
1345 #define for_each_media_entity_data_link(entity, link) \ argument
1346 for (link = __media_entity_next_link(entity, NULL, \
1348 link; \
1349 link = __media_entity_next_link(entity, link, \