Lines Matching refs:pad
116 struct media_pad *pad = gobj_to_pad(gobj);
121 pad->flags & MEDIA_PAD_FL_SINK ? "sink " : "",
122 pad->flags & MEDIA_PAD_FL_SOURCE ? "source " : "",
123 pad->entity->name, pad->index);
233 * @pad0: The first pad index
234 * @pad1: The second pad index
238 * and enabling one of the pads means that the other pad will become "locked"
246 * One of @pad0 and @pad1 must be a sink pad and the other one a source pad.
420 * When a new pad is reached, an entry is pushed on the top of the stack and
421 * points to the incoming pad and the first link of the entity.
424 * internal pad dependencies in the entity, and then links in the graph. It
426 * links that originate from a pad that is internally connected to the incoming
427 * pad, as reported by the media_entity_has_pad_interdep() function.
433 * @pad: The media pad being visited
437 struct media_pad *pad;
500 struct media_pad *pad)
513 entry->pad = pad;
514 entry->links = pad->entity->links.next;
518 walk->stack.top, pad->entity->name, pad->index);
537 if (entry->links->next == &entry->pad->entity->links) {
561 /* Add a pad to the pipeline and push it to the stack. */
564 struct media_pad *pad)
569 if (ppad->pad == pad) {
570 dev_dbg(pad->graph_obj.mdev->dev,
571 "media pipeline: already contains pad '%s':%u\n",
572 pad->entity->name, pad->index);
582 ppad->pad = pad;
586 dev_dbg(pad->graph_obj.mdev->dev,
587 "media pipeline: added pad '%s':%u\n",
588 pad->entity->name, pad->index);
590 return media_pipeline_walk_push(walk, pad);
605 origin = entry->pad;
614 /* Get the local pad and remote pad. */
624 * Skip links that originate from a different pad than the incoming pad
625 * that is not connected internally in the entity to the incoming pad.
636 * Add the local pad of the link to the pipeline and push it to the
643 /* Similarly, add the remote pad, but only if the link is enabled. */
671 * Skip the origin pad (already handled), pad that have links
700 struct media_pad *pad)
708 * from @pad.
711 pipe->mdev = pad->graph_obj.mdev;
715 ret = media_pipeline_add_pad(pipe, &walk, pad);
732 dev_dbg(pad->graph_obj.mdev->dev,
736 dev_dbg(pad->graph_obj.mdev->dev, "- '%s':%u\n",
737 ppad->pad->entity->name, ppad->pad->index);
752 __must_check int __media_pipeline_start(struct media_pad *pad,
755 struct media_device *mdev = pad->graph_obj.mdev;
763 * If the pad is already part of a pipeline, that pipeline must be the
766 if (WARN_ON(pad->pipe && pad->pipe != pipe))
780 * with media_pipeline_pad instances for each pad found during graph
783 ret = media_pipeline_populate(pipe, pad);
793 struct media_pad *pad = ppad->pad;
794 struct media_entity *entity = pad->entity;
798 dev_dbg(mdev->dev, "Validating pad '%s':%u\n", pad->entity->name,
799 pad->index);
802 * 1. Ensure that the pad doesn't already belong to a different
805 if (pad->pipe) {
806 dev_dbg(mdev->dev, "Failed to start pipeline: pad '%s':%u busy\n",
807 pad->entity->name, pad->index);
813 * 2. Validate all active links whose sink is the current pad.
815 * the connected sink pad to avoid duplicating checks.
818 /* Skip links unrelated to the current pad. */
819 if (link->sink != pad && link->source != pad)
822 /* Record if the pad has links and enabled links. */
828 * current pad as its sink.
833 if (link->sink != pad)
859 * 3. If the pad has the MEDIA_PAD_FL_MUST_CONNECT flag set,
862 if ((pad->flags & MEDIA_PAD_FL_MUST_CONNECT) &&
866 pad->entity->name, pad->index);
871 /* Validation passed, store the pipe pointer in the pad. */
872 pad->pipe = pipe;
889 err_ppad->pad->pipe = NULL;
898 __must_check int media_pipeline_start(struct media_pad *pad,
901 struct media_device *mdev = pad->graph_obj.mdev;
905 ret = __media_pipeline_start(pad, pipe);
911 void __media_pipeline_stop(struct media_pad *pad)
913 struct media_pipeline *pipe = pad->pipe;
927 ppad->pad->pipe = NULL;
936 void media_pipeline_stop(struct media_pad *pad)
938 struct media_device *mdev = pad->graph_obj.mdev;
941 __media_pipeline_stop(pad);
946 __must_check int media_pipeline_alloc_start(struct media_pad *pad)
948 struct media_device *mdev = pad->graph_obj.mdev;
956 * Is the pad already part of a pipeline? If not, we need to allocate
959 pipe = media_pad_pipeline(pad);
971 ret = __media_pipeline_start(pad, pipe);
985 struct media_pad *pad)
987 if (!pad)
993 pad = list_entry(iter->cursor, struct media_pipeline_pad, list)->pad;
996 return pad;
1026 entity = ppad->pad->entity;
1367 struct media_pad *media_pad_remote_pad_first(const struct media_pad *pad)
1371 for_each_media_entity_data_link(pad->entity, link) {
1375 if (link->source == pad)
1378 if (link->sink == pad)
1391 struct media_pad *pad = NULL;
1412 if (pad)
1415 pad = remote_pad;
1419 if (!pad)
1422 return pad;
1426 struct media_pad *media_pad_remote_pad_unique(const struct media_pad *pad)
1431 list_for_each_entry(link, &pad->entity->links, list) {
1437 if (link->sink == pad)
1439 else if (link->source == pad)
1494 struct media_pad *pad;
1496 media_entity_for_each_pad(entity, pad) {
1497 if (pad->pipe)
1498 return pad->pipe;
1505 struct media_pipeline *media_pad_pipeline(struct media_pad *pad)
1507 return pad->pipe;