[{"id":4159,"web_url":"https://patchwork.libcamera.org/comment/4159/","msgid":"<20200320215606.GU5193@pendragon.ideasonboard.com>","date":"2020-03-20T21:56:06","subject":"Re: [libcamera-devel] [PATCH 10/11] libcamera: v4l2_device: Enable\n\tenumeration of U8 controls","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Jacopo,\n\nThank you for the patch.\n\nOn Mon, Mar 09, 2020 at 05:24:13PM +0100, Jacopo Mondi wrote:\n> Enable the enumeration of V4L2 array controls with V4L2_CTRL_TYPE_U8\n> type.\n> \n> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>\n> ---\n>  src/libcamera/v4l2_device.cpp | 13 ++++---------\n>  1 file changed, 4 insertions(+), 9 deletions(-)\n> \n> diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\n> index 464df6a1fe18..a36c121aa62a 100644\n> --- a/src/libcamera/v4l2_device.cpp\n> +++ b/src/libcamera/v4l2_device.cpp\n> @@ -388,7 +388,8 @@ void V4L2Device::listControls()\n>  \n>  \t/* \\todo Add support for menu and compound controls. */\n>  \twhile (1) {\n> -\t\tctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL;\n> +\t\tctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL |\n> +\t\t\t   V4L2_CTRL_FLAG_NEXT_COMPOUND;\n>  \t\tif (ioctl(VIDIOC_QUERY_EXT_CTRL, &ctrl))\n>  \t\t\tbreak;\n>  \n> @@ -396,13 +397,6 @@ void V4L2Device::listControls()\n>  \t\t    ctrl.flags & V4L2_CTRL_FLAG_DISABLED)\n>  \t\t\tcontinue;\n>  \n> -\t\tif (ctrl.elems != 1 || ctrl.nr_of_dims) {\n> -\t\t\tLOG(V4L2, Debug)\n> -\t\t\t\t<< \"Array control \" << utils::hex(ctrl.id)\n> -\t\t\t\t<< \" not supported\";\n> -\t\t\tcontinue;\n> -\t\t}\n\nWe were guarding against something that could never happen as\nV4L2_CTRL_FLAG_NEXT_COMPOUND wasn't set, right ? This change seems fine\nto me, but I wonder if we should have a ctrl.elems check in\nsetControls(). In any case, for this patch,\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> -\n>  \t\tswitch (ctrl.type) {\n>  \t\tcase V4L2_CTRL_TYPE_INTEGER:\n>  \t\tcase V4L2_CTRL_TYPE_BOOLEAN:\n> @@ -411,8 +405,9 @@ void V4L2Device::listControls()\n>  \t\tcase V4L2_CTRL_TYPE_INTEGER64:\n>  \t\tcase V4L2_CTRL_TYPE_BITMASK:\n>  \t\tcase V4L2_CTRL_TYPE_INTEGER_MENU:\n> +\t\tcase V4L2_CTRL_TYPE_U8:\n>  \t\t\tbreak;\n> -\t\t/* \\todo Support compound controls. */\n> +\t\t/* \\todo Support other control types. */\n>  \t\tdefault:\n>  \t\t\tLOG(V4L2, Debug)\n>  \t\t\t\t<< \"Control \" << utils::hex(ctrl.id)","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 020AF60416\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 20 Mar 2020 22:56:13 +0100 (CET)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 7B469504;\n\tFri, 20 Mar 2020 22:56:12 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1584741372;\n\tbh=Ej1GNWSg/1imU/9f7QUhwyEqQB8soXcsdtQ76lVIUyE=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=C4rByZNRNLytQjmJsDszMuLEkyMklfStSeDPyfsRnNLN2EAMqa1WyrlbFtrjy0eZr\n\tQAgvpstwDZO0hkjBYwFSO7g0XsYhtb8Rg1DnsRnw/agsmPUvccBRcy5Xc4zaPkFJcc\n\tmlBqRxYKThpnH/N6A1nF25v22iJZXEI9x3CfIn34=","Date":"Fri, 20 Mar 2020 23:56:06 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200320215606.GU5193@pendragon.ideasonboard.com>","References":"<20200309162414.720306-1-jacopo@jmondi.org>\n\t<20200309162414.720306-11-jacopo@jmondi.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20200309162414.720306-11-jacopo@jmondi.org>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH 10/11] libcamera: v4l2_device: Enable\n\tenumeration of U8 controls","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Fri, 20 Mar 2020 21:56:13 -0000"}}]