{"id":12403,"url":"https://patchwork.libcamera.org/api/1.1/patches/12403/?format=json","web_url":"https://patchwork.libcamera.org/patch/12403/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210525094621.23029-1-laurent.pinchart@ideasonboard.com>","date":"2021-05-25T09:46:21","name":"[libcamera-devel] test: v4l2_videodevice: controls: Test 64-bit controls","commit_ref":null,"pull_url":null,"state":"accepted","archived":false,"hash":"75f3bf6a1db073c3de8780858da87b940840eb67","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/1.1/people/2/?format=json","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/12403/mbox/","series":[{"id":2063,"url":"https://patchwork.libcamera.org/api/1.1/series/2063/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2063","date":"2021-05-25T09:46:21","name":"[libcamera-devel] test: v4l2_videodevice: controls: Test 64-bit controls","version":1,"mbox":"https://patchwork.libcamera.org/series/2063/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/12403/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/12403/checks/","tags":{},"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 80A08C3200\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 25 May 2021 09:46:34 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id E8E9268921;\n\tTue, 25 May 2021 11:46:33 +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 ECBB7602AF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 25 May 2021 11:46:32 +0200 (CEST)","from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B6D88344;\n\tTue, 25 May 2021 11:46:31 +0200 (CEST)"],"Authentication-Results":"lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"PiyYxFCA\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1621935992;\n\tbh=PZT+4S+FzBOA2T7h/UskEXloQvnR3HhuY17sHvqGqtw=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=PiyYxFCAeXamlChcLZCY7s3xnTCpu8Jf+HtfmrdsSzgSt2/If92SFcERRMu6aFH89\n\teF5jFk56PWuAUqfqhfOwxYrt1p47zVGExum5cYYvSKNeGBSaJRWeK1KykxigFRKb4x\n\t4Y4Tv70H9GzebWZ9kT6q9jyH88G28T6mQT8sSNvg=","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 25 May 2021 12:46:21 +0300","Message-Id":"<20210525094621.23029-1-laurent.pinchart@ideasonboard.com>","X-Mailer":"git-send-email 2.28.1","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH] test: v4l2_videodevice: controls: Test\n\t64-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>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The recent merge (and revert) of commit 34bee5e84ecb (\"libcamera:\nV4L2Device: Remove the controls order assumption in updateControls()\")\nshowed that 64-bit controls were missing from unit tests.\n\nFix this by testing the VIVID_CID_INTEGER64 control in the V4L2 video\ndevice controls test.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n test/v4l2_videodevice/controls.cpp | 11 +++++++++++\n 1 file changed, 11 insertions(+)","diff":"diff --git a/test/v4l2_videodevice/controls.cpp b/test/v4l2_videodevice/controls.cpp\nindex 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 #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","prefixes":["libcamera-devel"]}