From: "Niklas Söderlund" <niklas.soderlund@ragnatech.se>
To: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Cc: Mauro Carvalho Chehab <mchehab@kernel.org>,
Sakari Ailus <sakari.ailus@linux.intel.com>,
linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
linux-kernel@vger.kernel.org,
Mauro Carvalho Chehab <mchehab+huawei@kernel.org>,
Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Subject: Re: [PATCH v5 01/10] media: rcar-vin: Link VINs on Gen3 to a single channel on each CSI-2
Date: Sat, 4 Apr 2026 14:09:39 +0200 [thread overview]
Message-ID: <20260404120939.GB1525575@ragnatech.se> (raw)
In-Reply-To: <20260311-rcar-streams-v5-1-3e6c957d7567@ideasonboard.com>
Hi Tomi,
Thanks for your work.
On 2026-03-11 15:53:14 +0200, Tomi Valkeinen wrote:
> The stream routing will be fully configurable when we add full streams
> support to the rcar pipeline. Thus there is no need for the user to be
> able to link VINs to different CSI-2 channels. In fact, allowing e.g.
> VIN0 to be connected to CSI-2 channel 3 would be wrong, as the hardware
> doesn't allow that.
>
> Change rvin_csi2_create_link() so that it creates media links only
> between matching VINs and CSI-2 channels (VIN0 - channel 0, VIN1 -
> channel 1, etc.).
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
I think you should break this out of the streams series so we can merge
it before streams are enabled by default in the API.
> ---
> .../media/platform/renesas/rcar-vin/rcar-core.c | 27 ++++++++++++----------
> 1 file changed, 15 insertions(+), 12 deletions(-)
>
> diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-core.c b/drivers/media/platform/renesas/rcar-vin/rcar-core.c
> index c8d564aa1eba..2fcea715101c 100644
> --- a/drivers/media/platform/renesas/rcar-vin/rcar-core.c
> +++ b/drivers/media/platform/renesas/rcar-vin/rcar-core.c
> @@ -673,23 +673,26 @@ static int rvin_csi2_create_link(struct rvin_group *group, unsigned int id,
> struct media_entity *source = &group->remotes[route->csi].subdev->entity;
> struct media_entity *sink = &group->vin[id]->vdev.entity;
> struct media_pad *sink_pad = &sink->pads[0];
> + struct media_pad *source_pad;
> + unsigned int source_idx;
> unsigned int channel;
> - int ret;
>
> - for (channel = 0; channel < 4; channel++) {
> - unsigned int source_idx = rvin_group_csi_channel_to_pad(channel);
> - struct media_pad *source_pad = &source->pads[source_idx];
> + /*
> + * The channels from CSI-2 blocks and the VIN groups have a set of
> + * hardcoded routing options to choose from. We only support the routing
> + * where all VINs in a group are connected to the same CSI-2 block,
> + * and the Nth VIN in the group is connected to the Nth CSI-2 channel.
> + */
>
> - /* Skip if link already exists. */
> - if (media_entity_find_link(source_pad, sink_pad))
> - continue;
> + channel = id % 4;
> + source_idx = rvin_group_csi_channel_to_pad(channel);
> + source_pad = &source->pads[source_idx];
>
> - ret = media_create_pad_link(source, source_idx, sink, 0, 0);
> - if (ret)
> - return ret;
> - }
> + /* Skip if link already exists. */
> + if (media_entity_find_link(source_pad, sink_pad))
> + return 0;
>
> - return 0;
> + return media_create_pad_link(source, source_idx, sink, 0, 0);
> }
>
> static int rvin_parallel_setup_links(struct rvin_group *group)
>
> --
> 2.43.0
>
--
Kind Regards,
Niklas Söderlund
next prev parent reply other threads:[~2026-04-04 12:09 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-11 13:53 [PATCH v5 00/10] media: rcar: Streams support Tomi Valkeinen
2026-03-11 13:53 ` [PATCH v5 01/10] media: rcar-vin: Link VINs on Gen3 to a single channel on each CSI-2 Tomi Valkeinen
2026-04-04 12:09 ` Niklas Söderlund [this message]
2026-03-11 13:53 ` [PATCH v5 02/10] media: rcar-isp: Move {enable|disable}_streams() calls Tomi Valkeinen
2026-03-18 20:44 ` Laurent Pinchart
2026-03-11 13:53 ` [PATCH v5 03/10] media: rcar-csi2: " Tomi Valkeinen
2026-03-18 20:54 ` Laurent Pinchart
2026-04-04 12:19 ` Niklas Söderlund
2026-03-11 13:53 ` [PATCH v5 04/10] media: rcar-csi2: Switch to Streams API Tomi Valkeinen
2026-03-18 21:04 ` Laurent Pinchart
2026-03-11 13:53 ` [PATCH v5 05/10] media: rcar-isp: " Tomi Valkeinen
2026-03-18 21:12 ` Laurent Pinchart
2026-03-11 13:53 ` [PATCH v5 06/10] media: rcar-csi2: Add .get_frame_desc op Tomi Valkeinen
2026-03-18 21:16 ` Laurent Pinchart
2026-03-11 13:53 ` [PATCH v5 07/10] media: rcar-isp: Call get_frame_desc to find out VC & DT Tomi Valkeinen
2026-03-11 13:53 ` [PATCH v5 08/10] media: rcar-csi2: Call get_frame_desc to find out VC & DT (Gen3) Tomi Valkeinen
2026-03-11 13:53 ` [PATCH v5 09/10] media: rcar-csi2: Add full streams support Tomi Valkeinen
2026-03-11 13:53 ` [PATCH v5 10/10] media: rcar-isp: " Tomi Valkeinen
2026-03-11 17:38 ` [PATCH v5 00/10] media: rcar: Streams support Niklas Söderlund
2026-03-11 18:03 ` Tomi Valkeinen
2026-03-18 20:33 ` 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=20260404120939.GB1525575@ragnatech.se \
--to=niklas.soderlund@ragnatech.se \
--cc=jacopo.mondi@ideasonboard.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=mchehab+huawei@kernel.org \
--cc=mchehab@kernel.org \
--cc=sakari.ailus@linux.intel.com \
--cc=tomi.valkeinen+renesas@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