[{"id":17244,"web_url":"https://patchwork.libcamera.org/comment/17244/","msgid":"<20210525104057.no7csqzvhvybumt7@uno.localdomain>","date":"2021-05-25T10:40:57","subject":"Re: [libcamera-devel] [PATCH] test: v4l2_videodevice: controls:\n\tTest 64-bit controls","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Laurent,\n\nOn Tue, May 25, 2021 at 12:46:21PM +0300, Laurent Pinchart wrote:\n> The recent merge (and revert) of commit 34bee5e84ecb (\"libcamera:\n> V4L2Device: Remove the controls order assumption in updateControls()\")\n> showed that 64-bit controls were missing from unit tests.\n>\n> Fix this by testing the VIVID_CID_INTEGER64 control in the V4L2 video\n> device controls test.\n>\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n> ---\n>  test/v4l2_videodevice/controls.cpp | 11 +++++++++++\n>  1 file changed, 11 insertions(+)\n>\n> diff --git a/test/v4l2_videodevice/controls.cpp b/test/v4l2_videodevice/controls.cpp\n> index 8d42508192d8..0f603b85930d 100644\n> --- a/test/v4l2_videodevice/controls.cpp\n> +++ b/test/v4l2_videodevice/controls.cpp\n> @@ -16,6 +16,7 @@\n>\n>  /* These come from the vivid driver. */\n>  #define VIVID_CID_CUSTOM_BASE\t\t(V4L2_CID_USER_BASE | 0xf000)\n> +#define VIVID_CID_INTEGER64\t\t(VIVID_CID_CUSTOM_BASE + 3)\n\nI still wonder why these identifiers are not exported to uspace...\n\nAnyway, this looks good!\n\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n  j\n\n>  #define VIVID_CID_U8_4D_ARRAY\t\t(VIVID_CID_CUSTOM_BASE + 10)\n>\n>  /* Helper for VIVID_CID_U8_4D_ARRAY control array size: not from kernel. */\n> @@ -46,6 +47,7 @@ protected:\n>  \t\tif (infoMap.find(V4L2_CID_BRIGHTNESS) == infoMap.end() ||\n>  \t\t    infoMap.find(V4L2_CID_CONTRAST) == infoMap.end() ||\n>  \t\t    infoMap.find(V4L2_CID_SATURATION) == infoMap.end() ||\n> +\t\t    infoMap.find(VIVID_CID_INTEGER64) == infoMap.end() ||\n>  \t\t    infoMap.find(VIVID_CID_U8_4D_ARRAY) == infoMap.end()) {\n>  \t\t\tcerr << \"Missing controls\" << endl;\n>  \t\t\treturn TestFail;\n> @@ -54,12 +56,14 @@ protected:\n>  \t\tconst ControlInfo &brightness = infoMap.find(V4L2_CID_BRIGHTNESS)->second;\n>  \t\tconst ControlInfo &contrast = infoMap.find(V4L2_CID_CONTRAST)->second;\n>  \t\tconst ControlInfo &saturation = infoMap.find(V4L2_CID_SATURATION)->second;\n> +\t\tconst ControlInfo &int64 = infoMap.find(VIVID_CID_INTEGER64)->second;\n>  \t\tconst ControlInfo &u8 = infoMap.find(VIVID_CID_U8_4D_ARRAY)->second;\n>\n>  \t\t/* Test getting controls. */\n>  \t\tControlList ctrls = capture_->getControls({ V4L2_CID_BRIGHTNESS,\n>  \t\t\t\t\t\t\t    V4L2_CID_CONTRAST,\n>  \t\t\t\t\t\t\t    V4L2_CID_SATURATION,\n> +\t\t\t\t\t\t\t    VIVID_CID_INTEGER64,\n>  \t\t\t\t\t\t\t    VIVID_CID_U8_4D_ARRAY });\n>  \t\tif (ctrls.empty()) {\n>  \t\t\tcerr << \"Failed to get controls\" << endl;\n> @@ -78,6 +82,12 @@ protected:\n>  \t\t\treturn TestFail;\n>  \t\t}\n>\n> +\t\t/*\n> +\t\t * The VIVID_CID_INTEGER64 control can take any value, just test\n> +\t\t * that its value can be retrieved and has the right type.\n> +\t\t */\n> +\t\tctrls.get(VIVID_CID_INTEGER64).get<int64_t>();\n> +\n>  \t\tuint8_t u8Min = u8.min().get<uint8_t>();\n>  \t\tuint8_t u8Max = u8.max().get<uint8_t>();\n>\n> @@ -94,6 +104,7 @@ protected:\n>  \t\tctrls.set(V4L2_CID_BRIGHTNESS, brightness.min());\n>  \t\tctrls.set(V4L2_CID_CONTRAST, contrast.max());\n>  \t\tctrls.set(V4L2_CID_SATURATION, saturation.min());\n> +\t\tctrls.set(VIVID_CID_INTEGER64, int64.min());\n>\n>  \t\tstd::array<uint8_t, VIVID_CID_U8_ARRAY_SIZE> u8Values;\n>  \t\tstd::fill(u8Values.begin(), u8Values.end(), u8.min().get<uint8_t>());\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 96B4BC3200\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 25 May 2021 10:40:12 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 27E216891F;\n\tTue, 25 May 2021 12:40:12 +0200 (CEST)","from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net\n\t[217.70.183.193])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D68456050E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 25 May 2021 12:40:11 +0200 (CEST)","(Authenticated sender: jacopo@jmondi.org)\n\tby relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 66EC0240006;\n\tTue, 25 May 2021 10:40:11 +0000 (UTC)"],"Date":"Tue, 25 May 2021 12:40:57 +0200","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Message-ID":"<20210525104057.no7csqzvhvybumt7@uno.localdomain>","References":"<20210525094621.23029-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20210525094621.23029-1-laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH] test: v4l2_videodevice: controls:\n\tTest 64-bit 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>","Cc":"libcamera-devel@lists.libcamera.org","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"}},{"id":17249,"web_url":"https://patchwork.libcamera.org/comment/17249/","msgid":"<CAO5uPHNWrUy_kWfxxvYN=TSHnte6iuELObfx2K32WdSHuzh=kw@mail.gmail.com>","date":"2021-05-26T06:41:04","subject":"Re: [libcamera-devel] [PATCH] test: v4l2_videodevice: controls:\n\tTest 64-bit controls","submitter":{"id":63,"url":"https://patchwork.libcamera.org/api/people/63/","name":"Hirokazu Honda","email":"hiroh@chromium.org"},"content":"Hi Laurent, thank you for the patch.\n\nOn Tue, May 25, 2021 at 7:40 PM Jacopo Mondi <jacopo@jmondi.org> wrote:\n\n> Hi Laurent,\n>\n> On Tue, May 25, 2021 at 12:46:21PM +0300, Laurent Pinchart wrote:\n> > The recent merge (and revert) of commit 34bee5e84ecb (\"libcamera:\n> > V4L2Device: Remove the controls order assumption in updateControls()\")\n> > showed that 64-bit controls were missing from unit tests.\n> >\n> > Fix this by testing the VIVID_CID_INTEGER64 control in the V4L2 video\n> > device controls test.\n> >\n> > Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n>\n\nReviewed-by: Hirokazu Honda <hiroh@chromium.org>\n\n\n> > ---\n> >  test/v4l2_videodevice/controls.cpp | 11 +++++++++++\n> >  1 file changed, 11 insertions(+)\n> >\n> > diff --git a/test/v4l2_videodevice/controls.cpp\n> b/test/v4l2_videodevice/controls.cpp\n> > index 8d42508192d8..0f603b85930d 100644\n> > --- a/test/v4l2_videodevice/controls.cpp\n> > +++ b/test/v4l2_videodevice/controls.cpp\n> > @@ -16,6 +16,7 @@\n> >\n> >  /* These come from the vivid driver. */\n> >  #define VIVID_CID_CUSTOM_BASE                (V4L2_CID_USER_BASE |\n> 0xf000)\n> > +#define VIVID_CID_INTEGER64          (VIVID_CID_CUSTOM_BASE + 3)\n>\n> I still wonder why these identifiers are not exported to uspace...\n>\n> Anyway, this looks good!\n>\n> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n\nThanks\n>   j\n>\n> >  #define VIVID_CID_U8_4D_ARRAY                (VIVID_CID_CUSTOM_BASE +\n> 10)\n> >\n> >  /* Helper for VIVID_CID_U8_4D_ARRAY control array size: not from\n> kernel. */\n> > @@ -46,6 +47,7 @@ protected:\n> >               if (infoMap.find(V4L2_CID_BRIGHTNESS) == infoMap.end() ||\n> >                   infoMap.find(V4L2_CID_CONTRAST) == infoMap.end() ||\n> >                   infoMap.find(V4L2_CID_SATURATION) == infoMap.end() ||\n> > +                 infoMap.find(VIVID_CID_INTEGER64) == infoMap.end() ||\n> >                   infoMap.find(VIVID_CID_U8_4D_ARRAY) == infoMap.end()) {\n> >                       cerr << \"Missing controls\" << endl;\n> >                       return TestFail;\n> > @@ -54,12 +56,14 @@ protected:\n> >               const ControlInfo &brightness =\n> infoMap.find(V4L2_CID_BRIGHTNESS)->second;\n> >               const ControlInfo &contrast =\n> infoMap.find(V4L2_CID_CONTRAST)->second;\n> >               const ControlInfo &saturation =\n> infoMap.find(V4L2_CID_SATURATION)->second;\n> > +             const ControlInfo &int64 =\n> infoMap.find(VIVID_CID_INTEGER64)->second;\n> >               const ControlInfo &u8 =\n> infoMap.find(VIVID_CID_U8_4D_ARRAY)->second;\n> >\n> >               /* Test getting controls. */\n> >               ControlList ctrls = capture_->getControls({\n> V4L2_CID_BRIGHTNESS,\n> >\n>  V4L2_CID_CONTRAST,\n> >\n>  V4L2_CID_SATURATION,\n> > +\n>  VIVID_CID_INTEGER64,\n> >\n>  VIVID_CID_U8_4D_ARRAY });\n> >               if (ctrls.empty()) {\n> >                       cerr << \"Failed to get controls\" << endl;\n> > @@ -78,6 +82,12 @@ protected:\n> >                       return TestFail;\n> >               }\n> >\n> > +             /*\n> > +              * The VIVID_CID_INTEGER64 control can take any value,\n> just test\n> > +              * that its value can be retrieved and has the right type.\n> > +              */\n> > +             ctrls.get(VIVID_CID_INTEGER64).get<int64_t>();\n> > +\n> >               uint8_t u8Min = u8.min().get<uint8_t>();\n> >               uint8_t u8Max = u8.max().get<uint8_t>();\n> >\n> > @@ -94,6 +104,7 @@ protected:\n> >               ctrls.set(V4L2_CID_BRIGHTNESS, brightness.min());\n> >               ctrls.set(V4L2_CID_CONTRAST, contrast.max());\n> >               ctrls.set(V4L2_CID_SATURATION, saturation.min());\n> > +             ctrls.set(VIVID_CID_INTEGER64, int64.min());\n> >\n> >               std::array<uint8_t, VIVID_CID_U8_ARRAY_SIZE> u8Values;\n> >               std::fill(u8Values.begin(), u8Values.end(),\n> u8.min().get<uint8_t>());\n> > --\n> > Regards,\n> >\n> > Laurent Pinchart\n> >\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 3CB39C3203\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 26 May 2021 06:41:17 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B9CF968922;\n\tWed, 26 May 2021 08:41:16 +0200 (CEST)","from mail-ej1-x633.google.com (mail-ej1-x633.google.com\n\t[IPv6:2a00:1450:4864:20::633])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0E4516891B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 26 May 2021 08:41:16 +0200 (CEST)","by mail-ej1-x633.google.com with SMTP id b9so619942ejc.13\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 25 May 2021 23:41:16 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=chromium.org header.i=@chromium.org\n\theader.b=\"hPsZrYNI\"; 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=wCbvbI2MyTUnqyOMANumvWH0SiTqKjT5yqx794VhByM=;\n\tb=hPsZrYNIn2VDvPuT9jKZRG42gyw3j8IwFGrTVbGd5rxT6pVBS7TPvDxkhnDHxL1gB8\n\to1krEQD+sI0M0fbmXuuYpNnwcZ27OwrxMHHIZG9yYxmjrao9YAu6LkoffqUjk/5Hj32Y\n\tJsHpPlWLDkOTphGODmHbWRhsM7KYxMIPQm2Bk=","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=wCbvbI2MyTUnqyOMANumvWH0SiTqKjT5yqx794VhByM=;\n\tb=UbwSUCwsXDisEipNBLWNCz9fydh/2fmONZC0THHTEmmMa5W+mctBdysnfknjqS091J\n\t3PGmsmACZotOmqWh9GldwKCfWfobHVHn3LbMjAn2ZG0Fe77Sky2Val0VPhU4aPZtNTHY\n\tai/kiBz4NZgCkX0hzOLtameGZG8QILFoyoZaSTLRUy2HFex+tzGpg9tEbHLri09Yb8r2\n\tYCgbEwCthORuAKp5/+DMFwV6TGFeNaVif0VhhknO5AODurgjY56isaTHXs632qwPGeh6\n\t40b0YE8MseDyXePhO7FUjygXwBsuM17bKY7QT2Ltl1cIQBDtISBWNOco/uk1SziZI2bF\n\t/KgQ==","X-Gm-Message-State":"AOAM533nWz/Xhz4qdqcyPlpvPdnsQCJFGdrU7FHRaSjiwGWneToCRhXf\n\t7NsoppXHjZn83G1kNrq7daxiDp9CwO5Zc/tQk/PJFDzA7gE=","X-Google-Smtp-Source":"ABdhPJyYNK0xeZf79HEUFXKZ0Lyi+e0oyxOSPISZ/rnXApFZM86ys/ia1orQz8ZDw4hvrMcRBV6zMEYLPbLKmAqaBvg=","X-Received":"by 2002:a17:906:3a04:: with SMTP id\n\tz4mr32045335eje.221.1622011275646; \n\tTue, 25 May 2021 23:41:15 -0700 (PDT)","MIME-Version":"1.0","References":"<20210525094621.23029-1-laurent.pinchart@ideasonboard.com>\n\t<20210525104057.no7csqzvhvybumt7@uno.localdomain>","In-Reply-To":"<20210525104057.no7csqzvhvybumt7@uno.localdomain>","From":"Hirokazu Honda <hiroh@chromium.org>","Date":"Wed, 26 May 2021 15:41:04 +0900","Message-ID":"<CAO5uPHNWrUy_kWfxxvYN=TSHnte6iuELObfx2K32WdSHuzh=kw@mail.gmail.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Content-Type":"multipart/alternative; boundary=\"000000000000e8261a05c335edda\"","Subject":"Re: [libcamera-devel] [PATCH] test: v4l2_videodevice: controls:\n\tTest 64-bit 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>","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>"}}]