linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFCv2 PATCH 00/21] Add support for complex controls
@ 2014-01-20 12:45 Hans Verkuil
  2014-01-20 12:45 ` [RFCv2 PATCH 01/21] v4l2-ctrls: increase internal min/max/step/def to 64 bit Hans Verkuil
                   ` (21 more replies)
  0 siblings, 22 replies; 56+ messages in thread
From: Hans Verkuil @ 2014-01-20 12:45 UTC (permalink / raw)
  To: linux-media; +Cc: m.chehab, laurent.pinchart, t.stanislaws

This patch series adds support for complex controls (aka 'Properties') to
the control framework. It is the first part of a larger patch series that
adds support for configuration stores, motion detection matrix controls and
support for 'Multiple Selections'.

This patch series is based on this RFC:

http://permalink.gmane.org/gmane.linux.drivers.video-input-infrastructure/71822

A more complete patch series (including configuration store support and the
motion detection work) can be found here:

http://git.linuxtv.org/hverkuil/media_tree.git/shortlog/refs/heads/propapi-doc

This patch series is a revision of this series:

http://www.spinics.net/lists/linux-media/msg71281.html

Changes since RFCv1 are:

- dropped configuration store support for now (there is no driver at the moment
  that needs it).
- dropped the term 'property', instead call it a 'control with a complex type'
  or 'complex control' for short.
- added DocBook documentation.

The API changes required to support complex controls are minimal:

- A new V4L2_CTRL_FLAG_HIDDEN has been added: any control with this flag (and
  complex controls will always have this flag) will never be shown by control
  panel GUIs. The only way to discover them is to pass the new _FLAG_NEXT_HIDDEN
  flag to QUERYCTRL.

- A new VIDIOC_QUERY_EXT_CTRL ioctl has been added: needed to get the number of elements
  stored in the control (rows by columns) and the size in byte of each element.
  As a bonus feature a unit string has also been added as this has been requested
  in the past. In addition min/max/step/def values are now 64-bit.

- A new 'p' field is added to struct v4l2_ext_control to set/get complex values.

- A helper flag V4L2_CTRL_FLAG_IS_PTR has been added to tell apps whether the
  'value' or 'value64' fields of the v4l2_ext_control struct can be used (bit
  is cleared) or if the 'p' pointer can be used (bit it set).

There is one open item: if a complex control is a matrix, then it is possible
to set only the first N elements of that matrix (starting at the first row).
Currently the API will initialize the remaining elements to their default
value. The idea was that if you have an array of, say, selection
rectangles, then if you just set the first one the others will be automatically
zeroed (i.e. set to unused). Without that you would be forced to set the whole
array unless you are certain that they are already zeroed.

It also has the advantage that when you set a control you know that all elements
are set, even if you don't specify them all.

Should I support the ability to set only the first N elements of a matrix at all?

I see three options:

1) allow getting/setting only the first N elements and (when setting) initialize
   the remaining elements to their default value.
2) allow getting/setting only the first N elements and leave the remaining
   elements to their old value.
3) always set the full matrix.

I am actually leaning towards 3 as that is the only unambiguous option. If there
is a good use case in the future support for 1 or 2 can always be added later.

Once everyone agrees with this API extension I will make a third version of this
patch series that adds the Motion Detection support for the solo6x10 and go7007
drivers that can now use the new matrix controls. That way actual drivers will
start using this (and it will allow me to move those drivers out of staging).

Regards,

	Hans


^ permalink raw reply	[flat|nested] 56+ messages in thread

end of thread, other threads:[~2014-01-25  9:00 UTC | newest]

