[PATCH 2/3] media: imx-csi: explicitly start media pipeline on pad 0
Frank Li
Frank.li at nxp.com
Fri Nov 7 08:12:21 PST 2025
On Fri, Nov 07, 2025 at 11:16:34AM +0100, Michael Tretter wrote:
> entity->pads is an array that contains all the pads of an entity.
>
> Calling __media_pipeline_start() or __media_pipeline_stop() on the pads,
> implicitly starts the pipeline with the first pad in this array as
> origin.
>
> Explicitly use the first pad to start the pipeline to make this more
> obvious to the reader.
>
> Signed-off-by: Michael Tretter <m.tretter at pengutronix.de>
> ---
> drivers/staging/media/imx/imx-media-utils.c | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/media/imx/imx-media-utils.c b/drivers/staging/media/imx/imx-media-utils.c
> index f520529a7cfe..6d69f69c16c1 100644
> --- a/drivers/staging/media/imx/imx-media-utils.c
> +++ b/drivers/staging/media/imx/imx-media-utils.c
> @@ -755,6 +755,7 @@ int imx_media_pipeline_set_stream(struct imx_media_dev *imxmd,
> {
> struct v4l2_subdev *sd;
> int ret = 0;
> + struct media_pad *pad;
nit: move struct media_pad *pad; before int ret = 0; for better read
Reviewed-by: Frank Li <Frank.Li at nxp.com>
>
> if (!is_media_entity_v4l2_subdev(entity))
> return -EINVAL;
> @@ -762,17 +763,19 @@ int imx_media_pipeline_set_stream(struct imx_media_dev *imxmd,
>
> mutex_lock(&imxmd->md.graph_mutex);
>
> + pad = &entity->pads[0];
> +
> if (on) {
> - ret = __media_pipeline_start(entity->pads, &vdev->pipe);
> + ret = __media_pipeline_start(pad, &vdev->pipe);
> if (ret)
> goto out;
> ret = v4l2_subdev_call(sd, video, s_stream, 1);
> if (ret)
> - __media_pipeline_stop(entity->pads);
> + __media_pipeline_stop(pad);
> } else {
> v4l2_subdev_call(sd, video, s_stream, 0);
> - if (media_pad_pipeline(entity->pads))
> - __media_pipeline_stop(entity->pads);
> + if (media_pad_pipeline(pad))
> + __media_pipeline_stop(pad);
> }
>
> out:
>
> --
> 2.47.3
>
More information about the linux-arm-kernel
mailing list