From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mailout1.w2.samsung.com ([211.189.100.11]:17092 "EHLO usmailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752481AbaCLOUI (ORCPT ); Wed, 12 Mar 2014 10:20:08 -0400 Received: from uscpsbgm1.samsung.com (u114.gpu85.samsung.co.kr [203.254.195.114]) by mailout1.w2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N2B00LC1UHITXA0@mailout1.w2.samsung.com> for linux-media@vger.kernel.org; Wed, 12 Mar 2014 10:20:06 -0400 (EDT) Date: Wed, 12 Mar 2014 11:20:00 -0300 From: Mauro Carvalho Chehab To: Hans Verkuil Cc: linux-media@vger.kernel.org, laurent.pinchart@ideasonboard.com, s.nawrocki@samsung.com, ismael.luceno@corp.bluecherry.net, pete@sensoray.com, sakari.ailus@iki.fi, Hans Verkuil Subject: Re: [REVIEWv3 PATCH 20/35] DocBook media: update VIDIOC_G/S/TRY_EXT_CTRLS. Message-id: <20140312112000.54ffb496@samsung.com> In-reply-to: <1392631070-41868-21-git-send-email-hverkuil@xs4all.nl> References: <1392631070-41868-1-git-send-email-hverkuil@xs4all.nl> <1392631070-41868-21-git-send-email-hverkuil@xs4all.nl> MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit Sender: linux-media-owner@vger.kernel.org List-ID: Em Mon, 17 Feb 2014 10:57:35 +0100 Hans Verkuil escreveu: > From: Hans Verkuil > > Document the support for the new complex type controls. > > Signed-off-by: Hans Verkuil > --- > .../DocBook/media/v4l/vidioc-g-ext-ctrls.xml | 43 ++++++++++++++++++---- > 1 file changed, 35 insertions(+), 8 deletions(-) > > diff --git a/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml b/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml > index b3bb957..d946d6b 100644 > --- a/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml > +++ b/Documentation/DocBook/media/v4l/vidioc-g-ext-ctrls.xml > @@ -72,23 +72,30 @@ initialize the id, > size and reserved2 fields > of each &v4l2-ext-control; and call the > VIDIOC_G_EXT_CTRLS ioctl. String controls controls > -must also set the string field. > +must also set the string field. Controls > +of complex types (V4L2_CTRL_FLAG_IS_PTR is set) > +must set the p field. Same notes I did to the other patches apply here: - s/complex/compound/ - Let's not mix strings with compound types - etc > If the size is too small to > receive the control result (only relevant for pointer-type controls > like strings), then the driver will set size > to a valid value and return an &ENOSPC;. You should re-allocate the > -string memory to this new size and try again. It is possible that the > -same issue occurs again if the string has grown in the meantime. It is > +memory to this new size and try again. For the string type it is possible that > +the same issue occurs again if the string has grown in the meantime. It is > recommended to call &VIDIOC-QUERYCTRL; first and use > maximum+1 as the new size > value. It is guaranteed that that is sufficient memory. > > > + Matrices are set and retrieved row-by-row. You cannot set a partial > +matrix, all elements have to be set or retrieved. The total size is calculated > +as rows * cols * elem_size. > +These values can be obtained by calling &VIDIOC-QUERY-EXT-CTRL;. > + > To change the value of a set of controls applications > initialize the id, size, > reserved2 and > -value/string fields of each &v4l2-ext-control; and > +value/value64/string/p fields of each &v4l2-ext-control; and > call the VIDIOC_S_EXT_CTRLS ioctl. The controls > will only be set if all control values are > valid. > @@ -96,11 +103,17 @@ valid. > To check if a set of controls have correct values applications > initialize the id, size, > reserved2 and > -value/string fields of each &v4l2-ext-control; and > +value/value64/string/p fields of each &v4l2-ext-control; and > call the VIDIOC_TRY_EXT_CTRLS ioctl. It is up to > the driver whether wrong values are automatically adjusted to a valid > value or if an error is returned. > > + For matrices it is possible to only set or check only the first > +X elements by setting size to X * elem_size, > +where elem_size is obtained by calling &VIDIOC-QUERY-EXT-CTRL;. > +Matrix elements are set row-by-row. Matrix elements that are not explicitly > +set will be initialized to their default value. > + That sounds confusing: what are the defaults? Also, what happens if the size is set to, let's say, 1,5 * elem_size? Will it fill one element, will it return an error (what error?) or will it fill two elements, the second one with some wrong value? > When the id or > ctrl_class is invalid drivers return an > &EINVAL;. When the value is out of bounds drivers can choose to take > @@ -158,19 +171,33 @@ applications must set the array to zero. > > __s32 > value > - New value or current value. > + New value or current value. Valid if this control is not of > +type V4L2_CTRL_TYPE_INTEGER64 and > +V4L2_CTRL_FLAG_IS_PTR is not set. > > > > __s64 > value64 > - New value or current value. > + New value or current value. Valid if this control is of > +type V4L2_CTRL_TYPE_INTEGER64 and > +V4L2_CTRL_FLAG_IS_PTR is not set. > > > > char * > string > - A pointer to a string. > + A pointer to a string. Valid if this control is of > +type V4L2_CTRL_TYPE_STRING. > + > + > + > + void * > + p > + A pointer to a complex type which can be a matrix and/or a > +complex type (the control's type is >= V4L2_CTRL_COMPLEX_TYPES). > +Valid if V4L2_CTRL_FLAG_IS_PTR is set for this control. > + > > > -- Regards, Mauro