From: Philipp Zabel <p.zabel@pengutronix.de>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org,
Steve Longerbeam <slongerbeam@gmail.com>,
Peter Rosin <peda@axentia.se>, Pavel Machek <pavel@ucw.cz>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>,
kernel@pengutronix.de, Sascha Hauer <s.hauer@pengutronix.de>,
Steve Longerbeam <steve_longerbeam@mentor.com>
Subject: Re: [PATCH v2 2/2] [media] platform: add video-multiplexer subdevice driver
Date: Thu, 04 May 2017 09:07:32 +0200 [thread overview]
Message-ID: <1493881652.2381.6.camel@pengutronix.de> (raw)
In-Reply-To: <20170503192836.GN7456@valkosipuli.retiisi.org.uk>
On Wed, 2017-05-03 at 22:28 +0300, Sakari Ailus wrote:
> Hi Philipp,
>
> Thanks for continuing working on this!
>
> I have some minor comments below...
Thank you for the comments.
[...]
> Could you rebase this on the V4L2 fwnode patchset here, please?
>
> <URL:https://git.linuxtv.org/sailus/media_tree.git/log/?h=v4l2-acpi>
>
> The conversion is rather simple, as shown here:
>
> <URL:https://git.linuxtv.org/sailus/media_tree.git/commit/?h=v4l2-acpi&id=679035e11bfdbea146fed5d52fb794b34dc9cea6>
What is the status of this patchset? Will this be merged soon?
[...]
> > +static inline bool is_source_pad(struct video_mux *vmux, unsigned int pad)
>
> It's a common practice to test pad flags rather than the pad number.
> Although the pad number here implicitly tells this, too, testing pad flags
> is cleaner.
>
> The matter was discussed in the past and it was decided not to add helper
> functions to the framework for the purpose as testing the flags is trivial.
Ok, I'll drop is_source_pad and check (pad->flags & MEDIA_PAD_FL_SOURCE)
instead in the next version.
[...]
> > +static int video_mux_set_format(struct v4l2_subdev *sd,
> > + struct v4l2_subdev_pad_config *cfg,
> > + struct v4l2_subdev_format *sdformat)
> > +{
> > + struct video_mux *vmux = v4l2_subdev_to_video_mux(sd);
> > + struct v4l2_mbus_framefmt *mbusformat;
> > +
> > + mbusformat = __video_mux_get_pad_format(sd, cfg, sdformat->pad,
> > + sdformat->which);
> > + if (!mbusformat)
> > + return -EINVAL;
> > +
> > + mutex_lock(&vmux->lock);
> > +
> > + /* Source pad mirrors active sink pad, no limitations on sink pads */
> > + if (is_source_pad(vmux, sdformat->pad) && vmux->active >= 0)
> > + sdformat->format = vmux->format_mbus[vmux->active];
> > +
> > + mutex_unlock(&vmux->lock);
> > +
> > + *mbusformat = sdformat->format;
>
> Shouldn't you do this before releasing the mutex? The assignment won't be
> an atomic operation. Same for get_format; you should take the mutex.
Yes, I'll extend the mutex to cover the mbus formats.
[...]
> > +static struct v4l2_subdev_pad_ops video_mux_pad_ops = {
> > + .get_fmt = video_mux_get_format,
> > + .set_fmt = video_mux_set_format,
> > +};
> > +
> > +static struct v4l2_subdev_ops video_mux_subdev_ops = {
>
> Const for both of the structs?
Will do, thanks.
regards
Philipp
next prev parent reply other threads:[~2017-05-04 7:07 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-02 15:09 [PATCH v2 1/2] [media] dt-bindings: Add bindings for video-multiplexer device Philipp Zabel
2017-05-02 15:09 ` [PATCH v2 2/2] [media] platform: add video-multiplexer subdevice driver Philipp Zabel
2017-05-03 19:28 ` Sakari Ailus
2017-05-04 7:07 ` Philipp Zabel [this message]
2017-05-04 7:17 ` Sakari Ailus
2017-05-04 9:26 ` Philipp Zabel
2017-05-04 9:48 ` Sakari Ailus
2017-05-04 10:03 ` Philipp Zabel
2017-05-03 19:30 ` [PATCH v2 1/2] [media] dt-bindings: Add bindings for video-multiplexer device Sakari Ailus
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=1493881652.2381.6.camel@pengutronix.de \
--to=p.zabel@pengutronix.de \
--cc=devicetree@vger.kernel.org \
--cc=kernel@pengutronix.de \
--cc=linux-media@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=pavel@ucw.cz \
--cc=peda@axentia.se \
--cc=robh+dt@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=sakari.ailus@iki.fi \
--cc=slongerbeam@gmail.com \
--cc=steve_longerbeam@mentor.com \
--cc=vladimir_zapolskiy@mentor.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).