[{"id":17417,"web_url":"https://patchwork.libcamera.org/comment/17417/","msgid":"<YL1YtIcP5sRYGVF5@pendragon.ideasonboard.com>","date":"2021-06-06T23:22:28","subject":"Re: [libcamera-devel] [PATCH v6 2/6] libcamera: V4L2Device: Support\n\tv4l2 menu control","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Hiro,\n\nThank you for the patch.\n\nOn Fri, May 28, 2021 at 12:05:27PM +0900, Hirokazu Honda wrote:\n> This adds a support of v4l2 menu. The control info for v4l2 menu\n> contains indices without names and 64bit values of querymenu.\n> \n> Signed-off-by: Hirokazu Honda <hiroh@chromium.org>\n> ---\n>  include/libcamera/internal/v4l2_device.h |  2 +\n>  src/libcamera/v4l2_device.cpp            | 47 ++++++++++++++++++++++--\n>  2 files changed, 45 insertions(+), 4 deletions(-)\n> \n> diff --git a/include/libcamera/internal/v4l2_device.h b/include/libcamera/internal/v4l2_device.h\n> index b82e2a14..687be9b2 100644\n> --- a/include/libcamera/internal/v4l2_device.h\n> +++ b/include/libcamera/internal/v4l2_device.h\n> @@ -56,6 +56,8 @@ protected:\n>  \tint fd() const { return fd_; }\n>  \n>  private:\n> +\tControlInfo v4l2MenuControlInfo(const v4l2_query_ext_ctrl &ctrl);\n> +\n>  \tvoid listControls();\n>  \tvoid updateControls(ControlList *ctrls,\n>  \t\t\t    Span<const v4l2_ext_control> v4l2Ctrls);\n> diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\n> index caafbc2d..032252bb 100644\n> --- a/src/libcamera/v4l2_device.cpp\n> +++ b/src/libcamera/v4l2_device.cpp\n> @@ -530,6 +530,33 @@ int V4L2Device::ioctl(unsigned long request, void *argp)\n>   * \\return The V4L2 device file descriptor, -1 if the device node is not open\n>   */\n>  \n> +/**\n> + * \\brief Create ControlInfo for v4l2 menu ctrl\n\ns/for v4l2 menu ctrl/for a V4L2 menu control/\n\n> + * \\param[in] ctrl The v4l2_query_ext_ctrl that represents a menu\n> + * \\param[out] ctrlInfo The created controlInfo\n\nIt's not an out parameter, it's the return value.\n\n> + *\n> + * The created ControlInfo contains indices acquired by VIDIOC_QUERYMENU.\n> + *\n> + * \\return ControlInfo for v4l2 menu ctrl.\n> + */\n> +ControlInfo V4L2Device::v4l2MenuControlInfo(const v4l2_query_ext_ctrl &ctrl)\n> +{\n> +\tstd::vector<ControlValue> indices;\n> +\tv4l2_querymenu menu;\n\nWe usually prefix the V4L2 structures with struct. While not strictly\nmandatory, it emphasizes that there are C structs from V4L2.\n\n> +\tmemset(&menu, 0, sizeof(menu));\n\nYou could also write this\n\n\tstruct v4l2_querymenu menu = { };\n\n(I really wish designated initializers were available before C++20 :-().\n\n> +\tmenu.id = ctrl.id;\n\nAs a sanity check, should we add\n\n\tif (ctrl.minimum <= 0)\n\t\treturn ControlInfo();\n\n?\n\n> +\n> +\tfor (menu.index = ctrl.minimum;\n> +\t     static_cast<int32_t>(menu.index) <= ctrl.maximum; menu.index++) {\n\n\tfor (int32_t index = ctrl.minimum; index <= ctrl.maximum; ++index) }\n\t\tmenu.index = index;\n\nwould allow dropping the cast. Up to you.\n\n> +\t\tif (ioctl(VIDIOC_QUERYMENU, &menu) != 0)\n> +\t\t\tcontinue;\n> +\n> +\t\tindices.emplace_back(static_cast<int32_t>(menu.index));\n\nThis could be\n\n\t\tindices.emplace_back(index);\n\nor even\n\n\t\tindices.push_back(index);\n\nas it won't make much of a difference.\n\n> +\t}\n> +\n> +\treturn ControlInfo(indices);\n\nWould it be useful to also pass the default value to the ControlInfo\nconstructor ?\n\n> +}\n> +\n>  /*\n>   * \\brief List and store information about all controls supported by the\n>   * V4L2 device\n> @@ -539,7 +566,6 @@ void V4L2Device::listControls()\n>  \tControlInfoMap::Map ctrls;\n>  \tstruct v4l2_query_ext_ctrl ctrl = {};\n>  \n> -\t/* \\todo Add support for menu controls. */\n>  \twhile (1) {\n>  \t\tctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL |\n>  \t\t\t   V4L2_CTRL_FLAG_NEXT_COMPOUND;\n> @@ -550,16 +576,22 @@ void V4L2Device::listControls()\n>  \t\t    ctrl.flags & V4L2_CTRL_FLAG_DISABLED)\n>  \t\t\tcontinue;\n>  \n> +\t\tControlInfo ctrlInfo;\n\nI'd add a blank line here.\n\n>  \t\tswitch (ctrl.type) {\n>  \t\tcase V4L2_CTRL_TYPE_INTEGER:\n>  \t\tcase V4L2_CTRL_TYPE_BOOLEAN:\n> -\t\tcase V4L2_CTRL_TYPE_MENU:\n>  \t\tcase V4L2_CTRL_TYPE_BUTTON:\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\tctrlInfo = v4l2ControlInfo(ctrl);\n> +\t\t\tbreak;\n> +\n> +\t\tcase V4L2_CTRL_TYPE_INTEGER_MENU:\n> +\t\tcase V4L2_CTRL_TYPE_MENU:\n> +\t\t\tctrlInfo = v4l2MenuControlInfo(ctrl);\n>  \t\t\tbreak;\n> +\n>  \t\t/* \\todo Support other control types. */\n>  \t\tdefault:\n>  \t\t\tLOG(V4L2, Debug)\n> @@ -568,10 +600,13 @@ void V4L2Device::listControls()\n>  \t\t\tcontinue;\n>  \t\t}\n>  \n> +\t\tLOG(V4L2, Debug) << \"Control: \" << ctrl.name\n> +\t\t\t\t << \" (\" << utils::hex(ctrl.id) << \")\";\n> +\n>  \t\tcontrolIds_.emplace_back(v4l2ControlId(ctrl));\n>  \t\tcontrolInfo_.emplace(ctrl.id, ctrl);\n>  \n> -\t\tctrls.emplace(controlIds_.back().get(), v4l2ControlInfo(ctrl));\n> +\t\tctrls.emplace(controlIds_.back().get(), std::move(ctrlInfo));\n>  \t}\n>  \n>  \tcontrols_ = std::move(ctrls);\n> @@ -638,6 +673,10 @@ void V4L2Device::updateControls(ControlList *ctrls,\n>  \t\t\tvalue.set<int64_t>(v4l2Ctrl->value64);\n>  \t\t\tbreak;\n>  \n> +\t\tcase ControlTypeInteger32:\n> +\t\t\tvalue.set<int32_t>(v4l2Ctrl->value);\n\nThis needs a rebase, it's now v4l2Ctrl.value.\n\nWith these minor issues addressed, the patch looks good to me. Thanks\nfor your continuous effort.\n\n> +\t\t\tbreak;\n> +\n>  \t\tcase ControlTypeByte:\n>  \t\t\t/*\n>  \t\t\t * No action required, the VIDIOC_[GS]_EXT_CTRLS ioctl","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id EC281C320B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun,  6 Jun 2021 23:22:44 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 5E1A76892E;\n\tMon,  7 Jun 2021 01:22:44 +0200 (CEST)","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 21E5368921\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  7 Jun 2021 01:22:43 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 84357115B;\n\tMon,  7 Jun 2021 01:22:42 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"Dhl8Efdr\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1623021762;\n\tbh=i/uQR7M1CiiIksvkBJU8P6n7FiYJmyH4qvPiQMco0Hs=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=Dhl8EfdrdeqQX28yQaDH4Lf0Pua9rS171sTgekdeceLEzmpbnEVUVclj5OnHYMKaP\n\tOorprxI07yO2H9BdBiUW3/fEKcfl9cfviKX2U6//ru8SHjgHMXB1HgYD9MAIB2vDlk\n\tOsH9dFs8LlDbwf54YT6U1LU8zEw4cBJjxR7UbmMA=","Date":"Mon, 7 Jun 2021 02:22:28 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Hirokazu Honda <hiroh@chromium.org>","Message-ID":"<YL1YtIcP5sRYGVF5@pendragon.ideasonboard.com>","References":"<20210528030531.189492-1-hiroh@chromium.org>\n\t<20210528030531.189492-2-hiroh@chromium.org>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20210528030531.189492-2-hiroh@chromium.org>","Subject":"Re: [libcamera-devel] [PATCH v6 2/6] libcamera: V4L2Device: Support\n\tv4l2 menu control","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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":17425,"web_url":"https://patchwork.libcamera.org/comment/17425/","msgid":"<CAO5uPHPMt7tymkf1xtPFWAXB4Rj+tXMMBKYTWEqB4bC6_CvJkQ@mail.gmail.com>","date":"2021-06-07T00:14:21","subject":"Re: [libcamera-devel] [PATCH v6 2/6] libcamera: V4L2Device: Support\n\tv4l2 menu control","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"content":"Hi Laurent, thank you for reviewing.\n\nOn Mon, Jun 7, 2021 at 8:22 AM Laurent Pinchart <\nlaurent.pinchart@ideasonboard.com> wrote:\n\n> Hi Hiro,\n>\n> Thank you for the patch.\n>\n> On Fri, May 28, 2021 at 12:05:27PM +0900, Hirokazu Honda wrote:\n> > This adds a support of v4l2 menu. The control info for v4l2 menu\n> > contains indices without names and 64bit values of querymenu.\n> >\n> > Signed-off-by: Hirokazu Honda <hiroh@chromium.org>\n> > ---\n> >  include/libcamera/internal/v4l2_device.h |  2 +\n> >  src/libcamera/v4l2_device.cpp            | 47 ++++++++++++++++++++++--\n> >  2 files changed, 45 insertions(+), 4 deletions(-)\n> >\n> > diff --git a/include/libcamera/internal/v4l2_device.h\n> b/include/libcamera/internal/v4l2_device.h\n> > index b82e2a14..687be9b2 100644\n> > --- a/include/libcamera/internal/v4l2_device.h\n> > +++ b/include/libcamera/internal/v4l2_device.h\n> > @@ -56,6 +56,8 @@ protected:\n> >       int fd() const { return fd_; }\n> >\n> >  private:\n> > +     ControlInfo v4l2MenuControlInfo(const v4l2_query_ext_ctrl &ctrl);\n> > +\n> >       void listControls();\n> >       void updateControls(ControlList *ctrls,\n> >                           Span<const v4l2_ext_control> v4l2Ctrls);\n> > diff --git a/src/libcamera/v4l2_device.cpp\n> b/src/libcamera/v4l2_device.cpp\n> > index caafbc2d..032252bb 100644\n> > --- a/src/libcamera/v4l2_device.cpp\n> > +++ b/src/libcamera/v4l2_device.cpp\n> > @@ -530,6 +530,33 @@ int V4L2Device::ioctl(unsigned long request, void\n> *argp)\n> >   * \\return The V4L2 device file descriptor, -1 if the device node is\n> not open\n> >   */\n> >\n> > +/**\n> > + * \\brief Create ControlInfo for v4l2 menu ctrl\n>\n> s/for v4l2 menu ctrl/for a V4L2 menu control/\n>\n> > + * \\param[in] ctrl The v4l2_query_ext_ctrl that represents a menu\n> > + * \\param[out] ctrlInfo The created controlInfo\n>\n> It's not an out parameter, it's the return value.\n>\n> > + *\n> > + * The created ControlInfo contains indices acquired by\n> VIDIOC_QUERYMENU.\n> > + *\n> > + * \\return ControlInfo for v4l2 menu ctrl.\n> > + */\n> > +ControlInfo V4L2Device::v4l2MenuControlInfo(const v4l2_query_ext_ctrl\n> &ctrl)\n> > +{\n> > +     std::vector<ControlValue> indices;\n> > +     v4l2_querymenu menu;\n>\n> We usually prefix the V4L2 structures with struct. While not strictly\n> mandatory, it emphasizes that there are C structs from V4L2.\n>\n> > +     memset(&menu, 0, sizeof(menu));\n>\n> You could also write this\n>\n>         struct v4l2_querymenu menu = { };\n>\n> (I really wish designated initializers were available before C++20 :-().\n>\n> > +     menu.id = ctrl.id;\n>\n> As a sanity check, should we add\n>\n>         if (ctrl.minimum <= 0)\n>                 return ControlInfo();\n>\n> ?\n>\n> > +\n> > +     for (menu.index = ctrl.minimum;\n> > +          static_cast<int32_t>(menu.index) <= ctrl.maximum;\n> menu.index++) {\n>\n>         for (int32_t index = ctrl.minimum; index <= ctrl.maximum; ++index)\n> }\n>                 menu.index = index;\n>\n> would allow dropping the cast. Up to you.\n>\n> > +             if (ioctl(VIDIOC_QUERYMENU, &menu) != 0)\n> > +                     continue;\n> > +\n> > +             indices.emplace_back(static_cast<int32_t>(menu.index));\n>\n> This could be\n>\n>                 indices.emplace_back(index);\n>\n> or even\n>\n>                 indices.push_back(index);\n>\n> as it won't make much of a difference.\n>\n> > +     }\n> > +\n> > +     return ControlInfo(indices);\n>\n> Would it be useful to also pass the default value to the ControlInfo\n> constructor ?\n>\n>\nYou mean, I should set ctrl.default_value or some value in indices like\nindices.begin()?\n\n\n> > +}\n> > +\n> >  /*\n> >   * \\brief List and store information about all controls supported by the\n> >   * V4L2 device\n> > @@ -539,7 +566,6 @@ void V4L2Device::listControls()\n> >       ControlInfoMap::Map ctrls;\n> >       struct v4l2_query_ext_ctrl ctrl = {};\n> >\n> > -     /* \\todo Add support for menu controls. */\n> >       while (1) {\n> >               ctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL |\n> >                          V4L2_CTRL_FLAG_NEXT_COMPOUND;\n> > @@ -550,16 +576,22 @@ void V4L2Device::listControls()\n> >                   ctrl.flags & V4L2_CTRL_FLAG_DISABLED)\n> >                       continue;\n> >\n> > +             ControlInfo ctrlInfo;\n>\n> I'd add a blank line here.\n>\n> >               switch (ctrl.type) {\n> >               case V4L2_CTRL_TYPE_INTEGER:\n> >               case V4L2_CTRL_TYPE_BOOLEAN:\n> > -             case V4L2_CTRL_TYPE_MENU:\n> >               case V4L2_CTRL_TYPE_BUTTON:\n> >               case V4L2_CTRL_TYPE_INTEGER64:\n> >               case V4L2_CTRL_TYPE_BITMASK:\n> > -             case V4L2_CTRL_TYPE_INTEGER_MENU:\n> >               case V4L2_CTRL_TYPE_U8:\n> > +                     ctrlInfo = v4l2ControlInfo(ctrl);\n> > +                     break;\n> > +\n> > +             case V4L2_CTRL_TYPE_INTEGER_MENU:\n> > +             case V4L2_CTRL_TYPE_MENU:\n> > +                     ctrlInfo = v4l2MenuControlInfo(ctrl);\n> >                       break;\n> > +\n> >               /* \\todo Support other control types. */\n> >               default:\n> >                       LOG(V4L2, Debug)\n> > @@ -568,10 +600,13 @@ void V4L2Device::listControls()\n> >                       continue;\n> >               }\n> >\n> > +             LOG(V4L2, Debug) << \"Control: \" << ctrl.name\n> > +                              << \" (\" << utils::hex(ctrl.id) << \")\";\n> > +\n> >               controlIds_.emplace_back(v4l2ControlId(ctrl));\n> >               controlInfo_.emplace(ctrl.id, ctrl);\n> >\n> > -             ctrls.emplace(controlIds_.back().get(),\n> v4l2ControlInfo(ctrl));\n> > +             ctrls.emplace(controlIds_.back().get(),\n> std::move(ctrlInfo));\n> >       }\n> >\n> >       controls_ = std::move(ctrls);\n> > @@ -638,6 +673,10 @@ void V4L2Device::updateControls(ControlList *ctrls,\n> >                       value.set<int64_t>(v4l2Ctrl->value64);\n> >                       break;\n> >\n> > +             case ControlTypeInteger32:\n> > +                     value.set<int32_t>(v4l2Ctrl->value);\n>\n> This needs a rebase, it's now v4l2Ctrl.value.\n>\n\nBy which patch? On top of tree, v4l2Ctrl is still a const pointer.\n\nThanks,\n-Hiro\n\n>\n> With these minor issues addressed, the patch looks good to me. Thanks\n> for your continuous effort.\n>\n> > +                     break;\n> > +\n> >               case ControlTypeByte:\n> >                       /*\n> >                        * No action required, the VIDIOC_[GS]_EXT_CTRLS\n> ioctl\n>\n> --\n> Regards,\n>\n> Laurent Pinchart\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id C166AC3206\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  7 Jun 2021 00:14:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 2B5B968928;\n\tMon,  7 Jun 2021 02:14:34 +0200 (CEST)","from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com\n\t[IPv6:2a00:1450:4864:20::62e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A20A468921\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  7 Jun 2021 02:14:32 +0200 (CEST)","by mail-ej1-x62e.google.com with SMTP id k25so18199258eja.9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 06 Jun 2021 17:14:32 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"WRwsL4S9\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=2JbPVP4iwLgsd0+FQ6IZjxNJpQ4QXAUrtAJ8KXtrEB0=;\n\tb=WRwsL4S98OnZmELw0LV8KwYdSpL6yS+V2jk1uS77n1m+YM5zv/DXFZLpojqJjBHox6\n\t1PSAbsP6fxWXuy59MsWXzyIVeBBMmld7bDddn3yrzOhZp9V4ouXUbG1pVE0kJ9VaKYnA\n\tKAszlRIQuA0F3ryMFteMEOvQeJ1aTtHuUbKU0=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=2JbPVP4iwLgsd0+FQ6IZjxNJpQ4QXAUrtAJ8KXtrEB0=;\n\tb=MjZ+MpDy1H7WWjQ+mRDe22G2F7jyFkM9t3RpifFYwUJcdTC0Xav/Md+/X1wyadsg7N\n\tvaHATOe001SDvTDcbddhitDqSMfhGNGMau7pLLC+i5XP63ZFgQqdFIpYeEq8bgOAPZ5B\n\tKHxOB+GkDn+nXXBGSZj8Tps66H0+d3Hny00thVZZKk8T+qDvZUk6XYlznQk1sGZWhWrY\n\tTmYH54zjq+IMB8uyRuTfiOZ0whkSDnFRiDh+NYNJ6ApgaoVNxGLFwKMvAkrmN8oQpd9a\n\t8KbF0KytBMKII2bsO8dLn7fUGwaWGJM+3w2Ncu6W7dssb2OEDiZx6FiMB7zSiuiUXYLZ\n\taHhQ==","X-Gm-Message-State":"AOAM532iVg3gK6K39D5kWXLK7FxD9IZcV+aDYnaZHF6ATyX+x14C8nNJ\n\txDYsuz21hScm8GJDhe28V9K3M5gtUwWasXNdv51lbGbHE5E=","X-Google-Smtp-Source":"ABdhPJyFsYzmbd1hp4BW9ZlWJpFiQr112oAA7DHpBbWdkFNgdva3+K7GF3AZPO0XWP8RUox2+e9LJByDRi0Lxu2P/QI=","X-Received":"by 2002:a17:906:2459:: with SMTP id\n\ta25mr15096841ejb.306.1623024872202; \n\tSun, 06 Jun 2021 17:14:32 -0700 (PDT)","MIME-Version":"1.0","References":"<20210528030531.189492-1-hiroh@chromium.org>\n\t<20210528030531.189492-2-hiroh@chromium.org>\n\t<YL1YtIcP5sRYGVF5@pendragon.ideasonboard.com>","In-Reply-To":"<YL1YtIcP5sRYGVF5@pendragon.ideasonboard.com>","From":"Hirokazu Honda <hiroh@chromium.org>","Date":"Mon, 7 Jun 2021 09:14:21 +0900","Message-ID":"<CAO5uPHPMt7tymkf1xtPFWAXB4Rj+tXMMBKYTWEqB4bC6_CvJkQ@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Content-Type":"multipart/alternative; boundary=\"000000000000f8359a05c421ec0d\"","Subject":"Re: [libcamera-devel] [PATCH v6 2/6] libcamera: V4L2Device: Support\n\tv4l2 menu control","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":17427,"web_url":"https://patchwork.libcamera.org/comment/17427/","msgid":"<YL1scBiW+xMLlDaY@pendragon.ideasonboard.com>","date":"2021-06-07T00:46:40","subject":"Re: [libcamera-devel] [PATCH v6 2/6] libcamera: V4L2Device: Support\n\tv4l2 menu control","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Hiro,\n\nOn Mon, Jun 07, 2021 at 09:14:21AM +0900, Hirokazu Honda wrote:\n> On Mon, Jun 7, 2021 at 8:22 AM Laurent Pinchart wrote:\n> > On Fri, May 28, 2021 at 12:05:27PM +0900, Hirokazu Honda wrote:\n> > > This adds a support of v4l2 menu. The control info for v4l2 menu\n> > > contains indices without names and 64bit values of querymenu.\n> > >\n> > > Signed-off-by: Hirokazu Honda <hiroh@chromium.org>\n> > > ---\n> > >  include/libcamera/internal/v4l2_device.h |  2 +\n> > >  src/libcamera/v4l2_device.cpp            | 47 ++++++++++++++++++++++--\n> > >  2 files changed, 45 insertions(+), 4 deletions(-)\n> > >\n> > > diff --git a/include/libcamera/internal/v4l2_device.h b/include/libcamera/internal/v4l2_device.h\n> > > index b82e2a14..687be9b2 100644\n> > > --- a/include/libcamera/internal/v4l2_device.h\n> > > +++ b/include/libcamera/internal/v4l2_device.h\n> > > @@ -56,6 +56,8 @@ protected:\n> > >       int fd() const { return fd_; }\n> > >\n> > >  private:\n> > > +     ControlInfo v4l2MenuControlInfo(const v4l2_query_ext_ctrl &ctrl);\n> > > +\n> > >       void listControls();\n> > >       void updateControls(ControlList *ctrls,\n> > >                           Span<const v4l2_ext_control> v4l2Ctrls);\n> > > diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\n> > > index caafbc2d..032252bb 100644\n> > > --- a/src/libcamera/v4l2_device.cpp\n> > > +++ b/src/libcamera/v4l2_device.cpp\n> > > @@ -530,6 +530,33 @@ int V4L2Device::ioctl(unsigned long request, void *argp)\n> > >   * \\return The V4L2 device file descriptor, -1 if the device node is not open\n> > >   */\n> > >\n> > > +/**\n> > > + * \\brief Create ControlInfo for v4l2 menu ctrl\n> >\n> > s/for v4l2 menu ctrl/for a V4L2 menu control/\n> >\n> > > + * \\param[in] ctrl The v4l2_query_ext_ctrl that represents a menu\n> > > + * \\param[out] ctrlInfo The created controlInfo\n> >\n> > It's not an out parameter, it's the return value.\n> >\n> > > + *\n> > > + * The created ControlInfo contains indices acquired by VIDIOC_QUERYMENU.\n> > > + *\n> > > + * \\return ControlInfo for v4l2 menu ctrl.\n> > > + */\n> > > +ControlInfo V4L2Device::v4l2MenuControlInfo(const v4l2_query_ext_ctrl &ctrl)\n> > > +{\n> > > +     std::vector<ControlValue> indices;\n> > > +     v4l2_querymenu menu;\n> >\n> > We usually prefix the V4L2 structures with struct. While not strictly\n> > mandatory, it emphasizes that there are C structs from V4L2.\n> >\n> > > +     memset(&menu, 0, sizeof(menu));\n> >\n> > You could also write this\n> >\n> >         struct v4l2_querymenu menu = { };\n> >\n> > (I really wish designated initializers were available before C++20 :-().\n> >\n> > > +     menu.id = ctrl.id;\n> >\n> > As a sanity check, should we add\n> >\n> >         if (ctrl.minimum <= 0)\n> >                 return ControlInfo();\n> >\n> > ?\n> >\n> > > +\n> > > +     for (menu.index = ctrl.minimum;\n> > > +          static_cast<int32_t>(menu.index) <= ctrl.maximum; menu.index++) {\n> >\n> >         for (int32_t index = ctrl.minimum; index <= ctrl.maximum; ++index)\n> > }\n> >                 menu.index = index;\n> >\n> > would allow dropping the cast. Up to you.\n> >\n> > > +             if (ioctl(VIDIOC_QUERYMENU, &menu) != 0)\n> > > +                     continue;\n> > > +\n> > > +             indices.emplace_back(static_cast<int32_t>(menu.index));\n> >\n> > This could be\n> >\n> >                 indices.emplace_back(index);\n> >\n> > or even\n> >\n> >                 indices.push_back(index);\n> >\n> > as it won't make much of a difference.\n> >\n> > > +     }\n> > > +\n> > > +     return ControlInfo(indices);\n> >\n> > Would it be useful to also pass the default value to the ControlInfo\n> > constructor ?\n>\n> You mean, I should set ctrl.default_value or some value in indices like\n> indices.begin()?\n\nI mean (untested)\n\n\treturn ControlInfo(indices, ControlValue<int32_t>(ctrl.dev));\n\n> > > +}\n> > > +\n> > >  /*\n> > >   * \\brief List and store information about all controls supported by the\n> > >   * V4L2 device\n> > > @@ -539,7 +566,6 @@ void V4L2Device::listControls()\n> > >       ControlInfoMap::Map ctrls;\n> > >       struct v4l2_query_ext_ctrl ctrl = {};\n> > >\n> > > -     /* \\todo Add support for menu controls. */\n> > >       while (1) {\n> > >               ctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL |\n> > >                          V4L2_CTRL_FLAG_NEXT_COMPOUND;\n> > > @@ -550,16 +576,22 @@ void V4L2Device::listControls()\n> > >                   ctrl.flags & V4L2_CTRL_FLAG_DISABLED)\n> > >                       continue;\n> > >\n> > > +             ControlInfo ctrlInfo;\n> >\n> > I'd add a blank line here.\n> >\n> > >               switch (ctrl.type) {\n> > >               case V4L2_CTRL_TYPE_INTEGER:\n> > >               case V4L2_CTRL_TYPE_BOOLEAN:\n> > > -             case V4L2_CTRL_TYPE_MENU:\n> > >               case V4L2_CTRL_TYPE_BUTTON:\n> > >               case V4L2_CTRL_TYPE_INTEGER64:\n> > >               case V4L2_CTRL_TYPE_BITMASK:\n> > > -             case V4L2_CTRL_TYPE_INTEGER_MENU:\n> > >               case V4L2_CTRL_TYPE_U8:\n> > > +                     ctrlInfo = v4l2ControlInfo(ctrl);\n> > > +                     break;\n> > > +\n> > > +             case V4L2_CTRL_TYPE_INTEGER_MENU:\n> > > +             case V4L2_CTRL_TYPE_MENU:\n> > > +                     ctrlInfo = v4l2MenuControlInfo(ctrl);\n> > >                       break;\n> > > +\n> > >               /* \\todo Support other control types. */\n> > >               default:\n> > >                       LOG(V4L2, Debug)\n> > > @@ -568,10 +600,13 @@ void V4L2Device::listControls()\n> > >                       continue;\n> > >               }\n> > >\n> > > +             LOG(V4L2, Debug) << \"Control: \" << ctrl.name\n> > > +                              << \" (\" << utils::hex(ctrl.id) << \")\";\n> > > +\n> > >               controlIds_.emplace_back(v4l2ControlId(ctrl));\n> > >               controlInfo_.emplace(ctrl.id, ctrl);\n> > >\n> > > -             ctrls.emplace(controlIds_.back().get(), v4l2ControlInfo(ctrl));\n> > > +             ctrls.emplace(controlIds_.back().get(), std::move(ctrlInfo));\n> > >       }\n> > >\n> > >       controls_ = std::move(ctrls);\n> > > @@ -638,6 +673,10 @@ void V4L2Device::updateControls(ControlList *ctrls,\n> > >                       value.set<int64_t>(v4l2Ctrl->value64);\n> > >                       break;\n> > >\n> > > +             case ControlTypeInteger32:\n> > > +                     value.set<int32_t>(v4l2Ctrl->value);\n> >\n> > This needs a rebase, it's now v4l2Ctrl.value.\n> \n> By which patch? On top of tree, v4l2Ctrl is still a const pointer.\n\nBy commit abdb11d9ccad (\"libcamera: V4L2Device: Remove the controls\norder assumption in updateControls()\")  :-)\n\n> > With these minor issues addressed, the patch looks good to me. Thanks\n> > for your continuous effort.\n> >\n> > > +                     break;\n> > > +\n> > >               case ControlTypeByte:\n> > >                       /*\n> > >                        * No action required, the VIDIOC_[GS]_EXT_CTRLS ioctl","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 31A9CC3206\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  7 Jun 2021 00:46:56 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 879FF68925;\n\tMon,  7 Jun 2021 02:46:55 +0200 (CEST)","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 1A5AC68921\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  7 Jun 2021 02:46:54 +0200 (CEST)","from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 78EE480F;\n\tMon,  7 Jun 2021 02:46:53 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"qUrNNvpY\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1623026813;\n\tbh=mFza9CJypMjUbSJyxzGmbHA9am62PWUEo1HJQeyvKlI=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=qUrNNvpY1I9SOyOs3RFMvvLfnTw6B2qMGva5+CTEmc3a6z3/dCsS5M8IvxV+oseC/\n\tsz8UIHaQQHRdZw7OQYaK1zKpHNp8cw0TpaVD1q5zlw6cQUOl4W4RgVsvpGEA2YJykk\n\tLI+FDwppYi7cnt1tv4ezYX3sTJQeS2kuwYI5n924=","Date":"Mon, 7 Jun 2021 03:46:40 +0300","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Hirokazu Honda <hiroh@chromium.org>","Message-ID":"<YL1scBiW+xMLlDaY@pendragon.ideasonboard.com>","References":"<20210528030531.189492-1-hiroh@chromium.org>\n\t<20210528030531.189492-2-hiroh@chromium.org>\n\t<YL1YtIcP5sRYGVF5@pendragon.ideasonboard.com>\n\t<CAO5uPHPMt7tymkf1xtPFWAXB4Rj+tXMMBKYTWEqB4bC6_CvJkQ@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<CAO5uPHPMt7tymkf1xtPFWAXB4Rj+tXMMBKYTWEqB4bC6_CvJkQ@mail.gmail.com>","Subject":"Re: [libcamera-devel] [PATCH v6 2/6] libcamera: V4L2Device: Support\n\tv4l2 menu control","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":17428,"web_url":"https://patchwork.libcamera.org/comment/17428/","msgid":"<CAO5uPHN_6xMsaFCS_SXVT0o1msv8T-j0+m3COZkddDMAmEbU_A@mail.gmail.com>","date":"2021-06-07T00:54:25","subject":"Re: [libcamera-devel] [PATCH v6 2/6] libcamera: V4L2Device: Support\n\tv4l2 menu control","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"content":"Hi Laurent,\n\nOn Mon, Jun 7, 2021 at 9:46 AM Laurent Pinchart <\nlaurent.pinchart@ideasonboard.com> wrote:\n\n> Hi Hiro,\n>\n> On Mon, Jun 07, 2021 at 09:14:21AM +0900, Hirokazu Honda wrote:\n> > On Mon, Jun 7, 2021 at 8:22 AM Laurent Pinchart wrote:\n> > > On Fri, May 28, 2021 at 12:05:27PM +0900, Hirokazu Honda wrote:\n> > > > This adds a support of v4l2 menu. The control info for v4l2 menu\n> > > > contains indices without names and 64bit values of querymenu.\n> > > >\n> > > > Signed-off-by: Hirokazu Honda <hiroh@chromium.org>\n> > > > ---\n> > > >  include/libcamera/internal/v4l2_device.h |  2 +\n> > > >  src/libcamera/v4l2_device.cpp            | 47\n> ++++++++++++++++++++++--\n> > > >  2 files changed, 45 insertions(+), 4 deletions(-)\n> > > >\n> > > > diff --git a/include/libcamera/internal/v4l2_device.h\n> b/include/libcamera/internal/v4l2_device.h\n> > > > index b82e2a14..687be9b2 100644\n> > > > --- a/include/libcamera/internal/v4l2_device.h\n> > > > +++ b/include/libcamera/internal/v4l2_device.h\n> > > > @@ -56,6 +56,8 @@ protected:\n> > > >       int fd() const { return fd_; }\n> > > >\n> > > >  private:\n> > > > +     ControlInfo v4l2MenuControlInfo(const v4l2_query_ext_ctrl\n> &ctrl);\n> > > > +\n> > > >       void listControls();\n> > > >       void updateControls(ControlList *ctrls,\n> > > >                           Span<const v4l2_ext_control> v4l2Ctrls);\n> > > > diff --git a/src/libcamera/v4l2_device.cpp\n> b/src/libcamera/v4l2_device.cpp\n> > > > index caafbc2d..032252bb 100644\n> > > > --- a/src/libcamera/v4l2_device.cpp\n> > > > +++ b/src/libcamera/v4l2_device.cpp\n> > > > @@ -530,6 +530,33 @@ int V4L2Device::ioctl(unsigned long request,\n> void *argp)\n> > > >   * \\return The V4L2 device file descriptor, -1 if the device node\n> is not open\n> > > >   */\n> > > >\n> > > > +/**\n> > > > + * \\brief Create ControlInfo for v4l2 menu ctrl\n> > >\n> > > s/for v4l2 menu ctrl/for a V4L2 menu control/\n> > >\n> > > > + * \\param[in] ctrl The v4l2_query_ext_ctrl that represents a menu\n> > > > + * \\param[out] ctrlInfo The created controlInfo\n> > >\n> > > It's not an out parameter, it's the return value.\n> > >\n> > > > + *\n> > > > + * The created ControlInfo contains indices acquired by\n> VIDIOC_QUERYMENU.\n> > > > + *\n> > > > + * \\return ControlInfo for v4l2 menu ctrl.\n> > > > + */\n> > > > +ControlInfo V4L2Device::v4l2MenuControlInfo(const\n> v4l2_query_ext_ctrl &ctrl)\n> > > > +{\n> > > > +     std::vector<ControlValue> indices;\n> > > > +     v4l2_querymenu menu;\n> > >\n> > > We usually prefix the V4L2 structures with struct. While not strictly\n> > > mandatory, it emphasizes that there are C structs from V4L2.\n> > >\n> > > > +     memset(&menu, 0, sizeof(menu));\n> > >\n> > > You could also write this\n> > >\n> > >         struct v4l2_querymenu menu = { };\n> > >\n> > > (I really wish designated initializers were available before C++20\n> :-().\n> > >\n> > > > +     menu.id = ctrl.id;\n> > >\n> > > As a sanity check, should we add\n> > >\n> > >         if (ctrl.minimum <= 0)\n> > >                 return ControlInfo();\n> > >\n> > > ?\n> > >\n> > > > +\n> > > > +     for (menu.index = ctrl.minimum;\n> > > > +          static_cast<int32_t>(menu.index) <= ctrl.maximum;\n> menu.index++) {\n> > >\n> > >         for (int32_t index = ctrl.minimum; index <= ctrl.maximum;\n> ++index)\n> > > }\n> > >                 menu.index = index;\n> > >\n> > > would allow dropping the cast. Up to you.\n> > >\n> > > > +             if (ioctl(VIDIOC_QUERYMENU, &menu) != 0)\n> > > > +                     continue;\n> > > > +\n> > > > +             indices.emplace_back(static_cast<int32_t>(menu.index));\n> > >\n> > > This could be\n> > >\n> > >                 indices.emplace_back(index);\n> > >\n> > > or even\n> > >\n> > >                 indices.push_back(index);\n> > >\n> > > as it won't make much of a difference.\n> > >\n> > > > +     }\n> > > > +\n> > > > +     return ControlInfo(indices);\n> > >\n> > > Would it be useful to also pass the default value to the ControlInfo\n> > > constructor ?\n> >\n> > You mean, I should set ctrl.default_value or some value in indices like\n> > indices.begin()?\n>\n> I mean (untested)\n>\n>         return ControlInfo(indices, ControlValue<int32_t>(ctrl.dev));\n>\n>\nI guess you mean ctrl.default_value. Filled so if querymenu for the value\nis successful.\n\n\n> > > > +}\n> > > > +\n> > > >  /*\n> > > >   * \\brief List and store information about all controls supported\n> by the\n> > > >   * V4L2 device\n> > > > @@ -539,7 +566,6 @@ void V4L2Device::listControls()\n> > > >       ControlInfoMap::Map ctrls;\n> > > >       struct v4l2_query_ext_ctrl ctrl = {};\n> > > >\n> > > > -     /* \\todo Add support for menu controls. */\n> > > >       while (1) {\n> > > >               ctrl.id |= V4L2_CTRL_FLAG_NEXT_CTRL |\n> > > >                          V4L2_CTRL_FLAG_NEXT_COMPOUND;\n> > > > @@ -550,16 +576,22 @@ void V4L2Device::listControls()\n> > > >                   ctrl.flags & V4L2_CTRL_FLAG_DISABLED)\n> > > >                       continue;\n> > > >\n> > > > +             ControlInfo ctrlInfo;\n> > >\n> > > I'd add a blank line here.\n> > >\n> > > >               switch (ctrl.type) {\n> > > >               case V4L2_CTRL_TYPE_INTEGER:\n> > > >               case V4L2_CTRL_TYPE_BOOLEAN:\n> > > > -             case V4L2_CTRL_TYPE_MENU:\n> > > >               case V4L2_CTRL_TYPE_BUTTON:\n> > > >               case V4L2_CTRL_TYPE_INTEGER64:\n> > > >               case V4L2_CTRL_TYPE_BITMASK:\n> > > > -             case V4L2_CTRL_TYPE_INTEGER_MENU:\n> > > >               case V4L2_CTRL_TYPE_U8:\n> > > > +                     ctrlInfo = v4l2ControlInfo(ctrl);\n> > > > +                     break;\n> > > > +\n> > > > +             case V4L2_CTRL_TYPE_INTEGER_MENU:\n> > > > +             case V4L2_CTRL_TYPE_MENU:\n> > > > +                     ctrlInfo = v4l2MenuControlInfo(ctrl);\n> > > >                       break;\n> > > > +\n> > > >               /* \\todo Support other control types. */\n> > > >               default:\n> > > >                       LOG(V4L2, Debug)\n> > > > @@ -568,10 +600,13 @@ void V4L2Device::listControls()\n> > > >                       continue;\n> > > >               }\n> > > >\n> > > > +             LOG(V4L2, Debug) << \"Control: \" << ctrl.name\n> > > > +                              << \" (\" << utils::hex(ctrl.id) <<\n> \")\";\n> > > > +\n> > > >               controlIds_.emplace_back(v4l2ControlId(ctrl));\n> > > >               controlInfo_.emplace(ctrl.id, ctrl);\n> > > >\n> > > > -             ctrls.emplace(controlIds_.back().get(),\n> v4l2ControlInfo(ctrl));\n> > > > +             ctrls.emplace(controlIds_.back().get(),\n> std::move(ctrlInfo));\n> > > >       }\n> > > >\n> > > >       controls_ = std::move(ctrls);\n> > > > @@ -638,6 +673,10 @@ void V4L2Device::updateControls(ControlList\n> *ctrls,\n> > > >                       value.set<int64_t>(v4l2Ctrl->value64);\n> > > >                       break;\n> > > >\n> > > > +             case ControlTypeInteger32:\n> > > > +                     value.set<int32_t>(v4l2Ctrl->value);\n> > >\n> > > This needs a rebase, it's now v4l2Ctrl.value.\n> >\n> > By which patch? On top of tree, v4l2Ctrl is still a const pointer.\n>\n> By commit abdb11d9ccad (\"libcamera: V4L2Device: Remove the controls\n> order assumption in updateControls()\")  :-)\n>\n>\nOkay, I saw it was merged just while ago. Thanks for merging.\n\n-Hiro\n\n> > > With these minor issues addressed, the patch looks good to me. Thanks\n> > > for your continuous effort.\n> > >\n> > > > +                     break;\n> > > > +\n> > > >               case ControlTypeByte:\n> > > >                       /*\n> > > >                        * No action required, the\n> VIDIOC_[GS]_EXT_CTRLS ioctl\n>\n> --\n> Regards,\n>\n> Laurent Pinchart\n>","headers":{"Return-Path":"<libcamera-devel-bounces@lists.libcamera.org>","X-Original-To":"parsemail@patchwork.libcamera.org","Delivered-To":"parsemail@patchwork.libcamera.org","Received":["from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 19405C3206\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon,  7 Jun 2021 00:54:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7B0B46892E;\n\tMon,  7 Jun 2021 02:54:37 +0200 (CEST)","from mail-ej1-x62b.google.com (mail-ej1-x62b.google.com\n\t[IPv6:2a00:1450:4864:20::62b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4D8A068921\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon,  7 Jun 2021 02:54:36 +0200 (CEST)","by mail-ej1-x62b.google.com with SMTP id g8so23834224ejx.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSun, 06 Jun 2021 17:54:36 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"GiAPnDBx\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org;\n\ts=google; \n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=QrHwRxIiwkYwMgMyA5j6vt3OD1v71pSaKVe8PrboZOY=;\n\tb=GiAPnDBx0hMGy39KvT6VVk5LrWGVqX+g/R86iqq++LSiEVChERRrEf9RbfAGZ1RKm9\n\tj1V3NgnQYmXRxYFW0aCllpDge5ZxcErdWylB4hBG5xyRdk6v1hm87ZOUEGloO+YnEhwK\n\txiAZx/+uKh93ElfwT5Yv//jNq+rBwbU4ZyBvo=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=QrHwRxIiwkYwMgMyA5j6vt3OD1v71pSaKVe8PrboZOY=;\n\tb=s7f8yoKxcAgDrQmIXFRTZjigQkoN5kWZga3f6Ke5rkw6yUvj79uP8MaQ49FUabRoUk\n\t8v54khMWTYQWpVSfNRGBT5wu+hyCVAQV8rnRnMa2MT9awYSqCgugG+hGmtr+/Ascv/a1\n\tQgFwJZjG3O1fqdfhNYUDYLj5foBj6kdGgFuFy6awxq2X28Hqr8oQcmXtsMTXBAopSnbU\n\tuJNsoD9KYDeHp3XzhuYZ/lP9nhoHVvga6H2xEvGjWkdOGKhTWgbn3tfT61d3DR15G0Sd\n\tOGxEtWJXaHwKuPbLntwmL/1XaSgUYyDwyGRrR9mS9HPKGTHRZEeUXMCQ3E7b3pdeuETK\n\tQeIw==","X-Gm-Message-State":"AOAM530qRNWkBbKJT1AXqoiuSqldDhVhr8EyVtW2mh0hhYIPrSv62QJj\n\tkbQQzZYrBgbMOq78AYhRRRvFEBsmLkPgF5qRWz8UWA==","X-Google-Smtp-Source":"ABdhPJy/UVxx7tgQ846bhiZWs5u4RLxGu9tyF8ujg8RttulC3QQ/oDFTyKlgIZVdc1Hg2AGrNhXEr9nwdyKyV+QHMf8=","X-Received":"by 2002:a17:906:55cb:: with SMTP id\n\tz11mr15506529ejp.475.1623027275910; \n\tSun, 06 Jun 2021 17:54:35 -0700 (PDT)","MIME-Version":"1.0","References":"<20210528030531.189492-1-hiroh@chromium.org>\n\t<20210528030531.189492-2-hiroh@chromium.org>\n\t<YL1YtIcP5sRYGVF5@pendragon.ideasonboard.com>\n\t<CAO5uPHPMt7tymkf1xtPFWAXB4Rj+tXMMBKYTWEqB4bC6_CvJkQ@mail.gmail.com>\n\t<YL1scBiW+xMLlDaY@pendragon.ideasonboard.com>","In-Reply-To":"<YL1scBiW+xMLlDaY@pendragon.ideasonboard.com>","From":"Hirokazu Honda <hiroh@chromium.org>","Date":"Mon, 7 Jun 2021 09:54:25 +0900","Message-ID":"<CAO5uPHN_6xMsaFCS_SXVT0o1msv8T-j0+m3COZkddDMAmEbU_A@mail.gmail.com>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Content-Type":"multipart/alternative; boundary=\"0000000000003de2ed05c4227c84\"","Subject":"Re: [libcamera-devel] [PATCH v6 2/6] libcamera: V4L2Device: Support\n\tv4l2 menu control","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>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}}]