Patch Detail
Show a patch.
GET /api/1.1/patches/18073/?format=api
{ "id": 18073, "url": "https://patchwork.libcamera.org/api/1.1/patches/18073/?format=api", "web_url": "https://patchwork.libcamera.org/patch/18073/", "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": "<20221228223003.2265712-18-paul.elder@ideasonboard.com>", "date": "2022-12-28T22:30:01", "name": "[libcamera-devel,v10,17/19] lc-compliance: Add test to queue more requests than hardware depth", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "a8ed6401e969df260c91ea79f40aad2e938227a8", "submitter": { "id": 17, "url": "https://patchwork.libcamera.org/api/1.1/people/17/?format=api", "name": "Paul Elder", "email": "paul.elder@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/18073/mbox/", "series": [ { "id": 3691, "url": "https://patchwork.libcamera.org/api/1.1/series/3691/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3691", "date": "2022-12-28T22:29:44", "name": "lc-compliance: Add test to queue more requests than hardware depth", "version": 10, "mbox": "https://patchwork.libcamera.org/series/3691/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/18073/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/18073/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 821D3C3226\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 28 Dec 2022 22:30:43 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3DB5D625E4;\n\tWed, 28 Dec 2022 23:30:43 +0100 (CET)", "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 4204B625F6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 28 Dec 2022 23:30:39 +0100 (CET)", "from pyrite.mediacom.info (unknown\n\t[IPv6:2604:2d80:ad8a:9000:1bf9:855b:22de:3645])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id ECE3F109;\n\tWed, 28 Dec 2022 23:30:37 +0100 (CET)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1672266643;\n\tbh=OEmstN1ZafXMAjzzMaEtkY6Zm9yHYv3lOWuomsxExj8=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=0kV8fxGgcduh+feHaroXaQiXgWKBqRVFCkNwQOnABx0JHwkW2K+l1FVGwaa/m/Orb\n\td0q8p3HLQRmfeIuSHhVyY01qEQXkJHPHU5UHvfOb0+yAmU50XrBoU3K2olhoqcC2ow\n\tFIGicdUmxA7tZ5RICZWSYURPobODZy8bsfC6pD/3QdCuPSPDuW9IjJGq4ihBf/mPi6\n\tKmTW+k6m/YLvQT0dlaqFrRTMom8sWp1sYOnY34K3YSCGQ+AaXZo8Gy4NtoZ7cU64tn\n\tsLRlnKWuzZkABV46ImWLPl/9JDEK4oEJlIUsN5wrqJkpz4A2BQjIdJ91LTalzWGNEJ\n\tuaRqhZTKf2RxQ==", "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1672266638;\n\tbh=OEmstN1ZafXMAjzzMaEtkY6Zm9yHYv3lOWuomsxExj8=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=vMKfGjWi55kFLml7SrKkz22GgHCQBzVr34u3vuR54xSb2AJqXVlOOAvyrq7Cr5kl1\n\t4o3ej1Vo+QQ5BWRq9iSm2UaqstBjizgQ7aczG599XyjMmsyXnwxW3PQfOPVqxY5rsg\n\tGq/O0VfmmjMb3ANvJaw1GxWZ7at5AfNciUZ/V08M=" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"vMKfGjWi\"; dkim-atps=neutral", "To": "libcamera-devel@lists.libcamera.org", "Date": "Wed, 28 Dec 2022 16:30:01 -0600", "Message-Id": "<20221228223003.2265712-18-paul.elder@ideasonboard.com>", "X-Mailer": "git-send-email 2.35.1", "In-Reply-To": "<20221228223003.2265712-1-paul.elder@ideasonboard.com>", "References": "<20221228223003.2265712-1-paul.elder@ideasonboard.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v10 17/19] lc-compliance: Add test to\n\tqueue more requests than hardware depth", "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>", "From": "Paul Elder via libcamera-devel <libcamera-devel@lists.libcamera.org>", "Reply-To": "Paul Elder <paul.elder@ideasonboard.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "From: Nícolas F. R. A. Prado <nfraprado@collabora.com>\n\nA pipeline handler should be able to handle an arbitrary number of\nsimultaneous requests by submitting what it can to the video device and\nqueuing the rest internally until resources are available. This isn't\ncurrently done by some pipeline handlers however [1].\n\nAdd a new test to lc-compliance that submits a lot of requests at once\nto check if the pipeline handler is behaving well in this situation.\n\n[1] https://bugs.libcamera.org/show_bug.cgi?id=24\n\nSigned-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\nSigned-off-by: Paul Elder <paul.elder@ideasonboard.com>\n\n---\nChanges in v9:\n- rebased\n\n(no changes since v6)\n\nChanges in v6:\n- Made MAX_SIMULTANEOUS_REQUESTS a constexpr\n\nChanges in v5:\n- Updated to use googletest, and CameraHolder and roleToString from previous\n patches\n---\n src/apps/lc-compliance/capture_test.cpp | 45 +++++++++++++++++++++++\n src/apps/lc-compliance/simple_capture.cpp | 29 +++++++++++++++\n src/apps/lc-compliance/simple_capture.h | 11 ++++++\n 3 files changed, 85 insertions(+)", "diff": "diff --git a/src/apps/lc-compliance/capture_test.cpp b/src/apps/lc-compliance/capture_test.cpp\nindex d62f7692..8dd26120 100644\n--- a/src/apps/lc-compliance/capture_test.cpp\n+++ b/src/apps/lc-compliance/capture_test.cpp\n@@ -23,6 +23,8 @@ const std::vector<StreamRole> ROLES = {\n \tStreamRole::Viewfinder\n };\n \n+static constexpr unsigned int MAX_SIMULTANEOUS_REQUESTS = 8;\n+\n static const std::string &roleToString(const StreamRole &role)\n {\n \tstatic const std::map<StreamRole, std::string> rolesMap = {\n@@ -59,12 +61,37 @@ void SingleStream::TearDown()\n \treleaseCamera();\n }\n \n+class RoleParametrizedTest : public testing::TestWithParam<StreamRole>, public CameraHolder\n+{\n+public:\n+\tstatic std::string nameParameters(const testing::TestParamInfo<RoleParametrizedTest::ParamType> &info);\n+\n+protected:\n+\tvoid SetUp() override;\n+\tvoid TearDown() override;\n+};\n+\n+void RoleParametrizedTest::SetUp()\n+{\n+\tacquireCamera();\n+}\n+\n+void RoleParametrizedTest::TearDown()\n+{\n+\treleaseCamera();\n+}\n+\n std::string SingleStream::nameParameters(const testing::TestParamInfo<SingleStream::ParamType> &info)\n {\n \treturn roleToString(std::get<0>(info.param)) + \"_\" +\n \t std::to_string(std::get<1>(info.param));\n }\n \n+std::string RoleParametrizedTest::nameParameters(const testing::TestParamInfo<RoleParametrizedTest::ParamType> &info)\n+{\n+\treturn roleToString(info.param);\n+}\n+\n /*\n * Test single capture cycles\n *\n@@ -127,8 +154,26 @@ TEST_P(SingleStream, UnbalancedStop)\n \tcapture.capture(numRequests);\n }\n \n+TEST_P(RoleParametrizedTest, Overflow)\n+{\n+\tauto role = GetParam();\n+\n+\tSimpleCaptureOverflow capture(camera_);\n+\n+\tcapture.configure(role);\n+\n+\tcapture.allocateBuffers(MAX_SIMULTANEOUS_REQUESTS);\n+\n+\tcapture.capture();\n+}\n+\n INSTANTIATE_TEST_SUITE_P(CaptureTests,\n \t\t\t SingleStream,\n \t\t\t testing::Combine(testing::ValuesIn(ROLES),\n \t\t\t\t\t testing::ValuesIn(NUMREQUESTS)),\n \t\t\t SingleStream::nameParameters);\n+\n+INSTANTIATE_TEST_SUITE_P(CaptureTests,\n+\t\t\t RoleParametrizedTest,\n+\t\t\t testing::ValuesIn(ROLES),\n+\t\t\t RoleParametrizedTest::nameParameters);\ndiff --git a/src/apps/lc-compliance/simple_capture.cpp b/src/apps/lc-compliance/simple_capture.cpp\nindex 6dd5c7af..a37a98ac 100644\n--- a/src/apps/lc-compliance/simple_capture.cpp\n+++ b/src/apps/lc-compliance/simple_capture.cpp\n@@ -205,3 +205,32 @@ void SimpleCaptureUnbalanced::requestComplete(Request *request)\n \tif (camera_->queueRequest(request))\n \t\tloop_->exit(-EINVAL);\n }\n+\n+/* SimpleCaptureOverflow */\n+\n+SimpleCaptureOverflow::SimpleCaptureOverflow(std::shared_ptr<Camera> camera)\n+\t: SimpleCapture(camera)\n+{\n+}\n+\n+void SimpleCaptureOverflow::capture()\n+{\n+\tstart();\n+\n+\tStream *stream = config_->at(0).stream();\n+\tconst std::vector<std::unique_ptr<FrameBuffer>> &buffers = allocator_->buffers(stream);\n+\n+\tcaptureCount_ = 0;\n+\tcaptureLimit_ = buffers.size();\n+\n+\tqueueRequests(stream, buffers);\n+\n+\trunCaptureSession();\n+\n+\tASSERT_EQ(captureCount_, captureLimit_);\n+}\n+\n+void SimpleCaptureOverflow::requestComplete([[maybe_unused]] Request *request)\n+{\n+\tcaptureCompleted();\n+}\ndiff --git a/src/apps/lc-compliance/simple_capture.h b/src/apps/lc-compliance/simple_capture.h\nindex 89ecc71c..18be8a01 100644\n--- a/src/apps/lc-compliance/simple_capture.h\n+++ b/src/apps/lc-compliance/simple_capture.h\n@@ -68,3 +68,14 @@ public:\n private:\n \tvoid requestComplete(libcamera::Request *request) override;\n };\n+\n+class SimpleCaptureOverflow : public SimpleCapture\n+{\n+public:\n+\tSimpleCaptureOverflow(std::shared_ptr<libcamera::Camera> camera);\n+\n+\tvoid capture();\n+\n+private:\n+\tvoid requestComplete(libcamera::Request *request) override;\n+};\n", "prefixes": [ "libcamera-devel", "v10", "17/19" ] }