Show a patch.

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

{
    "id": 18069,
    "url": "https://patchwork.libcamera.org/api/patches/18069/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/18069/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/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-14-paul.elder@ideasonboard.com>",
    "date": "2022-12-28T22:29:57",
    "name": "[libcamera-devel,v10,13/19] lc-compliance: Move buffer allocation to separate function",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "2dfdb31941406701c8eca9a252b62136ffb16468",
    "submitter": {
        "id": 17,
        "url": "https://patchwork.libcamera.org/api/people/17/?format=api",
        "name": "Paul Elder",
        "email": "paul.elder@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/18069/mbox/",
    "series": [
        {
            "id": 3691,
            "url": "https://patchwork.libcamera.org/api/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/18069/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/18069/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 AAF07C3226\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 28 Dec 2022 22:30:41 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 67222625EC;\n\tWed, 28 Dec 2022 23:30:41 +0100 (CET)",
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 907CD625ED\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 28 Dec 2022 23:30:33 +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 6BCE2109;\n\tWed, 28 Dec 2022 23:30:32 +0100 (CET)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1672266641;\n\tbh=0Ty1h03QfLcxojEN+CbLhHIvt/SjBcyEsZ0W/uCgrXs=;\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=lgUl7EbiMbbEMsdsK4Foi/2ql82qGLcMngwkNpdr4E222aAAz+wzl9XvpG22fI4aq\n\tRm94lx1PbLt7QwzzjBSpy4j/4i1qeX5KUc4XjTvw7kpyVJxA7J/0qKMGGjfb0LBBXn\n\tle1tlx3J6J2AADKcCRh8BceNy8QYDYTlW1X7akhOSK5OOIJrCywbqrhCFxmFvGByy5\n\ttVjiSAvvLho/6kw7dE8ihR6BNwMp1YxBJatEk20rK59KkV9IDSz2EmPk0c01Tyl2Hx\n\teKR7RYQdiYVAzXMitM4KePvPNuh4ufwA+KUL06f0i9tav8xdKyJ5hUDc62JpVJtj1e\n\tumuDRQ8k8dU7g==",
            "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1672266633;\n\tbh=0Ty1h03QfLcxojEN+CbLhHIvt/SjBcyEsZ0W/uCgrXs=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=PbO5Vh58kutGGrUTOQsGgtwrExIlDT+8RXva8TRwfan4fhorojLk6MBNMHCwITMPE\n\tNNpgI6WY2SbLHad7omrTCYKMbY845MqE47dLRugU3cNttFq1ptA+0fv+Mwbhn/MXoT\n\taazdez6FqHIQbfWN11+cfVnbhFQWcYQTvkA2wGWc="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"PbO5Vh58\"; dkim-atps=neutral",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 28 Dec 2022 16:29:57 -0600",
        "Message-Id": "<20221228223003.2265712-14-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 13/19] 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>",
        "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\nMove buffer allocation to its own function and with an optional count\nargument so tests can specify how many buffers to allocate. When count\nis omitted, allocate MinimumRequests buffers.\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\nChanges in v8:\n- Made SimpleCapture::allocateBuffers() a single function with an optional parameter\n\nChanges in v5:\n- New\n---\n src/apps/lc-compliance/capture_test.cpp   |  8 +++++++-\n src/apps/lc-compliance/simple_capture.cpp | 16 ++++++++++------\n src/apps/lc-compliance/simple_capture.h   |  1 +\n 3 files changed, 18 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/src/apps/lc-compliance/capture_test.cpp b/src/apps/lc-compliance/capture_test.cpp\nindex 1dcfcf92..923395cf 100644\n--- a/src/apps/lc-compliance/capture_test.cpp\n+++ b/src/apps/lc-compliance/capture_test.cpp\n@@ -87,6 +87,8 @@ TEST_P(SingleStream, Capture)\n \n \tcapture.configure(role);\n \n+\tcapture.allocateBuffers();\n+\n \tcapture.capture(numRequests);\n }\n \n@@ -106,8 +108,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@@ -125,6 +129,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/apps/lc-compliance/simple_capture.cpp b/src/apps/lc-compliance/simple_capture.cpp\nindex be495986..1e3e816a 100644\n--- a/src/apps/lc-compliance/simple_capture.cpp\n+++ b/src/apps/lc-compliance/simple_capture.cpp\n@@ -44,16 +44,20 @@ void SimpleCapture::configure(StreamRole role)\n \t}\n }\n \n-void SimpleCapture::start()\n+void SimpleCapture::allocateBuffers(unsigned int count)\n {\n-\tunsigned int bufferCount =\n-\t\tcamera_->properties().get(properties::MinimumRequests).value();\n+\tif (!count)\n+\t\tcount = camera_->properties().get(properties::MinimumRequests).value();\n+\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, bufferCount) << \"Allocated less buffers than expected\";\n+\tASSERT_GE(allocatedCount, 0) << \"Failed to allocate buffers\";\n+\tEXPECT_EQ(allocatedCount, 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/apps/lc-compliance/simple_capture.h b/src/apps/lc-compliance/simple_capture.h\nindex 2911d601..b3091547 100644\n--- a/src/apps/lc-compliance/simple_capture.h\n+++ b/src/apps/lc-compliance/simple_capture.h\n@@ -17,6 +17,7 @@ class SimpleCapture\n {\n public:\n \tvoid configure(libcamera::StreamRole role);\n+\tvoid allocateBuffers(unsigned int count = 0);\n \n protected:\n \tSimpleCapture(std::shared_ptr<libcamera::Camera> camera);\n",
    "prefixes": [
        "libcamera-devel",
        "v10",
        "13/19"
    ]
}