Lines Matching +full:sink +full:- +full:only
1 /* SPDX-License-Identifier: GPL-2.0-only */
26 * enum media_gobj_type - type of a graph object
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
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_pipeline_pad_iter - Iterator for media_pipeline_for_each_pad
143 * struct media_pipeline_entity_iter - Iterator for media_pipeline_for_each_entity
154 * struct media_link - A link object part of a media graph.
161 * @source: Part of a union. Used only if the first object (gobj0) is
163 * @intf: Part of a union. Used only if the first object (gobj0) is
167 * @sink: Part of a union. Used only if the second object (gobj1) is
168 * a pad. In that case, it represents the sink pad.
169 * @entity: Part of a union. Used only if the second object (gobj1) is
186 struct media_pad *sink; member
195 * enum media_pad_signal_type - type of the signal inside a media pad
202 * Intermediate Frequency, a baseband signal or sub-carriers.
203 * Tuner inputs, IF-PLL demodulators, composite and s-video signals
211 * sub-carrier or an audio bitstream. IF signals are provided by tuners
223 * struct media_pad - A media pad graph object.
245 * The fields below are private, and should only be accessed via
252 * struct media_entity_operations - Media entity operations
290 * enum media_entity_type - Media entity type
300 * entity structure is inherited by (through embedding) other subsystem-specific
317 * struct media_entity - A media entity graph object.
328 * @num_pads: Number of sink and source pads.
332 * re-used if entities are unregistered or registered again.
377 * media_entity_for_each_pad - Iterate on all pads in an entity
384 for (iter = (entity)->pads; \
385 iter < &(entity)->pads[(entity)->num_pads]; \
389 * struct media_interface - A media interface graph object.
412 * struct media_intf_devnode - A media interface via a device node.
427 * media_entity_id() - return the media entity graph object id
433 return entity->graph_obj.id; in media_entity_id()
437 * media_type() - return the media object type
443 return gobj->id >> MEDIA_BITS_PER_ID; in media_type()
447 * media_id() - return the media object ID
453 return gobj->id & MEDIA_ID_MASK; in media_id()
457 * media_gobj_gen_id() - encapsulates type and ID on at the object ID
473 * is_media_entity_v4l2_video_device() - Check if the entity is a video_device
482 return entity && entity->obj_type == MEDIA_ENTITY_TYPE_VIDEO_DEVICE; in is_media_entity_v4l2_video_device()
486 * is_media_entity_v4l2_subdev() - Check if the entity is a v4l2_subdev
495 return entity && entity->obj_type == MEDIA_ENTITY_TYPE_V4L2_SUBDEV; in is_media_entity_v4l2_subdev()
499 * media_entity_enum_init - Initialise an entity enumeration
510 * media_entity_enum_cleanup - Release resources of an entity enumeration
517 * media_entity_enum_zero - Clear the entire enum
523 bitmap_zero(ent_enum->bmap, ent_enum->idx_max); in media_entity_enum_zero()
527 * media_entity_enum_set - Mark a single entity in the enum
535 if (WARN_ON(entity->internal_idx >= ent_enum->idx_max)) in media_entity_enum_set()
538 __set_bit(entity->internal_idx, ent_enum->bmap); in media_entity_enum_set()
542 * media_entity_enum_clear - Unmark a single entity in the enum
550 if (WARN_ON(entity->internal_idx >= ent_enum->idx_max)) in media_entity_enum_clear()
553 __clear_bit(entity->internal_idx, ent_enum->bmap); in media_entity_enum_clear()
557 * media_entity_enum_test - Test whether the entity is marked
567 if (WARN_ON(entity->internal_idx >= ent_enum->idx_max)) in media_entity_enum_test()
570 return test_bit(entity->internal_idx, ent_enum->bmap); in media_entity_enum_test()
574 * media_entity_enum_test_and_set - Test whether the entity is marked,
586 if (WARN_ON(entity->internal_idx >= ent_enum->idx_max)) in media_entity_enum_test_and_set()
589 return __test_and_set_bit(entity->internal_idx, ent_enum->bmap); in media_entity_enum_test_and_set()
593 * media_entity_enum_empty - Test whether the entire enum is empty
601 return bitmap_empty(ent_enum->bmap, ent_enum->idx_max); in media_entity_enum_empty()
605 * media_entity_enum_intersects - Test whether two enums intersect
617 WARN_ON(ent_enum1->idx_max != ent_enum2->idx_max); in media_entity_enum_intersects()
619 return bitmap_intersects(ent_enum1->bmap, ent_enum2->bmap, in media_entity_enum_intersects()
620 min(ent_enum1->idx_max, ent_enum2->idx_max)); in media_entity_enum_intersects()
624 * gobj_to_entity - returns the struct &media_entity pointer from the
633 * gobj_to_pad - returns the struct &media_pad pointer from the
642 * gobj_to_link - returns the struct &media_link pointer from the
651 * gobj_to_intf - returns the struct &media_interface pointer from the
660 * intf_to_devnode - returns the struct media_intf_devnode pointer from the
669 * media_gobj_create - Initialize a graph object
686 * media_gobj_destroy - Stop using a graph object on a media device
696 * media_entity_pads_init() - Initialize the entity pads
699 * @num_pads: total number of sink and source pads
707 * &media_entity->num_pads with 0 and &media_entity->pads with %NULL or call
712 * pads array in a driver-specific structure, avoiding dynamic allocation.
721 * media_entity_cleanup() - free resources associated with an entity
730 * valid and is a no-op.
739 * media_get_pad_index() - retrieves a pad index from an entity
751 * entity is a NULL pointer, return -EINVAL.
757 * media_create_pad_link() - creates a link between two entities.
761 * @sink: pointer to &media_entity of the sink pad.
762 * @sink_pad: number of the sink pad in the pads array.
771 * When two or more links target a sink pad, only one of them can be
785 u16 source_pad, struct media_entity *sink,
789 * media_create_pad_links() - creates a link between two entities.
792 * @source_function: Function of the source entities. Used only if @source is
797 * @sink_function: Function of the sink entities. Used only if @sink is NULL.
798 * @sink: pointer to &media_entity of the sink pad. If NULL, it will use
800 * @sink_pad: number of the sink pad in the pads array.
802 * @allow_both_undefined: if %true, then both @source and @sink can be NULL.
806 * and @sink are NULL.
812 * flag is passed as an argument, only the first created link will have
820 * It is common for some devices to have multiple source and/or sink entities
823 * cross-bar (n:n) links.
836 struct media_entity *sink,
844 * media_entity_remove_links() - remove all links associated with an entity
856 * __media_entity_setup_link - Configure a media link without locking
866 * The user is expected to hold link->source->parent->mutex. If not,
872 * media_entity_setup_link() - changes the link flags properties in runtime
877 * The only configurable property is the %MEDIA_LNK_FL_ENABLED link flag
882 * link_setup operation for the two entities at the source and sink of the
893 * is non-immutable. The operation must either configure the hardware or store
897 * enabled link at a sink pad prevents another link at the same pad from
898 * being enabled, the link_setup operation must return %-EBUSY and can't
910 * media_entity_find_link - Find a link between two pads
912 * @sink: Sink pad
918 struct media_pad *sink);
921 * media_pad_remote_pad_first - Find the first pad at the remote end of a link
933 * media_pad_remote_pad_unique - Find a remote pad connected to a pad
945 * * -ENOTUNIQ - Multiple links are enabled
946 * * -ENOLINK - No connected pad found
951 * media_entity_remote_pad_unique - Find a remote pad connected to an entity
960 * that support a single active source or sink at a time.
965 * * -ENOTUNIQ - Multiple links are enabled
966 * * -ENOLINK - No connected pad found
973 * media_entity_remote_source_pad_unique - Find a remote source pad connected to
987 * * -ENOTUNIQ - Multiple links are enabled
988 * * -ENOLINK - No connected pad found
997 * media_pad_is_streaming - Test if a pad is part of a streaming pipeline
1005 return pad->pipe; in media_pad_is_streaming()
1009 * media_entity_is_streaming - Test if an entity is part of a streaming pipeline
1028 * media_entity_pipeline - Get the media pipeline an entity is part of
1039 * multiplexed streams). This function is to be used only for entities that
1048 * media_pad_pipeline - Get the media pipeline a pad is part of
1061 * media_entity_get_fwnode_pad - Get pad number from fwnode
1084 * media_graph_walk_init - Allocate resources used by graph walk.
1100 * media_graph_walk_cleanup - Release resources used by graph walk.
1109 * media_graph_walk_start - Start walking the media graph at a
1129 * media_graph_walk_next - Get the next entity in the graph
1134 * Perform a depth-first traversal of the given media entities graph.
1145 * media_pipeline_start - Mark a pipeline as streaming
1161 * __media_pipeline_start - Mark a pipeline as streaming
1166 * ..note:: This is the non-locking version of media_pipeline_start()
1172 * media_pipeline_stop - Mark a pipeline as not streaming
1186 * __media_pipeline_stop - Mark a pipeline as not streaming
1190 * .. note:: This is the non-locking version of media_pipeline_stop()
1200 * media_pipeline_for_each_pad - Iterate on all pads in a media pipeline
1205 * Iterate on all pads in a media pipeline. This is only valid after the
1215 * media_pipeline_entity_iter_init - Initialize a pipeline entity iterator
1233 * media_pipeline_entity_iter_cleanup - Destroy a pipeline entity iterator
1247 * media_pipeline_for_each_entity - Iterate on all entities in a media pipeline
1252 * Iterate on all entities in a media pipeline. This is only valid after the
1265 * media_pipeline_alloc_start - Mark a pipeline as streaming
1278 * media_devnode_create() - creates and initializes a device node interface
1302 * media_devnode_remove() - removes a device node interface
1312 * media_create_intf_link() - creates a link between an entity and an interface
1329 * A typical example is an hybrid TV device that handle only one type of
1345 * __media_remove_intf_link() - remove a single interface link
1354 * media_remove_intf_link() - remove a single interface link
1363 * __media_remove_intf_links() - remove all links associated with an interface
1372 * media_remove_intf_links() - remove all links associated with an interface
1386 * media_entity_call - Calls a struct media_entity_operations operation on
1398 (((entity)->ops && (entity)->ops->operation) ? \
1399 (entity)->ops->operation((entity) , ##args) : -ENOIOCTLCMD)
1402 * media_create_ancillary_link() - create an ancillary link between two
1421 * __media_entity_next_link() - Iterate through a &media_entity's links
1436 * for_each_media_entity_data_link() - Iterate through an entity's data links