Patch Detail
Show a patch.
GET /api/1.1/patches/20119/?format=api
{ "id": 20119, "url": "https://patchwork.libcamera.org/api/1.1/patches/20119/?format=api", "web_url": "https://patchwork.libcamera.org/patch/20119/", "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": "<20240529154341.10426-2-laurent.pinchart@ideasonboard.com>", "date": "2024-05-29T15:43:36", "name": "[v2,1/6] test: camera: Increase timeout for vimc capture tests", "commit_ref": "0554a55427b4b742dbaf473562dcc2d85ef15756", "pull_url": null, "state": "accepted", "archived": false, "hash": "8b57a1ea8f74dff3cb727843faf422bd70722420", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/20119/mbox/", "series": [ { "id": 4333, "url": "https://patchwork.libcamera.org/api/1.1/series/4333/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4333", "date": "2024-05-29T15:43:35", "name": "vimc scaling improvements", "version": 2, "mbox": "https://patchwork.libcamera.org/series/4333/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/20119/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/20119/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 06204BDE6B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 29 May 2024 15:43:59 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F0B19634BB;\n\tWed, 29 May 2024 17:43:57 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9888E6347E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 29 May 2024 17:43:54 +0200 (CEST)", "from pendragon.ideasonboard.com (81-175-209-231.bb.dnainternet.fi\n\t[81.175.209.231])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E6671149B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 29 May 2024 17:43:50 +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=\"PY90ObSG\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1716997431;\n\tbh=rQX9K/c8x4MK/S49cTPA1lVubY9prEhgcIrdoHvNTaQ=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=PY90ObSGxBjZSXA4X1Qdtomg5eH4kGec+X0/ha0qiN0jQ3DIxQgn66AfaY+CkY9AF\n\tvL4/x/GTtasePDxYWCSHSBNpEX+Y8NYD84fNZZYeoA1o+1Mi9BRKsZ9s8FYpaLOs1h\n\tWneLzHZ9Qku9NWdVMfMP2M0AgvO9G1P0viAuUQZk=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Subject": "[PATCH v2 1/6] test: camera: Increase timeout for vimc capture tests", "Date": "Wed, 29 May 2024 18:43:36 +0300", "Message-ID": "<20240529154341.10426-2-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.44.1", "In-Reply-To": "<20240529154341.10426-1-laurent.pinchart@ideasonboard.com>", "References": "<20240529154341.10426-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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": "On slower machines, a 1s timeout to capture frames with vimc can be too\nshort and cause test failures. Make the timeout proportional to the\nnumber of frames expected to be captured, using a conservative low\nestimate of the frame rate at 2fps.\n\nBy itself, that change could increase the test time quite substantially\non fast platforms, so break from the capture loop as soon as we capture\nenough frames. To do so, interrupt the dispatcher at every request\ncompletion, or it will only get interrupted after the timer times out.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n test/camera/buffer_import.cpp | 21 +++++++++++++++------\n test/camera/capture.cpp | 22 ++++++++++++++--------\n 2 files changed, 29 insertions(+), 14 deletions(-)", "diff": "diff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp\nindex 9288400474a7..815d1caed9f3 100644\n--- a/test/camera/buffer_import.cpp\n+++ b/test/camera/buffer_import.cpp\n@@ -63,6 +63,8 @@ protected:\n \t\trequest->reuse();\n \t\trequest->addBuffer(stream, buffer);\n \t\tcamera_->queueRequest(request);\n+\n+\t\tdispatcher_->interrupt();\n \t}\n \n \tint init() override\n@@ -76,6 +78,8 @@ protected:\n \t\t\treturn TestFail;\n \t\t}\n \n+\t\tdispatcher_ = Thread::current()->eventDispatcher();\n+\n \t\treturn TestPass;\n \t}\n \n@@ -133,17 +137,20 @@ protected:\n \t\t\t}\n \t\t}\n \n-\t\tEventDispatcher *dispatcher = Thread::current()->eventDispatcher();\n+\t\tconst unsigned int nFrames = cfg.bufferCount * 2;\n \n \t\tTimer timer;\n-\t\ttimer.start(1000ms);\n-\t\twhile (timer.isRunning())\n-\t\t\tdispatcher->processEvents();\n+\t\ttimer.start(500ms * nFrames);\n+\t\twhile (timer.isRunning()) {\n+\t\t\tdispatcher_->processEvents();\n+\t\t\tif (completeRequestsCount_ > nFrames)\n+\t\t\t\tbreak;\n+\t\t}\n \n-\t\tif (completeRequestsCount_ < cfg.bufferCount * 2) {\n+\t\tif (completeRequestsCount_ < nFrames) {\n \t\t\tstd::cout << \"Failed to capture enough frames (got \"\n \t\t\t\t << completeRequestsCount_ << \" expected at least \"\n-\t\t\t\t << cfg.bufferCount * 2 << \")\" << std::endl;\n+\t\t\t\t << nFrames << \")\" << std::endl;\n \t\t\treturn TestFail;\n \t\t}\n \n@@ -161,6 +168,8 @@ protected:\n \t}\n \n private:\n+\tEventDispatcher *dispatcher_;\n+\n \tstd::vector<std::unique_ptr<Request>> requests_;\n \n \tunsigned int completeBuffersCount_;\ndiff --git a/test/camera/capture.cpp b/test/camera/capture.cpp\nindex de824083dfed..8766fb194ee5 100644\n--- a/test/camera/capture.cpp\n+++ b/test/camera/capture.cpp\n@@ -59,6 +59,8 @@ protected:\n \t\trequest->reuse();\n \t\trequest->addBuffer(stream, buffer);\n \t\tcamera_->queueRequest(request);\n+\n+\t\tdispatcher_->interrupt();\n \t}\n \n \tint init() override\n@@ -73,6 +75,7 @@ protected:\n \t\t}\n \n \t\tallocator_ = new FrameBufferAllocator(camera_);\n+\t\tdispatcher_ = Thread::current()->eventDispatcher();\n \n \t\treturn TestPass;\n \t}\n@@ -135,19 +138,20 @@ protected:\n \t\t\t}\n \t\t}\n \n-\t\tEventDispatcher *dispatcher = Thread::current()->eventDispatcher();\n+\t\tunsigned int nFrames = allocator_->buffers(stream).size() * 2;\n \n \t\tTimer timer;\n-\t\ttimer.start(1000ms);\n-\t\twhile (timer.isRunning())\n-\t\t\tdispatcher->processEvents();\n+\t\ttimer.start(500ms * nFrames);\n+\t\twhile (timer.isRunning()) {\n+\t\t\tdispatcher_->processEvents();\n+\t\t\tif (completeRequestsCount_ > nFrames)\n+\t\t\t\tbreak;\n+\t\t}\n \n-\t\tunsigned int nbuffers = allocator_->buffers(stream).size();\n-\n-\t\tif (completeRequestsCount_ < nbuffers * 2) {\n+\t\tif (completeRequestsCount_ < nFrames) {\n \t\t\tcout << \"Failed to capture enough frames (got \"\n \t\t\t << completeRequestsCount_ << \" expected at least \"\n-\t\t\t << nbuffers * 2 << \")\" << endl;\n+\t\t\t << nFrames * 2 << \")\" << endl;\n \t\t\treturn TestFail;\n \t\t}\n \n@@ -164,6 +168,8 @@ protected:\n \t\treturn TestPass;\n \t}\n \n+\tEventDispatcher *dispatcher_;\n+\n \tstd::vector<std::unique_ptr<Request>> requests_;\n \n \tstd::unique_ptr<CameraConfiguration> config_;\n", "prefixes": [ "v2", "1/6" ] }