From: Robert Foss <robert.foss@linaro.org>
To: quic_mmitkov@quicinc.com
Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
akapatra@quicinc.com, jzala@quicinc.com, todor.too@gmail.com,
agross@kernel.org, bjorn.andersson@linaro.org,
konrad.dybcio@somainline.org, mchehab@kernel.org,
bryan.odonoghue@linaro.org, cgera@qti.qualcomm.com,
gchinnab@quicinc.com, ayasan@qti.qualcomm.com
Subject: Re: [PATCH v3 4/4] media: camss: sm8250: Pipeline starting and stopping for multiple virtual channels
Date: Thu, 13 Oct 2022 10:43:59 +0200 [thread overview]
Message-ID: <CAG3jFyurUzHruDxCt33A+YPyqjhgk6u1tctbL+97GuTmZOyaqw@mail.gmail.com> (raw)
In-Reply-To: <20221007132009.1886-5-quic_mmitkov@quicinc.com>
On Fri, 7 Oct 2022 at 15:20, <quic_mmitkov@quicinc.com> wrote:
>
> From: Milen Mitkov <quic_mmitkov@quicinc.com>
>
> Use the multistream series function video_device_pipeline_alloc_start
> to allows multiple clients of the same pipeline.
>
> If any of the entities in the pipeline doesn't return success at stop
> (e.g. if a VFE line remains running), the full pipeline won't be stopped.
> This allows for stopping and starting streams at any point without
> disrupting the other running streams.
>
> Signed-off-by: Milen Mitkov <quic_mmitkov@quicinc.com>
> ---
> .../media/platform/qcom/camss/camss-video.c | 21 ++++++++++++++++---
> 1 file changed, 18 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/media/platform/qcom/camss/camss-video.c b/drivers/media/platform/qcom/camss/camss-video.c
> index 81fb3a5bc1d5..b042faf3dcda 100644
> --- a/drivers/media/platform/qcom/camss/camss-video.c
> +++ b/drivers/media/platform/qcom/camss/camss-video.c
> @@ -353,6 +353,7 @@ static int video_get_subdev_format(struct camss_video *video,
>
> fmt.pad = pad;
> fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE;
> + fmt.stream = 0;
>
> ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &fmt);
> if (ret)
> @@ -493,9 +494,11 @@ static int video_start_streaming(struct vb2_queue *q, unsigned int count)
> struct v4l2_subdev *subdev;
> int ret;
>
> - ret = video_device_pipeline_start(vdev, &video->pipe);
> - if (ret < 0)
> + ret = video_device_pipeline_alloc_start(vdev);
> + if (ret < 0) {
> + dev_err(video->camss->dev, "Failed to start media pipeline: %d\n", ret);
> return ret;
> + }
>
> ret = video_check_format(video);
> if (ret < 0)
> @@ -536,6 +539,7 @@ static void video_stop_streaming(struct vb2_queue *q)
> struct media_entity *entity;
> struct media_pad *pad;
> struct v4l2_subdev *subdev;
> + int ret;
>
> entity = &vdev->entity;
> while (1) {
> @@ -550,7 +554,18 @@ static void video_stop_streaming(struct vb2_queue *q)
> entity = pad->entity;
> subdev = media_entity_to_v4l2_subdev(entity);
>
> - v4l2_subdev_call(subdev, video, s_stream, 0);
> + ret = v4l2_subdev_call(subdev, video, s_stream, 0);
> +
> + if (ret == -EBUSY) {
> + /* Don't stop if other instances of the pipeline are still running */
> + dev_dbg(video->camss->dev, "Video pipeline still used, don't stop streaming.\n");
> + return;
> + }
> +
> + if (ret) {
> + dev_err(video->camss->dev, "Video pipeline stop failed: %d\n", ret);
> + return;
> + }
> }
>
> video_device_pipeline_stop(vdev);
> --
> 2.37.3
>
Reviewed-by: Robert Foss <robert.foss@linaro.org>
prev parent reply other threads:[~2022-10-13 8:44 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-07 13:20 [PATCH v3 0/4] media: camss: sm8250: Virtual channels support for SM8250 quic_mmitkov
2022-10-07 13:20 ` [PATCH v3 1/4] media: camss: sm8250: Virtual channels for CSID quic_mmitkov
2022-10-07 13:20 ` [PATCH v3 2/4] media: camss: vfe: Reserve VFE lines on stream start and link to CSID quic_mmitkov
2022-10-07 13:20 ` [PATCH v3 3/4] media: camss: vfe-480: Multiple outputs support for SM8250 quic_mmitkov
2022-10-07 13:20 ` [PATCH v3 4/4] media: camss: sm8250: Pipeline starting and stopping for multiple virtual channels quic_mmitkov
2022-10-07 14:44 ` Bryan O'Donoghue
2022-10-13 8:43 ` Robert Foss [this message]
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=CAG3jFyurUzHruDxCt33A+YPyqjhgk6u1tctbL+97GuTmZOyaqw@mail.gmail.com \
--to=robert.foss@linaro.org \
--cc=agross@kernel.org \
--cc=akapatra@quicinc.com \
--cc=ayasan@qti.qualcomm.com \
--cc=bjorn.andersson@linaro.org \
--cc=bryan.odonoghue@linaro.org \
--cc=cgera@qti.qualcomm.com \
--cc=gchinnab@quicinc.com \
--cc=jzala@quicinc.com \
--cc=konrad.dybcio@somainline.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=quic_mmitkov@quicinc.com \
--cc=todor.too@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;
as well as URLs for NNTP newsgroup(s).