From: "Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>
To: Jacopo Mondi <jacopo@jmondi.org>
Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org
Subject: Re: [PATCH 3/4] rcar-vin: Stop stream when subdevice signal EOS
Date: Fri, 15 Jan 2021 01:17:39 +0100 [thread overview]
Message-ID: <YADfI6uJBmPiEiAr@oden.dyn.berto.se> (raw)
In-Reply-To: <20201116165814.keyj2gydiodphiss@uno.localdomain>
Hi Jacopo,
Thanks for your comments.
On 2020-11-16 17:58:14 +0100, Jacopo Mondi wrote:
> Hi Niklas,
>
> On Thu, Nov 12, 2020 at 11:51:46PM +0100, Niklas Söderlund wrote:
> > When a subdevice signals end of stream stop the VIN in addition to
> > informing user-space of the event.
> >
> > Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
> > ---
> > drivers/media/platform/rcar-vin/rcar-v4l2.c | 16 +++++++++++++++-
> > 1 file changed, 15 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> > index dca3ab1656a66cef..fcaf68c3428b80fd 100644
> > --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c
> > +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c
> > @@ -969,9 +969,23 @@ void rvin_v4l2_unregister(struct rvin_dev *vin)
> > static void rvin_notify_video_device(struct rvin_dev *vin,
> > unsigned int notification, void *arg)
> > {
> > + const struct v4l2_event *event;
> > +
>
> Can this go inside the switch ?
It could but I dislike creating 'case FOO: { }' blocks as I think they
are hard to read and un C like ;-P
>
> > switch (notification) {
> > case V4L2_DEVICE_NOTIFY_EVENT:
> > - v4l2_event_queue(&vin->vdev, arg);
> > + event = arg;
> > +
> > + switch (event->type) {
> > + case V4L2_EVENT_EOS:
>
> As there's only a case where this happen, this could be an if, but I
> see a switch is consistent with the existing one. Up to you.
I been bitten by this in the past so now days I go straight for the
switch() construct :-)
>
> Reviewed-by: Jacopo Mondi <jacopo+renesas@jmondi.org>
Thanks!
>
> Thanks
> j
>
> > + rvin_stop_streaming(vin);
> > + v4l2_info(&vin->v4l2_dev,
> > + "Subdevice signaled end of stream, stopping.\n");
> > + break;
> > + default:
> > + break;
> > + }
> > +
> > + v4l2_event_queue(&vin->vdev, event);
> > break;
> > default:
> > break;
> > --
> > 2.29.2
> >
--
Regards,
Niklas Söderlund
next prev parent reply other threads:[~2021-01-15 0:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-12 22:51 [PATCH 0/4] rcar-csi2: Update handling of transfer error Niklas Söderlund
2020-11-12 22:51 ` [PATCH 1/4] rcar-vin: Do not try to stop stream if not running Niklas Söderlund
2020-11-16 16:28 ` Jacopo Mondi
2021-01-15 0:15 ` Niklas Söderlund
2020-11-12 22:51 ` [PATCH 2/4] rcar-vin: Route events to correct video device Niklas Söderlund
2020-11-16 16:54 ` Jacopo Mondi
2020-11-12 22:51 ` [PATCH 3/4] rcar-vin: Stop stream when subdevice signal EOS Niklas Söderlund
2020-11-16 16:58 ` Jacopo Mondi
2021-01-15 0:17 ` Niklas Söderlund [this message]
2020-11-12 22:51 ` [PATCH 4/4] rcar-csi2: Do not try to recover after transfer error Niklas Söderlund
2020-11-16 17:09 ` Jacopo Mondi
2021-01-15 0:19 ` Niklas Söderlund
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=YADfI6uJBmPiEiAr@oden.dyn.berto.se \
--to=niklas.soderlund+renesas@ragnatech.se \
--cc=jacopo@jmondi.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
/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