From: Sakari Ailus <sakari.ailus@iki.fi>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Linux Media Mailing List <linux-media@vger.kernel.org>,
Hans Verkuil <hans.verkuil@cisco.com>
Subject: Re: [PATCH 1/3] media-ctl: libv4l2subdev: Add DV timings support
Date: Wed, 04 Jun 2014 01:02:42 +0300 [thread overview]
Message-ID: <538E4602.6070706@iki.fi> (raw)
In-Reply-To: <1895886.LJyZrLTVV4@avalon>
Hi Laurent,
Laurent Pinchart wrote:
> Hi Sakari,
>
> On Tuesday 03 June 2014 15:32:24 Sakari Ailus wrote:
>> On Mon, Jun 02, 2014 at 05:10:02PM +0200, Laurent Pinchart wrote:
>>> Expose the pad-level get caps, query, get and set DV timings ioctls.
>>>
>>> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>>> ---
>>>
>>> utils/media-ctl/libv4l2subdev.c | 72 ++++++++++++++++++++++++++++++++++++
>>> utils/media-ctl/v4l2subdev.h | 53 ++++++++++++++++++++++++++++++
>>> 2 files changed, 125 insertions(+)
>>>
>>> diff --git a/utils/media-ctl/libv4l2subdev.c
>>> b/utils/media-ctl/libv4l2subdev.c index 14daffa..8015330 100644
>>> --- a/utils/media-ctl/libv4l2subdev.c
>>> +++ b/utils/media-ctl/libv4l2subdev.c
>>> @@ -189,6 +189,78 @@ int v4l2_subdev_set_selection(struct media_entity
>>> *entity,
>>> return 0;
>>> }
>>>
>>> +int v4l2_subdev_get_dv_timings_caps(struct media_entity *entity,
>>> + struct v4l2_dv_timings_cap *caps)
>>> +{
>>> + unsigned int pad = caps->pad;
>>> + int ret;
>>> +
>>> + ret = v4l2_subdev_open(entity);
>>> + if (ret < 0)
>>> + return ret;
>>
>> In every function v4l2_subdev_open() is called before the ioctl command. How
>> about implementing a wrapper which does both, and using that before this
>> patch?
>
> I'm not too fond of the current subdev API. Subdevs are opened implicitly but
> must be closed explicitly. Implicit open is of course easy, but the unbalanced
> API makes me feel uneasy. I'm open to ideas for better alternatives :-)
I had a patch to reference count v4l2_subdev_open() (and close()), but
it didn't get applied back in 2012. And... apparently the reason for
that was that it didn't, well, apply. :-)
<URL:http://www.spinics.net/lists/linux-media/msg52258.html>
I'll resend it.
--
Sakari Ailus
sakari.ailus@iki.fi
next prev parent reply other threads:[~2014-06-03 22:02 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-02 15:10 [PATCH 0/3] v4l-utils: media-ctl: Add DV timings support Laurent Pinchart
2014-06-02 15:10 ` [PATCH 1/3] media-ctl: libv4l2subdev: " Laurent Pinchart
2014-06-03 12:32 ` Sakari Ailus
2014-06-03 17:10 ` Laurent Pinchart
2014-06-03 22:02 ` Sakari Ailus [this message]
2014-06-02 15:10 ` [PATCH 2/3] media-ctl: Move flags printing code to a new print_flags function Laurent Pinchart
2014-06-02 15:10 ` [PATCH 3/3] media-ctl: Add DV timings support Laurent Pinchart
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=538E4602.6070706@iki.fi \
--to=sakari.ailus@iki.fi \
--cc=hans.verkuil@cisco.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.