linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Satish Nagireddy <satish.nagireddy@getcruise.com>
To: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Cc: linux-media@vger.kernel.org, sakari.ailus@linux.intel.com,
	Jacopo Mondi <jacopo+renesas@jmondi.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	niklas.soderlund+renesas@ragnatech.se,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>,
	Pratyush Yadav <p.yadav@ti.com>,
	Kishon Vijay Abraham <kishon@ti.com>,
	Tomasz Figa <tfiga@chromium.org>
Subject: Re: [EXT] Re: [EXT] Re: [EXT] [PATCH v12 09/30] media: mc: entity: Rewrite media_pipeline_start() to support routes
Date: Fri, 29 Jul 2022 10:00:19 -0700	[thread overview]
Message-ID: <CAG0LG96dncADM65ids6VMU=ym-j55fws6NOwLQM=or7pN4-d-g@mail.gmail.com> (raw)
In-Reply-To: <ce6f1e9a-21d2-cb89-87fd-1ec09ee95c4f@ideasonboard.com>

On Fri, Jul 29, 2022 at 3:27 AM Tomi Valkeinen
<tomi.valkeinen@ideasonboard.com> wrote:
>
> On 29/07/2022 12:19, Satish Nagireddy wrote:
> > On Fri, Jul 29, 2022 at 1:53 AM Tomi Valkeinen
> > <tomi.valkeinen@ideasonboard.com> wrote:
> >>
> >> On 29/07/2022 11:45, Satish Nagireddy wrote:
> >>
> >>>> @@ -1011,7 +1342,7 @@ EXPORT_SYMBOL_GPL(media_entity_get_fwnode_pad);
> >>>>
> >>>>    struct media_pipeline *media_entity_pipeline(struct media_entity *entity)
> >>>>    {
> >>>> -       return entity->pipe;
> >>>> +       return entity->pads->pipe;
> >>>
> >>> I am not sure If it is always safe to return the pipe associated with
> >>> the first pad. I think this will work with all the existing drivers.
> >>> Let's say If pads of an entity are associated with different pipes,
> >>> this function might require extending the support of returning
> >>> pipe based on pad index. Please let me know your opinion.
> >>
> >> That's true. The kdoc for this function says:
> >>
> >>    * In general, entities can be part of multiple pipelines, when carrying
> >>    * multiple streams (either on different pads, or on the same pad using
> >>    * multiplexed streams). This function is ill-defined in that case. It
> >>    * currently returns the pipeline associated with the first pad of the
> >> entity.
> >>
> >> I did consider adding a warning if the function is called for entities
> >> with more than one pad. But that probably would give false warnings,
> >> e.g. for a simple entity with one sink and one source pad. In that case
> >> both pads are always part of the same pipeline, and
> >> media_entity_pipeline() works correctly.
> >>
> >> We could perhaps add a check here which verifies that all the pads in
> >> the entity have the same pipe.
>
> Perhaps something like:
>
> struct media_pipeline *media_entity_pipeline(struct media_entity *entity)
> {
>         struct media_pipeline *pipe;
>         struct media_pad *pad;
>
>         if (entity->num_pads == 0)
>                 return NULL;
>
>         pipe = entity->pads->pipe;
>
>         media_entity_for_each_pad(entity, pad) {
>                 if (WARN_ON(pad->pipe != pipe))
>                         return NULL;
>         }
>
>         return pipe;
> }

The above code means that we do not support multiple pipelines per
entity. Or leave the implementation as is now and
this can be done as a different patch later, I will leave it to you.
He is what I'm thinking, assuming that every media_pad has it's own pipe.

struct media_pipeline *media_entity_pipeline(struct media_entity
*entity, u32 pad_index)
{
         if (pad_index >= entity->num_pads)
                 return NULL;

         return entity->pads[pad_index].pipe;
}

- Satish

>
> >>>>    }
> >>>>    EXPORT_SYMBOL_GPL(media_entity_pipeline);
> >>>
> >>> nit, It would be nice to rename this function to media_entity_get_pipe
> >>> or media_entity_get_pipeline for better readability.
> >>
> >> I'm ok with that, but we do have other functions with this style:
> >> media_entity_remote_pad(), media_entity_id(), ...
> >>
> >>    Tomi
> >
> > I could only see one function with the similar style ==>
> > media_entity_get_fwnode_pad
>
> Right, so, do you agree that we should keep the name as
> media_entity_pipeline, as we already have many other functions with
> similar style?
>
>   Tomi

Sure, we can go with the same function name.

- Satish

  reply	other threads:[~2022-07-29 17:00 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-27 10:36 [PATCH v12 00/30] v4l: routing and streams support Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 01/30] media: Documentation: mc: add definitions for stream and pipeline Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 02/30] media: mc: entity: Add iterator helper for entity pads Tomi Valkeinen
