Show a patch.

GET /api/1.1/patches/19946/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 19946,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/19946/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/19946/",
    "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": "<20240424234224.9658-2-laurent.pinchart@ideasonboard.com>",
    "date": "2024-04-24T23:42:19",
    "name": "[v1,1/6] test: camera: Increase timeout for vimc capture tests",
    "commit_ref": null,
    "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/19946/mbox/",
    "series": [
        {
            "id": 4271,
            "url": "https://patchwork.libcamera.org/api/1.1/series/4271/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4271",
            "date": "2024-04-24T23:42:18",
            "name": "vimc scaling improvements",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/4271/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/19946/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/19946/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 82793C3200\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 24 Apr 2024 23:42:42 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id D6DF563407;\n\tThu, 25 Apr 2024 01:42:35 +0200 (CEST)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 278D4633F2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 25 Apr 2024 01:42:32 +0200 (CEST)",
            "from pendragon.ideasonboard.com\n\t(117.145-247-81.adsl-dyn.isp.belgacom.be [81.247.145.117])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id ECE484D0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 25 Apr 2024 01:41:39 +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=\"WPGxN5za\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1714002100;\n\tbh=j4wp+uWvdO43nbLMWW29TQUr4Uf/sNWPVhidqrQeG+w=;\n\th=From:To:Subject:Date:In-Reply-To:References:From;\n\tb=WPGxN5zazvXghE4t4cXKOGZYNtpXO5/lEwQjjpX8d76xooZvp5x8mjtwXXRlYnWJT\n\tqiw2b6DJif/3I5gh27kOFXRpq4tkjcDUqe/fClv/p0lMyHl0GVp9GtTpriCLUv2AkM\n\tfmNtyK4HtcvR7oRXIeBUMo3Mb3MPa0lq2Z5X0r3A=",
        "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Subject": "[PATCH v1 1/6] test: camera: Increase timeout for vimc capture tests",
        "Date": "Thu, 25 Apr 2024 02:42:19 +0300",
        "Message-ID": "<20240424234224.9658-2-laurent.pinchart@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.43.2",
        "In-Reply-To": "<20240424234224.9658-1-laurent.pinchart@ideasonboard.com>",
        "References": "<20240424234224.9658-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>\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": [
        "v1",
        "1/6"
    ]
}