From patchwork Sat Mar 21 00:36:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 3234 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id EEE7C60417 for ; Sat, 21 Mar 2020 01:36:52 +0100 (CET) Received: from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi [81.175.216.236]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 7FAEBA54; Sat, 21 Mar 2020 01:36:52 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1584751012; bh=wHcC7cWqXvwgldOyvO5EGAqqYYZ0qOeXWPOK7SkEouM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ETU7wEVNwqV65fOIup7FYnoPceC5tHI1gpk6jvg6N/4dovKzAh5aTVo+Jm12Yjc8u +XfqvP5NJwH/oQHAUayoToDBZobESVnX4AVmqpAVRuq+XImWpmTmEq63gK4+rzbI2q p8dFMI6w8zStY0uFrfPOKJTDFVoxJlj9PBywpnyA= From: Laurent Pinchart To: libcamera-devel@lists.libcamera.org Date: Sat, 21 Mar 2020 02:36:39 +0200 Message-Id: <20200321003640.2156-7-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200321003640.2156-1-laurent.pinchart@ideasonboard.com> References: <20200321003640.2156-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 6/7] 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: Sat, 21 Mar 2020 00:36:53 -0000 From: Jacopo Mondi 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 3c91eb3f9f97..03e305165096 100644 --- a/src/libcamera/v4l2_device.cpp +++ b/src/libcamera/v4l2_device.cpp @@ -386,7 +386,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; @@ -394,13 +395,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: @@ -409,8 +403,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)