2022-07-30 11:11   ` Sakari Ailus
2022-08-01  5:58     ` Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 03/30] media: mc: entity: Merge media_entity_enum_init and __media_entity_enum_init Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 04/30] media: mc: entity: Move media_entity_get_fwnode_pad() out of graph walk section Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 05/30] media: mc: entity: Add media_entity_pipeline() to access the media pipeline Tomi Valkeinen
2022-07-30 11:21   ` Sakari Ailus
2022-08-01  6:01     ` Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 06/30] media: mc: entity: Add has_route entity operation and media_entity_has_route() helper Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 07/30] media: mc: entity: Rename streaming_count -> start_count Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 08/30] media: mc: entity: add media_pipeline_alloc_start & media_pipeline_stop_free Tomi Valkeinen
2022-07-29  8:30   ` [EXT] " Satish Nagireddy
2022-07-29  8:40     ` Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 09/30] media: mc: entity: Rewrite media_pipeline_start() to support routes Tomi Valkeinen
2022-07-29  8:45   ` [EXT] " Satish Nagireddy
2022-07-29  8:53     ` Tomi Valkeinen
2022-07-29  9:19       ` [EXT] " Satish Nagireddy
2022-07-29 10:27         ` Tomi Valkeinen
2022-07-29 17:00           ` Satish Nagireddy [this message]
2022-07-29 17:07             ` [EXT] " Tomi Valkeinen
2022-07-29 18:20               ` [EXT] " Satish Nagireddy
2022-07-30 11:56               ` Sakari Ailus
2022-08-01  9:33                 ` Tomi Valkeinen
2022-08-01 11:06                   ` Sakari Ailus
2022-07-27 10:36 ` [PATCH v12 10/30] media: add V4L2_SUBDEV_FL_STREAMS Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 11/30] media: add V4L2_SUBDEV_CAP_MPLEXED Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 12/30] media: Documentation: Add GS_ROUTING documentation Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 13/30] media: subdev: Add [GS]_ROUTING subdev ioctls and operations Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 14/30] media: subdev: add v4l2_subdev_has_route() Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 15/30] media: subdev: add v4l2_subdev_set_routing helper() Tomi Valkeinen
2022-08-01  6:59   ` Sakari Ailus
2022-08-01  7:38     ` Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 16/30] media: Documentation: add multiplexed streams documentation Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 17/30] media: subdev: add stream based configuration Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 18/30] media: subdev: use streams in v4l2_subdev_link_validate() Tomi Valkeinen
2022-07-29  9:12   ` [EXT] " Satish Nagireddy
2022-07-29 11:00     ` Tomi Valkeinen
2022-07-29 17:33       ` [EXT] " Satish Nagireddy
2022-07-27 10:36 ` [PATCH v12 19/30] media: subdev: add "opposite" stream helper funcs Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 20/30] media: subdev: add streams to v4l2_subdev_get_fmt() helper function Tomi Valkeinen
2022-07-29  9:16   ` [EXT] " Satish Nagireddy
2022-07-29 10:30     ` Tomi Valkeinen
2022-07-29 17:01       ` [EXT] " Satish Nagireddy
2022-07-27 10:36 ` [PATCH v12 21/30] media: subdev: add v4l2_subdev_set_routing_with_fmt() helper Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 22/30] media: subdev: add v4l2_subdev_routing_validate() helper Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 23/30] media: subdev: Add for_each_active_route() macro Tomi Valkeinen
2022-08-01  8:40   ` Tomi Valkeinen
2022-08-01 11:09     ` Sakari Ailus
2022-07-27 10:36 ` [PATCH v12 24/30] media: subdev: use for_each_active_route() in v4l2_subdev_init_stream_configs() Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 25/30] media: subdev: use for_each_active_route() in v4l2_link_validate_get_streams() Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 26/30] media: v4l2-subdev: Add v4l2_subdev_state_xlate_streams() helper Tomi Valkeinen
2022-08-01 12:37   ` Sakari Ailus
2022-08-01 14:25     ` Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 27/30] media: v4l2-subdev: Add subdev .(enable|disable)_streams() operations Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 28/30] media: v4l2-subdev: Add v4l2_subdev_s_stream_helper() function Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 29/30] media: Add stream to frame descriptor Tomi Valkeinen
2022-07-27 10:36 ` [PATCH v12 30/30] media: subdev: increase V4L2_FRAME_DESC_ENTRY_MAX to 8 Tomi Valkeinen
2022-07-27 10:42 ` [PATCH v12 00/30] v4l: routing and streams support Tomi Valkeinen
2022-07-31 20:47 ` Sakari Ailus
2022-08-01  6:28   ` Tomi Valkeinen
     [not found] ` <MW4PR02MB737849AF15E8004B2CB39C3BB09C9@MW4PR02MB7378.namprd02.prod.outlook.com>
2022-08-03 11:37   ` Tomi Valkeinen
     [not found]     ` <MW4PR02MB73781CDA5C792C28390BAF29B09E9@MW4PR02MB7378.namprd02.prod.outlook.com>
2022-08-08  6:45       ` Tomi Valkeinen
2022-08-19  2:31         ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAG0LG96dncADM65ids6VMU=ym-j55fws6NOwLQM=or7pN4-d-g@mail.gmail.com' \
    --to=satish.nagireddy@getcruise.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=jacopo+renesas@jmondi.org \
    --cc=kishon@ti.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    --cc=p.yadav@ti.com \
    --cc=sakari.ailus@linux.intel.com \
    --cc=tfiga@chromium.org \
    --cc=tomi.valkeinen@ideasonboard.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).