All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@iki.fi>
To: Hans Verkuil <hverkuil@xs4all.nl>
Cc: linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com,
	teturtia@gmail.com
Subject: Re: [PATCH 1/1] v4l: Ignore ctrl_class in the control framework
Date: Wed, 11 Jan 2012 01:40:43 +0200	[thread overview]
Message-ID: <4F0CCC7B.801@iki.fi> (raw)
In-Reply-To: <201201102151.43106.hverkuil@xs4all.nl>

Hi Hans,

Hans Verkuil wrote:
> On Tuesday, January 10, 2012 20:14:22 Sakari Ailus wrote:
>> Back in the old days there was probably a reason to require that controls
>> that are being used to access using VIDIOC_{TRY,G,S}_EXT_CTRLS belonged to
>> the same class. These days such reason does not exist, or at least cannot be
>> remembered, and concrete examples of the opposite can be seen: a single
>> (sub)device may well offer controls that belong to different classes and
>> there is no reason to deny changing them atomically.
>>
>> This patch removes the check for v4l2_ext_controls.ctrl_class in the control
>> framework. The control framework issues the s_ctrl() op to the drivers
>> separately so changing the behaviour does not really change how this works
>> from the drivers' perspective.
>
> What is the rationale of this patch? It does change the behavior of the API.
> There are still some drivers that use the extended control API without the
> control framework (pvrusb2, and some other cx2341x-based drivers), and that
> do test the ctrl_class argument.

These drivers still don't use the control framework. I don't see benefit 
in checking the class for those drivers that don't really care about it.

Also, to be able to set controls without artificial limitations 
applications have to set the ctrl_class field on some devices and on 
some they must not.

> I don't see any substantial gain by changing the current behavior of the
> control framework.
>
> Apps can just set ctrl_class to 0 and then the control framework will no
> longer check the control class. And yes, this still has to be properly
> documented in the spec.

That's a good point, indeed. Should the spec then say "on some drivers 
you must set it while on some you must not"? The difficulty, albeit not 
sure if it's a practical one, is that I don't think there's anything 
that would hint applications into which of the two classes a driver 
belongs to.

> The reason for the ctrl_class check is that without the control framework it
> was next to impossible to allow atomic setting of controls of different
> classes, since control of different classes would typically also be handled
> by different drivers. By limiting the controls to one class it made it much
> easier for drivers to implement this API.

Ok. But I don't think this patch would have any effect on those drivers.

Regards,

-- 
Sakari Ailus
sakari.ailus@iki.fi

  reply	other threads:[~2012-01-10 23:40 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-10 19:14 [PATCH 1/1] v4l: Ignore ctrl_class in the control framework Sakari Ailus
2012-01-10 20:51 ` Hans Verkuil
2012-01-10 23:40   ` Sakari Ailus [this message]
2012-01-11  9:36     ` Hans Verkuil

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=4F0CCC7B.801@iki.fi \
    --to=sakari.ailus@iki.fi \
    --cc=hverkuil@xs4all.nl \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-media@vger.kernel.org \
    --cc=teturtia@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 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.