Patch Detail
Show a patch.
GET /api/1.1/patches/12249/?format=api
{ "id": 12249, "url": "https://patchwork.libcamera.org/api/1.1/patches/12249/?format=api", "web_url": "https://patchwork.libcamera.org/patch/12249/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20210510174304.560185-1-nfraprado@collabora.com>", "date": "2021-05-10T17:43:04", "name": "[libcamera-devel] lc-compliance: Add test to call multiple configure()", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "a6f50561839a1aea71bc3bd9a49f1a63a56f4e6c", "submitter": { "id": 84, "url": "https://patchwork.libcamera.org/api/1.1/people/84/?format=api", "name": "Nícolas F. R. A. Prado", "email": "nfraprado@collabora.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/12249/mbox/", "series": [ { "id": 2017, "url": "https://patchwork.libcamera.org/api/1.1/series/2017/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2017", "date": "2021-05-10T17:43:04", "name": "[libcamera-devel] lc-compliance: Add test to call multiple configure()", "version": 1, "mbox": "https://patchwork.libcamera.org/series/2017/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/12249/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/12249/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 8A75BBF829\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 10 May 2021 17:43:57 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 07CBA688E5;\n\tMon, 10 May 2021 19:43:57 +0200 (CEST)", "from bhuna.collabora.co.uk (bhuna.collabora.co.uk\n\t[IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A3D38602BE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 10 May 2021 19:43:55 +0200 (CEST)", "from localhost.localdomain (unknown\n\t[IPv6:2804:14c:1a9:2978:985c:7892:ebcf:7a90])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128\n\tbits))\n\t(No client certificate requested) (Authenticated sender: nfraprado)\n\tby bhuna.collabora.co.uk (Postfix) with ESMTPSA id 190E61F41EF4;\n\tMon, 10 May 2021 18:43:52 +0100 (BST)" ], "From": "=?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= <nfraprado@collabora.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 10 May 2021 14:43:04 -0300", "Message-Id": "<20210510174304.560185-1-nfraprado@collabora.com>", "X-Mailer": "git-send-email 2.31.1", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH] lc-compliance: Add test to call multiple\n\tconfigure()", "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": "kernel@collabora.com, =?utf-8?q?Andr=C3=A9_Almeida?=\n\t<andrealmeid@collabora.com>", "Content-Type": "text/plain; charset=\"utf-8\"", "Content-Transfer-Encoding": "base64", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Add a test to lc-compliance that calls configure() multiple times on the\ncamera before starting to capture. This isn't a common pattern for\napplications but is allowed and so should be tested by lc-compliance.\n\nSigned-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>\n---\n\nThis tests multiple generateConfiguration() -> validate() -> configure()\nsequences, but maybe it would be valuable to test repetitions of each one of\nthose steps in the test? Although I think repeating the whole sequence should\nalready catch any bug, it may be better for lc-compliance to test too much\nrather than too little.\n\nRepeating each step individually would duplicate a bit of code, and require\nSimpleCapture::config_ to be public, but that may be inevitable if we want to\ninspect and fiddle with those properties during the tests.\n\nAlso, this doesn't really check if the last configured role is the one in effect\nduring the capture. Is that even something verifiable? It doesn't seem to be\nsince each pipeline handler decides what each role means.\n\n src/lc-compliance/single_stream.cpp | 44 ++++++++++++++++++++++++-----\n 1 file changed, 37 insertions(+), 7 deletions(-)", "diff": "diff --git a/src/lc-compliance/single_stream.cpp b/src/lc-compliance/single_stream.cpp\nindex 8318b42f42d6..6f1c259547a7 100644\n--- a/src/lc-compliance/single_stream.cpp\n+++ b/src/lc-compliance/single_stream.cpp\n@@ -12,6 +12,13 @@\n \n using namespace libcamera;\n \n+static const std::vector<std::pair<std::string, StreamRole>> roles = {\n+\t{ \"raw\", Raw },\n+\t{ \"still\", StillCapture },\n+\t{ \"video\", VideoRecording },\n+\t{ \"viewfinder\", Viewfinder },\n+};\n+\n Results::Result testRequestBalance(std::shared_ptr<Camera> camera,\n \t\t\t\t StreamRole role, unsigned int startCycles,\n \t\t\t\t unsigned int numRequests)\n@@ -33,6 +40,25 @@ Results::Result testRequestBalance(std::shared_ptr<Camera> camera,\n \t\tstd::to_string(startCycles) + \" start cycles\" };\n }\n \n+Results::Result testMultipleConfigures(std::shared_ptr<Camera> camera,\n+\t\t\t\t StreamRole role, unsigned int numRequests)\n+{\n+\tResults::Result ret;\n+\n+\tSimpleCaptureBalanced capture(camera);\n+\n+\tfor (auto r: roles) {\n+\t\tret = capture.configure(r.second);\n+\t\tif (ret.first == Results::Fail)\n+\t\t\treturn ret;\n+\t}\n+\tret = capture.configure(role);\n+\tif (ret.first != Results::Pass)\n+\t\treturn ret;\n+\n+\treturn capture.capture(numRequests);\n+}\n+\n Results::Result testRequestUnbalance(std::shared_ptr<Camera> camera,\n \t\t\t\t StreamRole role, unsigned int numRequests)\n {\n@@ -47,15 +73,9 @@ Results::Result testRequestUnbalance(std::shared_ptr<Camera> camera,\n \n Results testSingleStream(std::shared_ptr<Camera> camera)\n {\n-\tstatic const std::vector<std::pair<std::string, StreamRole>> roles = {\n-\t\t{ \"raw\", Raw },\n-\t\t{ \"still\", StillCapture },\n-\t\t{ \"video\", VideoRecording },\n-\t\t{ \"viewfinder\", Viewfinder },\n-\t};\n \tstatic const std::vector<unsigned int> numRequests = { 1, 2, 3, 5, 8, 13, 21, 34, 55, 89 };\n \n-\tResults results(numRequests.size() * roles.size() * 3);\n+\tResults results(numRequests.size() * roles.size() * 3 + roles.size());\n \n \tfor (const auto &role : roles) {\n \t\tstd::cout << \"= Test role \" << role.first << std::endl;\n@@ -91,6 +111,16 @@ Results testSingleStream(std::shared_ptr<Camera> camera)\n \t\tstd::cout << \"* Test unbalanced stop\" << std::endl;\n \t\tfor (unsigned int num : numRequests)\n \t\t\tresults.add(testRequestUnbalance(camera, role.second, num));\n+\n+\t\t/*\n+\t\t * Test multiple configure()\n+\t\t *\n+\t\t * Makes sure that the camera supports being configured multiple\n+\t\t * times, with only the last one taking effect, before starting\n+\t\t * to capture.\n+\t\t */\n+\t\tstd::cout << \"* Test multiple configure()\" << std::endl;\n+\t\tresults.add(testMultipleConfigures(camera, role.second, numRequests.back()));\n \t}\n \n \treturn results;\n", "prefixes": [ "libcamera-devel" ] }