summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com>2025-03-24 10:04:44 +0200
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2026-03-11 01:05:31 +0100
commita564839e630c11b089470d2e010b0019b7cf61bc (patch)
treeb9392eff90d82dceeb20a8d37b170cbd30ab2e12 /include
parent291d75952cf7e6801fe02c62ad694d50dc64e56b (diff)
media: subdev: Add v4l2_subdev_get_frame_desc_passthrough helper
Add a helper for v4l2_subdev_pad_ops.v4l2_get_frame_desc operation. The helper can be used when the subdevice directly passes through the streams. Signed-off-by: Tomi Valkeinen <tomi.valkeinen+renesas@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Diffstat (limited to 'include')
-rw-r--r--include/media/v4l2-subdev.h22
1 files changed, 22 insertions, 0 deletions
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index a37d9a847196..e754ed3421c5 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -1722,6 +1722,28 @@ int v4l2_subdev_disable_streams(struct v4l2_subdev *sd, u32 pad,
*/
int v4l2_subdev_s_stream_helper(struct v4l2_subdev *sd, int enable);
+/**
+ * v4l2_subdev_get_frame_desc_passthrough() - Helper to implement the subdev
+ * v4l2_get_frame_desc operation in simple passthrough cases
+ * @sd: The subdevice
+ * @pad: The source pad index
+ * @fd: The mbus frame desc
+ *
+ * Subdevice drivers that only pass through the streams can use this helper
+ * to implement the &v4l2_subdev_pad_ops.v4l2_get_frame_desc operation.
+ *
+ * The helper will call get_frame_desc on the subdevice's sources, create a new
+ * frame desc which contains only the streams on the given source pad. The data
+ * for each frame desc entry is copied directly from the data provided from the
+ * calls to the subdevice's sources, with the exception of the 'stream' field
+ * which is set according to the subdevice's routing table.
+ *
+ * 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 */
#endif /* CONFIG_MEDIA_CONTROLLER */