From nobody Tue Apr 7 22:03:15 2026 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 028CE3DDDB3; Wed, 11 Mar 2026 12:17:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773231471; cv=none; b=JKTvt2CUMxrw6nIr7nJBaw2yXu3DGs0VCm5KUs4VDwSr5m74h7k720j7Ix3CnZiLZ3GSZbP+gmuuQJzELIHz3FhtnOZ8Oq6/oAPXpcytpGDTsee5kirc/7HCNaCsIfIGy0a/9/5RIhDX+RsLXSX3rrYcPrDa4rpu1RF9EMCosd0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773231471; c=relaxed/simple; bh=e3lYso7dj4B5pgKg5hTM58pUhKDdz29Jk7HP2OmRtwg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=ogAaAwNgIMa7Ll3PMbLyD2nsmg8scNeTCtnGyJq//iwF/77A/KF4FvgDjabVgoXsS7E80yhNfFMKtYqZEevg3QjXS5WcjJKRP0QO1XbLibBxqSIFumIl5Tj+8nq1TRtG3b86L601+aPKE2DC7ik90kZWQ3CnLXOZhYB7cCg+3z8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=Jd+4XcBX; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Jd+4XcBX" Received: from [127.0.1.1] (91-158-153-178.elisa-laajakaista.fi [91.158.153.178]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9A5083DA; Wed, 11 Mar 2026 13:16:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1773231399; bh=e3lYso7dj4B5pgKg5hTM58pUhKDdz29Jk7HP2OmRtwg=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=Jd+4XcBXE7RDlZDM7Re+ocycV5wgYXVveHvgOx8V4y3PdyupyxtfYnwDrN4r6w1HG Bn/OjKqaJYjSf7OYrHDpSDdemX+Z7mxNlIKiOB/mMrZwYnFP0IDV4AFjQikr4A2C// hksNawBmnbXHobenqfMwWjuS2qAtuDX33YoPI34g= From: Tomi Valkeinen Date: Wed, 11 Mar 2026 14:17:19 +0200 Subject: [PATCH v5 1/3] media: subdev: Add v4l2_subdev_get_frame_desc_passthrough helper Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260311-frame-desc-passthrough-v5-1-d59876bbb663@ideasonboard.com> References: <20260311-frame-desc-passthrough-v5-0-d59876bbb663@ideasonboard.com> In-Reply-To: <20260311-frame-desc-passthrough-v5-0-d59876bbb663@ideasonboard.com> To: Mauro Carvalho Chehab , Laurent Pinchart , Sakari Ailus Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Tomi Valkeinen X-Mailer: b4 0.15-dev-c25d1 X-Developer-Signature: v=1; a=openpgp-sha256; l=5639; i=tomi.valkeinen+renesas@ideasonboard.com; h=from:subject:message-id; bh=e3lYso7dj4B5pgKg5hTM58pUhKDdz29Jk7HP2OmRtwg=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBpsV1o7OY+L+vrBN4mi20QzBRTplYHsBtKvRCQd Drzhxe/yciJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCabFdaAAKCRD6PaqMvJYe 9ebmD/4zq5v6ABjHRZp9FzzLHV2pzrSqBDh3auWipOFn3ydZCQ9tMqjunP3HEBKiwTtM0RjyX3c wQfFH31wBNUgiy2nQ7ULDCb4mZCQzktbWJqyr9fbu92Ftlu+N9C629IhbIEeQACSG97/ggMxlcw 41IOccSe5RwtScYZSadmtPgAUoV1495hSsecEEG/tzurJ9eeehWiqen7JkWW9WcpwpqaUQIR2he Y9Wxm0mHMzAEkUMJEvCdyD/MfX+o4bTNauog4v4oh81UZ/BWqnIvf4q7y29T3LKR+DPg9YJ/OAF X+V5bhCj4sGu7CSgQoMLBRMXisp8VFM+MKSX/a8lrdIsrZ60LvFHoF43LG16L8jnifB3PQZKcdI GJc1GErat6zuTrx3MchMyguQvSTB0e5TKRfFH+7ePZU4WGxmKBh/Bz52V90ht7/+8Whvm7p6kP6 cxkdukZZx9aoujIggjyuRDG9dfkXzg3R3dnncncnswHMKQ7Jv4DeYltYnZBF8d8AVBru7Y/p+E1 HWsdtCU1wFNzEev5QBN5xW4gSYpxabS2hEukkWGJIM+YEdQlTb8B5+sR/wMS+hHkhRxg1NpQtQj 94oq1K8jnFp/fhg5VqM/oPtgShS+kXEMdpktG3OlgHLOAm3KIqZu0B4+q9QD+q8FbA5x49aDWb+ ioIAFWaL/BnMDCA== X-Developer-Key: i=tomi.valkeinen+renesas@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 Add a helper for v4l2_subdev_pad_ops.get_frame_desc operation. The helper can be used when the subdevice directly passes through the streams. Signed-off-by: Tomi Valkeinen --- drivers/media/v4l2-core/v4l2-subdev.c | 111 ++++++++++++++++++++++++++++++= ++++ include/media/v4l2-subdev.h | 28 +++++++++ 2 files changed, 139 insertions(+) diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-cor= e/v4l2-subdev.c index 32e6f60e26c7..2757378c628a 100644 --- a/drivers/media/v4l2-core/v4l2-subdev.c +++ b/drivers/media/v4l2-core/v4l2-subdev.c @@ -2545,6 +2545,117 @@ int v4l2_subdev_s_stream_helper(struct v4l2_subdev = *sd, int enable) } EXPORT_SYMBOL_GPL(v4l2_subdev_s_stream_helper); =20 +int v4l2_subdev_get_frame_desc_passthrough(struct v4l2_subdev *sd, + unsigned int pad, + struct v4l2_mbus_frame_desc *fd) +{ + struct media_pad *local_sink_pad; + struct v4l2_subdev_route *route; + struct v4l2_subdev_state *state; + struct device *dev =3D sd->dev; + int ret =3D 0; + + if (WARN_ON(!(sd->entity.pads[pad].flags & MEDIA_PAD_FL_SOURCE))) + return -EINVAL; + + state =3D v4l2_subdev_lock_and_get_active_state(sd); + + /* Iterate over sink pads */ + media_entity_for_each_pad(&sd->entity, local_sink_pad) { + struct v4l2_mbus_frame_desc source_fd; + bool have_source_fd =3D false; + + if (!(local_sink_pad->flags & MEDIA_PAD_FL_SINK)) + continue; + + /* + * Copy frame desc entries for the streams going from the sink + * pad to the requested pad + */ + for_each_active_route(&state->routing, route) { + struct v4l2_mbus_frame_desc_entry *source_entry =3D NULL; + struct media_pad *remote_source_pad; + struct v4l2_subdev *remote_sd; + + if (route->source_pad !=3D pad || + route->sink_pad !=3D local_sink_pad->index) + continue; + + if (!have_source_fd) { + remote_source_pad =3D media_pad_remote_pad_unique(local_sink_pad); + if (!remote_source_pad) { + dev_dbg(dev, "Failed to find remote pad for sink pad %u\n", + local_sink_pad->index); + ret =3D -EINVAL; + goto out_unlock; + } + + remote_sd =3D media_entity_to_v4l2_subdev(remote_source_pad->entity); + if (!remote_sd) { + ret =3D -EINVAL; + goto out_unlock; + } + + ret =3D v4l2_subdev_call(remote_sd, pad, + get_frame_desc, + remote_source_pad->index, + &source_fd); + if (ret) { + dev_err(dev, + "Failed to get frame desc from remote subdev %s\n", + remote_sd->name); + goto out_unlock; + } + + have_source_fd =3D true; + + if (fd->num_entries =3D=3D 0) { + fd->type =3D source_fd.type; + } else if (fd->type !=3D source_fd.type) { + dev_err(dev, + "Frame desc type mismatch: %u !=3D %u\n", + fd->type, source_fd.type); + ret =3D -EPIPE; + goto out_unlock; + } + } + + for (unsigned int i =3D 0; i < source_fd.num_entries; i++) { + if (source_fd.entry[i].stream =3D=3D route->sink_stream) { + source_entry =3D &source_fd.entry[i]; + break; + } + } + + if (!source_entry) { + dev_dbg(dev, + "Failed to find stream %u from source frame desc\n", + route->sink_stream); + ret =3D -EPIPE; + goto out_unlock; + } + + if (fd->num_entries >=3D V4L2_FRAME_DESC_ENTRY_MAX) { + dev_dbg(dev, "Frame desc entry limit reached\n"); + ret =3D -ENOSPC; + goto out_unlock; + } + + fd->entry[fd->num_entries] =3D *source_entry; + + fd->entry[fd->num_entries].stream =3D route->source_stream; + + fd->num_entries++; + } + } + +out_unlock: + v4l2_subdev_unlock_state(state); + + return ret; +} +EXPORT_SYMBOL_GPL(v4l2_subdev_get_frame_desc_passthrough); + #endif /* CONFIG_VIDEO_V4L2_SUBDEV_API */ =20 #endif /* CONFIG_MEDIA_CONTROLLER */ diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index a37d9a847196..23c03ba7f84c 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h @@ -1722,6 +1722,34 @@ int v4l2_subdev_disable_streams(struct v4l2_subdev *= sd, u32 pad, */ int v4l2_subdev_s_stream_helper(struct v4l2_subdev *sd, int enable); =20 +/** + * v4l2_subdev_get_frame_desc_passthrough() - Helper to implement the subd= ev + * get_frame_desc operation in simple passthrough cases + * @sd: The subdevice + * @pad: The source pad index + * @fd: The mbus frame desc + * + * This helper implements get_frame_desc operation for subdevices that pass + * streams through without modification. It can be assigned directly as the + * .get_frame_desc callback in &v4l2_subdev_pad_ops. + * + * The helper iterates over the subdevice's sink pads, calls get_frame_des= c on + * the remote subdevice connected to each sink pad, and collects the frame= desc + * entries for streams that are routed to the given source pad according t= o the + * subdevice's routing table. Each entry is copied as-is from the upstream + * source, with the exception of the 'stream' field which is remapped to t= he + * source stream ID from the routing table. + * + * The frame desc type is taken from the first upstream source. If multiple + * sink pads are involved and the upstream sources report different frame = desc + * types, -EPIPE is returned. + * + * Return: 0 on success, or a negative error code otherwise. + */ +int v4l2_subdev_get_frame_desc_passthrough(struct v4l2_subdev *sd, + unsigned int pad, + struct v4l2_mbus_frame_desc *fd); + #endif /* CONFIG_VIDEO_V4L2_SUBDEV_API */ =20 #endif /* CONFIG_MEDIA_CONTROLLER */ --=20 2.43.0 From nobody Tue Apr 7 22:03:15 2026 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1FA703E0229; Wed, 11 Mar 2026 12:17:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773231476; cv=none; b=WBN4P2r6Rrv6Aop2J7AonvmPTYdamhKJj71eVasPXloCvqQk4DU0axlJratE+y/CM79JXoZpSRchlLjwPM+LeC7tNODZZPm2M1g5JO99sfJZqWsuFtyZx8d6DDECD2pbc8K6CEuREP3ghr7Z2xzuC8DMYznG6lk4fSzFduJ9bS8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773231476; c=relaxed/simple; bh=eUKa3Pr8BETFOmz9d3AslwF7WJpmKaVm3NCDYXMId1Q=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=t0VM11Ob1MIB1RCHEFuGk9QCNWJ8u2k0Hnw2gKMn/Mr0T4CqYZ7vxTbT3l/J8EcHa1DJCOjYf3aXyV7GRDr3I6jponQ0vYxPMEI+s9SnOyNzuZpl89VilsfJgDfaCEn/qoeOyCgkYPeBGl0ZQD3mX6hPZ/jSuErAW2d6X2ijohM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=eQmX/MVj; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="eQmX/MVj" Received: from [127.0.1.1] (91-158-153-178.elisa-laajakaista.fi [91.158.153.178]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 22AC64B3; Wed, 11 Mar 2026 13:16:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1773231400; bh=eUKa3Pr8BETFOmz9d3AslwF7WJpmKaVm3NCDYXMId1Q=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=eQmX/MVjaf2X3Bvgpx3VIAvIi6lwL6cdOCK9QKR5K0TT4rbv0j4oYxqLdSyMo9Jzf Wc7yX099XJLCEgC2nZgHVilZnYbLrYpu9OkKmARbOJDQRbswt20zuF+L/MwUOPuxbB C4j+Glry5IK9/iVeLOyLGsOGupQuQnaY3Wjsn110= From: Tomi Valkeinen Date: Wed, 11 Mar 2026 14:17:20 +0200 Subject: [PATCH v5 2/3] media: i2c: ds90ub953: Use v4l2_subdev_get_frame_desc_passthrough Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260311-frame-desc-passthrough-v5-2-d59876bbb663@ideasonboard.com> References: <20260311-frame-desc-passthrough-v5-0-d59876bbb663@ideasonboard.com> In-Reply-To: <20260311-frame-desc-passthrough-v5-0-d59876bbb663@ideasonboard.com> To: Mauro Carvalho Chehab , Laurent Pinchart , Sakari Ailus Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Tomi Valkeinen X-Mailer: b4 0.15-dev-c25d1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2742; i=tomi.valkeinen+renesas@ideasonboard.com; h=from:subject:message-id; bh=eUKa3Pr8BETFOmz9d3AslwF7WJpmKaVm3NCDYXMId1Q=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBpsV1oMtZlwiE/i9pRpqEEhSGDGoLqP5K1BzQER HQ2yh6c3O6JAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCabFdaAAKCRD6PaqMvJYe 9S8GEACjQfpanqlWq/2vwTZ7NuEZV+Epa+I9WoLoasLN17xw6UcKjcPxJFPCL9g4PginnQ43OSd A2g/5RbHnOg429jmTi3XcvjsVINkOfnOyXYQEKn2YyXZ4XsVcBiBzEnx/QIpH7Kbd89YRQ+NT0z H77g9Sfc6HbRZPQ6FBI8p5P8+JijToDbTlv6odkJiozZjwjSZ9ZsPlkVIgeLh3EIc3HqRaacsNb 1ezGBUcZ2IsDcjnfQyA0n17wNtiVpw6M1SaAjdcrIigB9PDeislmdg9SV/waPk5zk30x+bKZr/r AXq1+r7V7lRSw4y4aGEuO3FMI9b/jAdnR6/Dpb3D8swm7udaYB4fToyp2niJkM/ZQah7b2Y/xgy H/04oOiCbFj8GM+2lVWELs+NhVUOtVf2hIMKeTvVwIW28yKJt82s4iSU/CuRSosAlTf/D8rcUby 34Eyqvr3IkfmY2gz67PiG4lFC4OYetOG4BWmvihGKZoOvpWUBCGAzOdjpjoNj6xw5hL0iPfVIGg LEGRB0X4fkWUgRQQ3276FKwd+3dkpzmyXMvKPrarepxH1vpHS8q9Uk98jSymANKjyBCMd5knIOs V5H+swkO+L4iABK3kTM49LnloM9AdopOY7fyu3ZW0L4+J3z1RWpMVxtf51c8p5lddz+mu+lZ7Tb D6n2l6k/xUpBhgw== X-Developer-Key: i=tomi.valkeinen+renesas@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 Use the new v4l2_subdev_get_frame_desc_passthrough helper for .get_frame_desc. Signed-off-by: Tomi Valkeinen --- drivers/media/i2c/ds90ub953.c | 61 +--------------------------------------= ---- 1 file changed, 1 insertion(+), 60 deletions(-) diff --git a/drivers/media/i2c/ds90ub953.c b/drivers/media/i2c/ds90ub953.c index daefdb108fbf..a8ab67f4137f 100644 --- a/drivers/media/i2c/ds90ub953.c +++ b/drivers/media/i2c/ds90ub953.c @@ -424,65 +424,6 @@ static int ub953_set_routing(struct v4l2_subdev *sd, return _ub953_set_routing(sd, state, routing); } =20 -static int ub953_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, - struct v4l2_mbus_frame_desc *fd) -{ - struct ub953_data *priv =3D sd_to_ub953(sd); - struct v4l2_mbus_frame_desc source_fd; - struct v4l2_subdev_route *route; - struct v4l2_subdev_state *state; - int ret; - - if (pad !=3D UB953_PAD_SOURCE) - return -EINVAL; - - ret =3D v4l2_subdev_call(priv->source_sd, pad, get_frame_desc, - priv->source_sd_pad, &source_fd); - if (ret) - return ret; - - fd->type =3D V4L2_MBUS_FRAME_DESC_TYPE_CSI2; - - state =3D v4l2_subdev_lock_and_get_active_state(sd); - - for_each_active_route(&state->routing, route) { - struct v4l2_mbus_frame_desc_entry *source_entry =3D NULL; - unsigned int i; - - if (route->source_pad !=3D pad) - continue; - - for (i =3D 0; i < source_fd.num_entries; i++) { - if (source_fd.entry[i].stream =3D=3D route->sink_stream) { - source_entry =3D &source_fd.entry[i]; - break; - } - } - - if (!source_entry) { - dev_err(&priv->client->dev, - "Failed to find stream from source frame desc\n"); - ret =3D -EPIPE; - goto out_unlock; - } - - fd->entry[fd->num_entries].stream =3D route->source_stream; - fd->entry[fd->num_entries].flags =3D source_entry->flags; - fd->entry[fd->num_entries].length =3D source_entry->length; - fd->entry[fd->num_entries].pixelcode =3D source_entry->pixelcode; - fd->entry[fd->num_entries].bus.csi2.vc =3D - source_entry->bus.csi2.vc; - fd->entry[fd->num_entries].bus.csi2.dt =3D - source_entry->bus.csi2.dt; - - fd->num_entries++; - } - -out_unlock: - v4l2_subdev_unlock_state(state); - - return ret; -} =20 static int ub953_set_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_state *state, @@ -694,7 +635,7 @@ static const struct v4l2_subdev_pad_ops ub953_pad_ops = =3D { .enable_streams =3D ub953_enable_streams, .disable_streams =3D ub953_disable_streams, .set_routing =3D ub953_set_routing, - .get_frame_desc =3D ub953_get_frame_desc, + .get_frame_desc =3D v4l2_subdev_get_frame_desc_passthrough, .get_fmt =3D v4l2_subdev_get_fmt, .set_fmt =3D ub953_set_fmt, }; --=20 2.43.0 From nobody Tue Apr 7 22:03:15 2026 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 658061EEA3C; Wed, 11 Mar 2026 12:17:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=213.167.242.64 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773231476; cv=none; b=mj14iomQyrL6wb2RCO5J53dbIe4AoPovZqfD7HoNRjyt97r+eXxyhYfXkwWQaoaLVb5sABLE+jUHDaYtScPLfnWU4Dz0hOSJo97fAWXvbjquzB1BkUUAGARtFvTCeIUW6xUrOJDYLJzn5/Z1AavjbDcGK5wMCvGcO4u4BcKROG0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773231476; c=relaxed/simple; bh=g7JGoWvLNHDXHPK70uMQsZBrJB0TMmNYR16o2sKfGiA=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=hRJ1Lxaf4DlmGbrdM5yjiTxLOHfnPlkEctphorCjEmUXrcI9B0I/h5XW0J+dfg6xYVQzfksnDnUQ2eC7PEi6DKEn24DeEde/IY6iq+vPXIY0MX/EEHqjbKLzZeB/SyBBjQNO2FVouJACWDoY4CUnKczTMXIgOiHbBpPYGEY8ylw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com; spf=pass smtp.mailfrom=ideasonboard.com; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b=oLW6aYsW; arc=none smtp.client-ip=213.167.242.64 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ideasonboard.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="oLW6aYsW" Received: from [127.0.1.1] (91-158-153-178.elisa-laajakaista.fi [91.158.153.178]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9DA4D981; Wed, 11 Mar 2026 13:16:40 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1773231400; bh=g7JGoWvLNHDXHPK70uMQsZBrJB0TMmNYR16o2sKfGiA=; h=From:Date:Subject:References:In-Reply-To:To:Cc:From; b=oLW6aYsWhOxuKK8LInlrVO+J1EESmNSiE/4/YSofW7UHp6yFCs5hiHf0XQcXarXi6 oVZMg2ZCbHTM9qRCgaM+DmKXO5y3KedHldHBlnAhuhwVDCvJMCZyGRobP5s9cGbVme UnQHXLojZ/cG3+HETasmZ+xKLO1Qkek8Jj0r+os0= From: Tomi Valkeinen Date: Wed, 11 Mar 2026 14:17:21 +0200 Subject: [PATCH v5 3/3] media: i2c: ds90ub913: Use v4l2_subdev_get_frame_desc_passthrough Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260311-frame-desc-passthrough-v5-3-d59876bbb663@ideasonboard.com> References: <20260311-frame-desc-passthrough-v5-0-d59876bbb663@ideasonboard.com> In-Reply-To: <20260311-frame-desc-passthrough-v5-0-d59876bbb663@ideasonboard.com> To: Mauro Carvalho Chehab , Laurent Pinchart , Sakari Ailus Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Tomi Valkeinen X-Mailer: b4 0.15-dev-c25d1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2627; i=tomi.valkeinen+renesas@ideasonboard.com; h=from:subject:message-id; bh=g7JGoWvLNHDXHPK70uMQsZBrJB0TMmNYR16o2sKfGiA=; b=owEBbQKS/ZANAwAIAfo9qoy8lh71AcsmYgBpsV1pn4ELsZVoKU+5ofDS6b2Kwp/FepIVu6nfy Dwd/zaQcDCJAjMEAAEIAB0WIQTEOAw+ll79gQef86f6PaqMvJYe9QUCabFdaQAKCRD6PaqMvJYe 9Zh7D/94pX+etU1vKX7H6pxk4+t86UKny4YHJMarhX6G+bkOMmE1fF++MdeyC8nrlKCaq4Sr5ij v92H9Rj5I65gSRHqhaTqRYxfEXOqEVJ6sE+m/jcWR7J1dXGAa3FETmFhZ43ui1fXTBMbr3ZqjH/ 46Gcx8drmp6lqydDVDOwsHsEv8AkH/X+gcz+YA4Ep3XLWG8dzVVesZNp0QoCrt23ErLwWxVzlK0 F0xG7kVgSO2OR5Z5PBKJw8oR+xy5+Y0BpjAMoRKd3HxWmr49CYpQD/KWgeGeJkBVYZbdf1cIDfd abuDjNXwzeCYHgu4t6d1HPExsVMlyhKJXufqufpq+Lyyeap0qLbNVBYc2eRAgTeg2bm/ButmXl1 jy8qgns8kcnWxMlzmsbzPXXwNbxa53VmGO/ukq5z+fx1LDEG7u1I8zFVob8kvd6Tynv3DRVT/Vb LVDF+mq1/Yns9YdX8pSdqby/Q9SkH96aVDC/4XCam1O+YW1CBTEeYHx5a84Zsk9H4UXrXRwXqAz 0im9vULRreT8c4XQFiUDYFoOwooOec5twKf5uncQCjGLyUOnJfXJAdncMSnBUzhKDUgqZz2uBdS bfFD2gSZNclBUd2VaODJklHl0fNfv6XgZa1Z/C+KGAdHB0vJAo27Txh8Dy5s/FsivD3szJx2Xbx H2Id7z1GdPzWBfA== X-Developer-Key: i=tomi.valkeinen+renesas@ideasonboard.com; a=openpgp; fpr=C4380C3E965EFD81079FF3A7FA3DAA8CBC961EF5 Use the new v4l2_subdev_get_frame_desc_passthrough helper for .get_frame_desc. Signed-off-by: Tomi Valkeinen --- drivers/media/i2c/ds90ub913.c | 59 +--------------------------------------= ---- 1 file changed, 1 insertion(+), 58 deletions(-) diff --git a/drivers/media/i2c/ds90ub913.c b/drivers/media/i2c/ds90ub913.c index e97e499b04e6..49aa5f4a172c 100644 --- a/drivers/media/i2c/ds90ub913.c +++ b/drivers/media/i2c/ds90ub913.c @@ -372,63 +372,6 @@ static int ub913_set_routing(struct v4l2_subdev *sd, return _ub913_set_routing(sd, state, routing); } =20 -static int ub913_get_frame_desc(struct v4l2_subdev *sd, unsigned int pad, - struct v4l2_mbus_frame_desc *fd) -{ - struct ub913_data *priv =3D sd_to_ub913(sd); - const struct v4l2_subdev_krouting *routing; - struct v4l2_mbus_frame_desc source_fd; - struct v4l2_subdev_route *route; - struct v4l2_subdev_state *state; - int ret; - - if (pad !=3D UB913_PAD_SOURCE) - return -EINVAL; - - ret =3D v4l2_subdev_call(priv->source_sd, pad, get_frame_desc, - priv->source_sd_pad, &source_fd); - if (ret) - return ret; - - fd->type =3D V4L2_MBUS_FRAME_DESC_TYPE_PARALLEL; - - state =3D v4l2_subdev_lock_and_get_active_state(sd); - - routing =3D &state->routing; - - for_each_active_route(routing, route) { - unsigned int i; - - if (route->source_pad !=3D pad) - continue; - - for (i =3D 0; i < source_fd.num_entries; i++) { - if (source_fd.entry[i].stream =3D=3D route->sink_stream) - break; - } - - if (i =3D=3D source_fd.num_entries) { - dev_err(&priv->client->dev, - "Failed to find stream from source frame desc\n"); - ret =3D -EPIPE; - goto out_unlock; - } - - fd->entry[fd->num_entries].stream =3D route->source_stream; - fd->entry[fd->num_entries].flags =3D source_fd.entry[i].flags; - fd->entry[fd->num_entries].length =3D source_fd.entry[i].length; - fd->entry[fd->num_entries].pixelcode =3D - source_fd.entry[i].pixelcode; - - fd->num_entries++; - } - -out_unlock: - v4l2_subdev_unlock_state(state); - - return ret; -} - static int ub913_set_fmt(struct v4l2_subdev *sd, struct v4l2_subdev_state *state, struct v4l2_subdev_format *format) @@ -544,7 +487,7 @@ static const struct v4l2_subdev_pad_ops ub913_pad_ops = =3D { .enable_streams =3D ub913_enable_streams, .disable_streams =3D ub913_disable_streams, .set_routing =3D ub913_set_routing, - .get_frame_desc =3D ub913_get_frame_desc, + .get_frame_desc =3D v4l2_subdev_get_frame_desc_passthrough, .get_fmt =3D v4l2_subdev_get_fmt, .set_fmt =3D ub913_set_fmt, }; --=20 2.43.0