Thread overview: 56+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-20 12:45 [RFCv2 PATCH 00/21] Add support for complex controls Hans Verkuil
2014-01-20 12:45 ` [RFCv2 PATCH 01/21] v4l2-ctrls: increase internal min/max/step/def to 64 bit Hans Verkuil
2014-01-22 22:45   ` Sylwester Nawrocki
2014-01-20 12:45 ` [RFCv2 PATCH 02/21] v4l2-ctrls: add unit string Hans Verkuil
2014-01-22 22:47   ` Sylwester Nawrocki
2014-01-24 10:35   ` Sakari Ailus
2014-01-24 11:19     ` Hans Verkuil
2014-01-24 15:54       ` Sakari Ailus
2014-01-25  9:00         ` Hans Verkuil
2014-01-20 12:45 ` [RFCv2 PATCH 03/21] v4l2-ctrls: use pr_info/cont instead of printk Hans Verkuil
2014-01-22 22:48   ` Sylwester Nawrocki
2014-01-20 12:45 ` [RFCv2 PATCH 04/21] videodev2.h: add initial support for complex controls Hans Verkuil
2014-01-22 22:55   ` Sylwester Nawrocki
2014-01-20 12:45 ` [RFCv2 PATCH 05/21] videodev2.h: add struct v4l2_query_ext_ctrl and VIDIOC_QUERY_EXT_CTRL Hans Verkuil
2014-01-22 23:02   ` Sylwester Nawrocki
2014-01-23 14:23     ` Hans Verkuil
2014-01-23 15:05       ` Sylwester Nawrocki
2014-01-24 11:28   ` Sakari Ailus
2014-01-24 11:58     ` Hans Verkuil
2014-01-20 12:45 ` [RFCv2 PATCH 06/21] v4l2-ctrls: add support for complex types Hans Verkuil
2014-01-23 11:44   ` Sylwester Nawrocki
2014-01-24 15:44   ` Sakari Ailus
2014-01-25  8:50     ` Hans Verkuil
2014-01-20 12:46 ` [RFCv2 PATCH 07/21] v4l2: integrate support for VIDIOC_QUERY_EXT_CTRL Hans Verkuil
2014-01-23 11:44   ` Sylwester Nawrocki
2014-01-20 12:46 ` [RFCv2 PATCH 08/21] v4l2-ctrls: create type_ops Hans Verkuil
2014-01-23 14:23   ` Sylwester Nawrocki
2014-01-24 15:46   ` Sakari Ailus
2014-01-25  8:54     ` Hans Verkuil
2014-01-20 12:46 ` [RFCv2 PATCH 09/21] v4l2-ctrls: rewrite copy routines to operate on union v4l2_ctrl_ptr Hans Verkuil
2014-01-24 12:31   ` Sakari Ailus
2014-01-24 12:44     ` Hans Verkuil
2014-01-20 12:46 ` [RFCv2 PATCH 10/21] v4l2-ctrls: compare values only once Hans Verkuil
2014-01-23 14:30   ` Sylwester Nawrocki
2014-01-20 12:46 ` [RFCv2 PATCH 11/21] v4l2-ctrls: prepare for matrix support: add cols & rows fields Hans Verkuil
2014-01-23 13:46   ` Sylwester Nawrocki
2014-01-20 12:46 ` [RFCv2 PATCH 12/21] v4l2-ctrls: replace cur by a union v4l2_ctrl_ptr Hans Verkuil
2014-01-23 15:47   ` Sylwester Nawrocki
2014-01-20 12:46 ` [RFCv2 PATCH 13/21] v4l2-ctrls: use 'new' to access pointer controls Hans Verkuil
2014-01-23 17:06   ` Sylwester Nawrocki
2014-01-20 12:46 ` [RFCv2 PATCH 14/21] v4l2-ctrls: prepare for matrix support Hans Verkuil
2014-01-20 12:46 ` [RFCv2 PATCH 15/21] v4l2-ctrls: type_ops can handle matrix elements Hans Verkuil
2014-01-20 12:46 ` [RFCv2 PATCH 16/21] v4l2-ctrls: add matrix support Hans Verkuil
2014-01-20 12:46 ` [RFCv2 PATCH 17/21] v4l2-ctrls.c: return elem_size instead of strlen Hans Verkuil
2014-01-23 13:46   ` Sylwester Nawrocki
2014-01-20 12:46 ` [RFCv2 PATCH 18/21] DocBook media: document VIDIOC_QUERY_EXT_CTRL Hans Verkuil
2014-01-23 17:24   ` Sylwester Nawrocki
2014-01-20 12:46 ` [RFCv2 PATCH 19/21] DocBook media: update VIDIOC_G/S/TRY_EXT_CTRLS Hans Verkuil
2014-01-23 13:46   ` Sylwester Nawrocki
2014-01-23 14:16     ` Hans Verkuil
2014-01-20 12:46 ` [RFCv2 PATCH 20/21] DocBook media: update control section Hans Verkuil
2014-01-23 15:34   ` Sylwester Nawrocki
2014-01-20 12:46 ` [RFCv2 PATCH 21/21] v4l2-controls.txt: update to the new way of accessing controls Hans Verkuil
2014-01-23 15:50   ` Sylwester Nawrocki
2014-01-22 22:44 ` [RFCv2 PATCH 00/21] Add support for complex controls Sylwester Nawrocki
2014-01-23 11:49   ` Hans Verkuil

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).