From: Hans Verkuil <hverkuil@xs4all.nl>
To: Sakari Ailus <sakari.ailus@iki.fi>
Cc: linux-media@vger.kernel.org, m.chehab@samsung.com,
laurent.pinchart@ideasonboard.com, t.stanislaws@samsung.com,
Hans Verkuil <hans.verkuil@cisco.com>
Subject: Re: [RFCv2 PATCH 06/21] v4l2-ctrls: add support for complex types.
Date: Sat, 25 Jan 2014 09:50:18 +0100 [thread overview]
Message-ID: <52E37ACA.1050802@xs4all.nl> (raw)
In-Reply-To: <20140124154431.GD13820@valkosipuli.retiisi.org.uk>
Hi Sakari,
On 01/24/2014 04:44 PM, Sakari Ailus wrote:
> Hi Hans,
>
> On Mon, Jan 20, 2014 at 01:45:59PM +0100, Hans Verkuil wrote:
>> From: Hans Verkuil <hans.verkuil@cisco.com>
>>
>> This patch implements initial support for complex types.
>>
>> For the most part the changes are fairly obvious (basic support for is_ptr
>> types, the type_is_int function is replaced by a is_int bitfield, and
>> v4l2_query_ext_ctrl is added), but one change needs more explanation:
>>
>> The v4l2_ctrl struct adds a 'new' field and a 'stores' array at the end
>> of the struct. This is in preparation for future patches where each control
>> can have multiple configuration stores. The idea is that stores[0] is the current
>> control value, stores[1] etc. are the control values for each configuration store
>> and the 'new' value can be accessed through 'stores[-1]', i.e. the 'new' field.
>> However, for now only stores[-1] and stores[0] is used.
>
> Could we use zero or positive indices only, e.g. the new being zero and
> current 1, or the other way? Or make the "new" value special, i.e. using a
> different field name.
>
> I think accessing the previous struct member by index -1 looks a little bit
> hackish.
I should document this better. Drivers are not expected to use the stores array,
it is for internal use in the control framework only as it allows me to refer to
either the new or the current value by just an array index and later also
configuration stores which will start at index 1 and up, which is where this really
becomes important.
I am not yet adding configuration stores to the control framework as there is not
yet a driver that needs it, and it is for the most part a separate issue anyway.
But this generalization of how values can be accessed makes it much easier to
later add support for configuration stores.
>> These new fields use the v4l2_ctrl_ptr union, which is a pointer to a control
>> value.
>>
>> Note that these two new fields are not yet actually used.
>
> Should they be then added yet in the first place? :-)
Well, they are used a few patches later, but I will see if it makes sense to only
introduce them when they are actually needed.
Regards,
Hans
next prev parent reply other threads:[~2014-01-25 8:50 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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=52E37ACA.1050802@xs4all.nl \
--to=hverkuil@xs4all.nl \
--cc=hans.verkuil@cisco.com \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=m.chehab@samsung.com \
--cc=sakari.ailus@iki.fi \
--cc=t.stanislaws@samsung.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.