From patchwork Mon Mar 9 16:24:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 3075 Return-Path: Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 00B9362938 for ; Mon, 9 Mar 2020 17:21:32 +0100 (CET) X-Originating-IP: 93.34.114.233 Received: from uno.lan (93-34-114-233.ip49.fastwebnet.it [93.34.114.233]) (Authenticated sender: jacopo@jmondi.org) by relay3-d.mail.gandi.net (Postfix) with ESMTPSA id B7E4C60008 for ; Mon, 9 Mar 2020 16:21:31 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Mon, 9 Mar 2020 17:24:13 +0100 Message-Id: <20200309162414.720306-11-jacopo@jmondi.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200309162414.720306-1-jacopo@jmondi.org> References: <20200309162414.720306-1-jacopo@jmondi.org> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 10/11] libcamera: v4l2_device: Enable enumeration of U8 controls X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2020 16:21:33 -0000 Enable the enumeration of V4L2 array controls with V4L2_CTRL_TYPE_U8 type. Signed-off-by: Jacopo Mondi Reviewed-by: Laurent Pinchart --- src/libcamera/v4l2_device.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp index 464df6a1fe18..a36c121aa62a 100644 --- a/src/libcamera/v4l2_device.cpp +++ b/src/libcamera/v4l2_device.cpp @@ -388,7 +388,8 @@ void V4L2Device::listControls() /* \todo Add support for menu and compound controls. */ while (1) { - ctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL; + ctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL | + V4L2_CTRL_FLAG_NEXT_COMPOUND; if (ioctl(VIDIOC_QUERY_EXT_CTRL, &ctrl)) break; @@ -396,13 +397,6 @@ void V4L2Device::listControls() ctrl.flags & V4L2_CTRL_FLAG_DISABLED) continue; - if (ctrl.elems != 1 || ctrl.nr_of_dims) { - LOG(V4L2, Debug) - << "Array control " << utils::hex(ctrl.id) - << " not supported"; - continue; - } - switch (ctrl.type) { case V4L2_CTRL_TYPE_INTEGER: case V4L2_CTRL_TYPE_BOOLEAN: @@ -411,8 +405,9 @@ void V4L2Device::listControls() case V4L2_CTRL_TYPE_INTEGER64: case V4L2_CTRL_TYPE_BITMASK: case V4L2_CTRL_TYPE_INTEGER_MENU: + case V4L2_CTRL_TYPE_U8: break; - /* \todo Support compound controls. */ + /* \todo Support other control types. */ default: LOG(V4L2, Debug) << "Control " << utils::hex(ctrl.id)