Show a patch.

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

{
    "id": 12857,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/12857/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/12857/",
    "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": "<20210707144202.1327061-4-nfraprado@collabora.com>",
    "date": "2021-07-07T14:41:55",
    "name": "[libcamera-devel,v5,03/10] lc-compliance: Move buffer allocation to separate function",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "b99954e5ddf713f20e8b9ca64ca3a83c2c58a379",
    "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/12857/mbox/",
    "series": [
        {
            "id": 2216,
            "url": "https://patchwork.libcamera.org/api/1.1/series/2216/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2216",
            "date": "2021-07-07T14:41:52",
            "name": "lc-compliance: Add test to queue more requests than hardware depth",
            "version": 5,
            "mbox": "https://patchwork.libcamera.org/series/2216/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/12857/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/12857/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 C1BDCBD794\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  7 Jul 2021 14:42:26 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 904CB6851F;\n\tWed,  7 Jul 2021 16:42:26 +0200 (CEST)",
            "from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id C98926028E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  7 Jul 2021 16:42:24 +0200 (CEST)",
            "from localhost.localdomain (unknown\n\t[IPv6:2804:14c:1a9:2434:6553:ad0c:9d2a:24db])\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 58EBA1F434B8;\n\tWed,  7 Jul 2021 15:42:23 +0100 (BST)"
        ],
        "From": "=?utf-8?b?TsOtY29sYXMgRi4gUi4gQS4gUHJhZG8=?= <nfraprado@collabora.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed,  7 Jul 2021 11:41:55 -0300",
        "Message-Id": "<20210707144202.1327061-4-nfraprado@collabora.com>",
        "X-Mailer": "git-send-email 2.32.0",
        "In-Reply-To": "<20210707144202.1327061-1-nfraprado@collabora.com>",
        "References": "<20210707144202.1327061-1-nfraprado@collabora.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v5 03/10] lc-compliance: Move buffer\n\tallocation to separate function",
        "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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Move buffer allocation to its own function and with a count argument so\ntests can specify how many buffers to allocate.\n\nAlso add an overloaded function with no arguments and that allocates\nMinNumRequests buffers for easier use by current tests.\n\nSigned-off-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>\n---\n\nAdded in v5\n\n src/lc-compliance/capture_test.cpp   |  8 +++++++-\n src/lc-compliance/simple_capture.cpp | 15 +++++++++++----\n src/lc-compliance/simple_capture.h   |  2 ++\n 3 files changed, 20 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/src/lc-compliance/capture_test.cpp b/src/lc-compliance/capture_test.cpp\nindex 52578207c11f..6439cbd88f8e 100644\n--- a/src/lc-compliance/capture_test.cpp\n+++ b/src/lc-compliance/capture_test.cpp\n@@ -80,6 +80,8 @@ TEST_P(SingleStream, Capture)\n \n \tcapture.configure(role);\n \n+\tcapture.allocateBuffers();\n+\n \tcapture.capture(numRequests);\n }\n \n@@ -99,8 +101,10 @@ TEST_P(SingleStream, CaptureStartStop)\n \n \tcapture.configure(role);\n \n-\tfor (unsigned int starts = 0; starts < numRepeats; starts++)\n+\tfor (unsigned int starts = 0; starts < numRepeats; starts++) {\n+\t\tcapture.allocateBuffers();\n \t\tcapture.capture(numRequests);\n+\t}\n }\n \n /*\n@@ -118,6 +122,8 @@ TEST_P(SingleStream, UnbalancedStop)\n \n \tcapture.configure(role);\n \n+\tcapture.allocateBuffers();\n+\n \tcapture.capture(numRequests);\n }\n \ndiff --git a/src/lc-compliance/simple_capture.cpp b/src/lc-compliance/simple_capture.cpp\nindex 35dfccd664eb..b20e2cefc000 100644\n--- a/src/lc-compliance/simple_capture.cpp\n+++ b/src/lc-compliance/simple_capture.cpp\n@@ -44,15 +44,22 @@ void SimpleCapture::configure(StreamRole role)\n \t}\n }\n \n-void SimpleCapture::start()\n+void SimpleCapture::allocateBuffers()\n+{\n+\tallocateBuffers(camera_->properties().get(properties::MinNumRequests));\n+}\n+\n+void SimpleCapture::allocateBuffers(unsigned int count)\n {\n-\tunsigned int bufferCount = camera_->properties().get(properties::MinNumRequests);\n \tStream *stream = config_->at(0).stream();\n-\tint count = allocator_->allocate(stream, bufferCount);\n+\tint allocatedCount = allocator_->allocate(stream, count);\n \n \tASSERT_GE(count, 0) << \"Failed to allocate buffers\";\n-\tEXPECT_EQ(count, static_cast<int>(bufferCount)) << \"Allocated less buffers than expected\";\n+\tEXPECT_EQ(allocatedCount, static_cast<int>(count)) << \"Allocated less buffers than expected\";\n+}\n \n+void SimpleCapture::start()\n+{\n \tcamera_->requestCompleted.connect(this, &SimpleCapture::requestComplete);\n \n \tASSERT_EQ(camera_->start(), 0) << \"Failed to start camera\";\ndiff --git a/src/lc-compliance/simple_capture.h b/src/lc-compliance/simple_capture.h\nindex 100ffd6637ad..1a1e874a528c 100644\n--- a/src/lc-compliance/simple_capture.h\n+++ b/src/lc-compliance/simple_capture.h\n@@ -17,6 +17,8 @@ class SimpleCapture\n {\n public:\n \tvoid configure(libcamera::StreamRole role);\n+\tvoid allocateBuffers();\n+\tvoid allocateBuffers(unsigned int count);\n \n protected:\n \tSimpleCapture(std::shared_ptr<libcamera::Camera> camera);\n",
    "prefixes": [
        "libcamera-devel",
        "v5",
        "03/10"
    ]
}