From: Michael Riesch <michael.riesch@collabora.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>, linux-media@vger.kernel.org
Cc: hans@jjverkuil.nl, laurent.pinchart@ideasonboard.com,
Prabhakar <prabhakar.csengg@gmail.com>,
"Kate Hsuan" <hpa@redhat.com>,
"Dave Stevenson" <dave.stevenson@raspberrypi.com>,
"Tommaso Merciai" <tomm.merciai@gmail.com>,
"Benjamin Mugnier" <benjamin.mugnier@foss.st.com>,
"Sylvain Petinot" <sylvain.petinot@foss.st.com>,
"Christophe JAILLET" <christophe.jaillet@wanadoo.fr>,
"Julien Massot" <julien.massot@collabora.com>,
"Naushir Patuck" <naush@raspberrypi.com>,
"Yan, Dongcheng" <dongcheng.yan@intel.com>,
"Cao, Bingbu" <bingbu.cao@intel.com>,
"Qiu, Tian Shu" <tian.shu.qiu@intel.com>,
"Stefan Klug" <stefan.klug@ideasonboard.com>,
"Mirela Rabulea" <mirela.rabulea@nxp.com>,
"André Apitzsch" <git@apitzsch.eu>,
"Heimir Thor Sverrisson" <heimir.sverrisson@gmail.com>,
"Kieran Bingham" <kieran.bingham@ideasonboard.com>,
"Mehdi Djait" <mehdi.djait@linux.intel.com>,
"Ricardo Ribalda Delgado" <ribalda@kernel.org>,
"Hans de Goede" <hansg@kernel.org>,
"Jacopo Mondi" <jacopo.mondi@ideasonboard.com>,
"Tomi Valkeinen" <tomi.valkeinen@ideasonboard.com>,
"David Plowman" <david.plowman@raspberrypi.com>,
"Yu, Ong Hock" <ong.hock.yu@intel.com>,
"Ng, Khai Wen" <khai.wen.ng@intel.com>,
"Jai Luthra" <jai.luthra@ideasonboard.com>
Subject: Re: [PATCH v3 13/22] media: mc: Separate single link validation into a new function
Date: Thu, 2 Apr 2026 14:36:07 +0200 [thread overview]
Message-ID: <7e622a1e-0ec0-4fe2-9aa4-4b152b4cbb3a@collabora.com> (raw)
In-Reply-To: <20260325105818.1176816-14-sakari.ailus@linux.intel.com>
Hi Sakari,
On 3/25/26 11:58, Sakari Ailus wrote:
> Add a new function __media_pipeline_validate_one() to validate a single
> link in a pipeline. This will soon be used for performing validation in
> multiple phases.
>
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Michael Riesch <michael.riesch@collabora.com>
Thanks and best regards,
Michael
> ---
> drivers/media/mc/mc-entity.c | 74 ++++++++++++++++++++----------------
> 1 file changed, 42 insertions(+), 32 deletions(-)
>
> diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c
> index 6bf4730b89d2..717569bd1a8c 100644
> --- a/drivers/media/mc/mc-entity.c
> +++ b/drivers/media/mc/mc-entity.c
> @@ -768,6 +768,45 @@ static int media_pipeline_populate(struct media_pipeline *pipe,
> return ret;
> }
>
> +static int
> +__media_pipeline_validate_one(struct media_pad *origin,
> + struct media_pad *pad, struct media_link *link,
> + bool *has_enabled_link)
> +{
> + struct media_device *mdev = origin->graph_obj.mdev;
> + struct media_entity *entity = pad->entity;
> + int ret;
> +
> + /* Return here if the link is disabled. */
> + if (!(link->flags & MEDIA_LNK_FL_ENABLED))
> + return 0;
> +
> + if (has_enabled_link)
> + *has_enabled_link = true;
> +
> + /* Skip validation if the current pad isn't the sink pad of the link. */
> + if (link->sink != pad)
> + return 0;
> +
> + if (!entity->ops || !entity->ops->link_validate)
> + return 0;
> +
> + ret = entity->ops->link_validate(link);
> + if (ret) {
> + dev_dbg(mdev->dev,
> + "Link '%s':%u -> '%s':%u failed validation: %d\n",
> + link->source->entity->name, link->source->index,
> + link->sink->entity->name, link->sink->index, ret);
> + return ret;
> + }
> +
> + dev_dbg(mdev->dev, "Link '%s':%u -> '%s':%u is valid\n",
> + link->source->entity->name, link->source->index,
> + link->sink->entity->name, link->sink->index);
> +
> + return 0;
> +}
> +
> __must_check int __media_pipeline_start(struct media_pad *origin,
> struct media_pipeline *pipe)
> {
> @@ -838,39 +877,10 @@ __must_check int __media_pipeline_start(struct media_pad *origin,
> if (link->sink != pad && link->source != pad)
> continue;
>
> - /*
> - * Ensure the link is enabled and if so, record
> - * it. Proceed to the next link if the current pad isn't
> - * the sink pad of the link.
> - */
> - if (!(link->flags & MEDIA_LNK_FL_ENABLED))
> - continue;
> -
> - has_enabled_link = true;
> -
> - if (link->sink != pad)
> - continue;
> -
> - if (!entity->ops || !entity->ops->link_validate)
> - continue;
> -
> - ret = entity->ops->link_validate(link);
> - if (ret) {
> - dev_dbg(mdev->dev,
> - "Link '%s':%u -> '%s':%u failed validation: %d\n",
> - link->source->entity->name,
> - link->source->index,
> - link->sink->entity->name,
> - link->sink->index, ret);
> + ret = __media_pipeline_validate_one(origin, pad, link,
> + &has_enabled_link);
> + if (ret)
> goto error;
> - }
> -
> - dev_dbg(mdev->dev,
> - "Link '%s':%u -> '%s':%u is valid\n",
> - link->source->entity->name,
> - link->source->index,
> - link->sink->entity->name,
> - link->sink->index);
> }
>
> /*
next prev parent reply other threads:[~2026-04-02 12:36 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-25 10:57 [PATCH v3 00/22] Metadata series preparation Sakari Ailus
2026-03-25 10:57 ` [PATCH v3 01/22] media: imx219: Rename "PIXEL_ARRAY" as "VISIBLE" Sakari Ailus
2026-03-25 10:57 ` [PATCH v3 02/22] media: imx219: Fix maximum frame length in lines Sakari Ailus
2026-03-25 11:36 ` Dave Stevenson
2026-03-25 10:57 ` [PATCH v3 03/22] media: imx219: Set horizontal blanking on mode change Sakari Ailus
2026-03-25 11:48 ` Dave Stevenson
2026-03-25 12:20 ` Sakari Ailus
2026-03-25 10:58 ` [PATCH v3 04/22] media: imx219: Scale the vblank limits according to rate_factor Sakari Ailus
2026-03-25 10:58 ` [PATCH v3 05/22] media: imx219: Fix vertical blanking and exposure for analogue binning Sakari Ailus
2026-03-25 10:58 ` [PATCH v3 06/22] media: imx219: Don't update exposure limits while setting format Sakari Ailus
2026-03-25 12:37 ` Dave Stevenson
2026-03-25 12:47 ` Sakari Ailus
2026-03-25 10:58 ` [PATCH v3 07/22] media: imx219: Rename "binning" as "bin_hv" in imx219_set_pad_format Sakari Ailus
2026-03-25 10:58 ` [PATCH v3 08/22] media: Documentation: Improve LINK_FREQ documentation Sakari Ailus
2026-03-25 10:58 ` [PATCH v3 09/22] media: Documentation: Improve pixel rate calculation documentation Sakari Ailus
2026-03-25 10:58 ` [PATCH v3 10/22] media: v4l2-subdev: Refactor returning routes Sakari Ailus
2026-04-02 11:56 ` Michael Riesch
2026-03-25 10:58 ` [PATCH v3 11/22] media: v4l2-subdev: Allow accessing routes with STREAMS client capability Sakari Ailus
2026-04-02 12:00 ` Michael Riesch
2026-03-25 10:58 ` [PATCH v3 12/22] media: mc: Simplify link processing in __media_pipeline_start() Sakari Ailus
2026-04-02 12:35 ` Michael Riesch
2026-03-25 10:58 ` [PATCH v3 13/22] media: mc: Separate single link validation into a new function Sakari Ailus
2026-04-02 12:36 ` Michael Riesch [this message]
2026-03-25 10:58 ` [PATCH v3 14/14] media: Improve enable_streams and disable_streams documentation Sakari Ailus
2026-03-25 12:34 ` Sakari Ailus
2026-03-25 10:58 ` [PATCH v3 14/22] media: uapi: Bump the STREAMS bit a little Sakari Ailus
2026-03-25 10:58 ` [PATCH v3 15/22] media: mc: Don't care about unsettable flags in MEDIA_IOC_LINK_SETUP Sakari Ailus
2026-03-25 10:58 ` [PATCH v3 16/22] media: mc: Add MEDIA_LNK_FL_VALIDATE_LATE Sakari Ailus
2026-03-25 10:58 ` [PATCH v3 17/22] media: Improve enable_streams and disable_streams documentation Sakari Ailus
2026-03-25 10:58 ` [PATCH v3 18/22] media: v4l2-subdev: Move subdev client capabilities into a new struct Sakari Ailus
2026-03-25 10:58 ` [PATCH v3 19/22] media: v4l2-subdev: Add struct v4l2_subdev_client_info pointer to pad ops Sakari Ailus
2026-03-25 10:58 ` [PATCH v3 20/22] media: v4l2-subdev: Add v4l2_subdev_call_ci_active_state Sakari Ailus
2026-03-25 10:58 ` [PATCH v3 21/22] media: v4l2-subdev: Perform client info changes to i2c drivers Sakari Ailus
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=7e622a1e-0ec0-4fe2-9aa4-4b152b4cbb3a@collabora.com \
--to=michael.riesch@collabora.com \
--cc=benjamin.mugnier@foss.st.com \
--cc=bingbu.cao@intel.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=dave.stevenson@raspberrypi.com \
--cc=david.plowman@raspberrypi.com \
--cc=dongcheng.yan@intel.com \
--cc=git@apitzsch.eu \
--cc=hans@jjverkuil.nl \
--cc=hansg@kernel.org \
--cc=heimir.sverrisson@gmail.com \
--cc=hpa@redhat.com \
--cc=jacopo.mondi@ideasonboard.com \
--cc=jai.luthra@ideasonboard.com \
--cc=julien.massot@collabora.com \
--cc=khai.wen.ng@intel.com \
--cc=kieran.bingham@ideasonboard.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=mehdi.djait@linux.intel.com \
--cc=mirela.rabulea@nxp.com \
--cc=naush@raspberrypi.com \
--cc=ong.hock.yu@intel.com \
--cc=prabhakar.csengg@gmail.com \
--cc=ribalda@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=stefan.klug@ideasonboard.com \
--cc=sylvain.petinot@foss.st.com \
--cc=tian.shu.qiu@intel.com \
--cc=tomi.valkeinen@ideasonboard.com \
--cc=tomm.merciai@gmail.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