From: Tomasz Figa <tfiga@chromium.org> To: Dafna Hirschfeld <dafna.hirschfeld@collabora.com> Cc: linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com, helen.koike@collabora.com, ezequiel@collabora.com, hverkuil@xs4all.nl, kernel@collabora.com, dafna3@gmail.com, sakari.ailus@linux.intel.com, linux-rockchip@lists.infradead.org, mchehab@kernel.org, skhan@linuxfoundation.org, niklas.soderlund@ragnatech.se--annotate Subject: Re: [PATCH v4 4/5] media: staging: rkisp1: cap: use v4l2_pipeline_stream_{enable,disable} helpers Date: Wed, 10 Jun 2020 17:03:44 +0000 Message-ID: <20200610170344.GC201868@chromium.org> (raw) In-Reply-To: <20200522075522.6190-5-dafna.hirschfeld@collabora.com> Hi Dafna, On Fri, May 22, 2020 at 09:55:21AM +0200, Dafna Hirschfeld wrote: > From: Helen Koike <helen.koike@collabora.com> > > Use v4l2_pipeline_stream_{enable,disable} to call .s_stream() > subdevice callbacks through the pipeline. > Those helpers are called only if the other capture is not streaming. > > If the other capture is streaming then he already did that for us > so we call s_stream only on the resizer that is connected to the > capture node. > > Signed-off-by: Helen Koike <helen.koike@collabora.com> > Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com> > --- > drivers/staging/media/rkisp1/rkisp1-capture.c | 104 ++++++------------ > 1 file changed, 32 insertions(+), 72 deletions(-) > Thank you for the patch. Please see my comments inline. [snip] > +static int rkisp1_s_stream_subdev(struct rkisp1_capture *cap, int enable) > +{ > + struct rkisp1_device *rkisp1 = cap->rkisp1; > + struct rkisp1_capture *other = &rkisp1->capture_devs[cap->id ^ 1]; > + int ret; > + > + /* > + * if the other capture is already streaming then we only need to > + * call s_stream of our reszier > + */ > + if (other->is_streaming) { > + struct v4l2_subdev *rsz_sd = &rkisp1->resizer_devs[cap->id].sd; > + > + ret = v4l2_subdev_call(rsz_sd, video, s_stream, enable); > + if (ret && ret != -ENOIOCTLCMD) > + dev_err(rkisp1->dev, > + "stream %s resizer '%s' failed (%d)\n", > + enable ? "on" : "off", rsz_sd->name, ret); Do we need this special case? Wouldn't v4l2_pipeline_stream_*() simply increment reference counters for the other entities? > + } else { > + if (enable) > + ret = v4l2_pipeline_stream_enable(&cap->vnode.vdev); > + else > + ret = v4l2_pipeline_stream_disable(&cap->vnode.vdev); I wonder if this doesn't ask for just making the helper v4l2_pipeline_s_stream(..., int enable). Best regards, Tomasz
next prev parent reply other threads:[~2020-06-10 17:03 UTC|newest] Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-05-22 7:55 [PATCH v4 0/5] media: add v4l2_pipeline_stream_{enable,disable} Dafna Hirschfeld 2020-05-22 7:55 ` [PATCH v4 1/5] media: mc-entity.c: add media_graph_walk_next_stream() Dafna Hirschfeld 2020-05-22 7:55 ` [PATCH v4 2/5] media: v4l2-common: add helper functions to call s_stream() callbacks Dafna Hirschfeld 2020-05-25 9:23 ` Sakari Ailus 2020-05-25 9:42 ` Dafna Hirschfeld 2020-05-25 10:03 ` Sakari Ailus 2020-05-25 10:45 ` Dafna Hirschfeld 2020-06-22 9:20 ` Sakari Ailus 2020-06-22 9:00 ` Hans Verkuil 2020-06-22 14:07 ` Dafna Hirschfeld 2020-05-22 7:55 ` [PATCH v4 3/5] media: staging: rkisp1: validate links before powering and streaming Dafna Hirschfeld 2020-06-10 17:00 ` Tomasz Figa 2020-05-22 7:55 ` [PATCH v4 4/5] media: staging: rkisp1: cap: use v4l2_pipeline_stream_{enable,disable} helpers Dafna Hirschfeld 2020-06-10 17:03 ` Tomasz Figa [this message] 2020-06-10 17:22 ` Dafna Hirschfeld 2020-06-10 17:28 ` Tomasz Figa 2020-05-22 7:55 ` [PATCH v4 5/5] media: vimc: " Dafna Hirschfeld 2020-05-22 9:06 ` [PATCH v4 0/5] media: add v4l2_pipeline_stream_{enable,disable} Helen Koike 2020-05-26 16:11 ` Tomasz Figa 2020-05-26 18:57 ` Laurent Pinchart 2020-05-28 16:21 ` Dafna Hirschfeld 2020-05-29 13:26 ` Tomasz Figa 2020-05-29 13:27 ` Tomasz Figa 2020-05-29 13:49 ` Helen Koike 2020-05-29 14:48 ` Tomasz Figa
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=20200610170344.GC201868@chromium.org \ --to=tfiga@chromium.org \ --cc=dafna.hirschfeld@collabora.com \ --cc=dafna3@gmail.com \ --cc=ezequiel@collabora.com \ --cc=helen.koike@collabora.com \ --cc=hverkuil@xs4all.nl \ --cc=kernel@collabora.com \ --cc=laurent.pinchart@ideasonboard.com \ --cc=linux-media@vger.kernel.org \ --cc=linux-rockchip@lists.infradead.org \ --cc=mchehab@kernel.org \ --cc=niklas.soderlund@ragnatech.se--annotate \ --cc=sakari.ailus@linux.intel.com \ --cc=skhan@linuxfoundation.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
Unnamed repository; edit this file 'description' to name the repository. This inbox may be cloned and mirrored by anyone: git clone --mirror http://archive.lwn.net:8080/linux-media/0 linux-media/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 linux-media linux-media/ http://archive.lwn.net:8080/linux-media \ linux-media@vger.kernel.org lwn-linux-media@archive.lwn.net public-inbox-index linux-media Example config snippet for mirrors. Newsgroup available over NNTP: nntp://archive.lwn.net/lwn.kernel.linux-media AGPL code for this site: git clone https://public-inbox.org/public-inbox.git