Show a patch.

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

{
    "id": 14954,
    "url": "https://patchwork.libcamera.org/api/patches/14954/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/14954/",
    "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": "<20211201101508.10619-2-david.plowman@raspberrypi.com>",
    "date": "2021-12-01T10:15:07",
    "name": "[libcamera-devel,v2,1/2] pipeline: raspberrypi: Fix under-allocation of embedded data buffers",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "3fecf8e751764db0f89a1a525ce0e34a7177cb8e",
    "submitter": {
        "id": 42,
        "url": "https://patchwork.libcamera.org/api/people/42/?format=api",
        "name": "David Plowman",
        "email": "david.plowman@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/14954/mbox/",
    "series": [
        {
            "id": 2792,
            "url": "https://patchwork.libcamera.org/api/series/2792/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2792",
            "date": "2021-12-01T10:15:06",
            "name": "Buffer format and allocation fixes",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/2792/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/14954/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/14954/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 2314DC3250\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  1 Dec 2021 10:15:23 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B597360726;\n\tWed,  1 Dec 2021 11:15:21 +0100 (CET)",
            "from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com\n\t[IPv6:2a00:1450:4864:20::32c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 802D96011D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  1 Dec 2021 11:15:19 +0100 (CET)",
            "by mail-wm1-x32c.google.com with SMTP id\n\taz34-20020a05600c602200b0033bf8662572so741613wmb.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 01 Dec 2021 02:15:19 -0800 (PST)",
            "from pi4-davidp.pitowers.org\n\t([2a00:1098:3142:14:e4a2:3070:eea4:e434])\n\tby smtp.gmail.com with ESMTPSA id\n\tz18sm18815535wrq.11.2021.12.01.02.15.18\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 01 Dec 2021 02:15:18 -0800 (PST)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"ES6MRyMV\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=+5tbuXZiLzJgDNl3HF0j/KsQSSn76KepjHhFHoG2/N0=;\n\tb=ES6MRyMVTxgpba6yzEUFw7Vb3a0979G0PcTAPjBxFxwln3N+MB8XXxL8SBiJ5jLS6Z\n\tOJsI0i+3FG2cCMc9HgnMu7kkA0p2Y2x1XCpHMma9thzIwx0KMEEdxxyKyx7mnd7ZknYX\n\t4W8KbZHCcPwlhvqzfqxEXYvXNSzFo+OVXUn6wEqQvwtsDqSbqK9OXELZOI5f6908a3WS\n\tQVhZ20hy60nhRA0XGHB0gBv+f3uJ/Qpew/U9g8K3Az+4evHuy0dwyu1hvNx5YA8t4rW+\n\t61jWbVh86dmH2OKzGbaDiO7v76I9zqYvFLLzsS48zPyus75BjjxlNPUXhW8862Ngoq2K\n\tWBgg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=+5tbuXZiLzJgDNl3HF0j/KsQSSn76KepjHhFHoG2/N0=;\n\tb=btimOorGcxQBkWM+gMO7tRqjtDOkJ+Ii28CwJClzB5KbqYc83zXzBCi7F0RY/AvFgo\n\tcFugJ0Sc25JMZ7RpQV2I+vl3yV7FNNlcaen0f/+RB0Jd9QPnn1LGWudL/97RKs+IhXd5\n\t4XqEMiS4+eC5TGaVKg2nJQ2Ddy/9Z23t4X0a8qEOYJpSp2WOsun9deOPMp4dhiF4j/dY\n\tkSfHUK/bmB/NqHcIH/2MrWIBF8lyaVEXqzwrlWGF+RTg22ERNh9ivBVrMcR4tmtHpYhS\n\tdAGqzK/PUXnZyzKF3OQtuJaiAp/zj54zgyYB5OUFZyAaT60mRISkSHI7PasLMsAukYoq\n\t/bnA==",
        "X-Gm-Message-State": "AOAM531+7MnaPac9iCnhblLW20e2O1qvfvQ5/jebankWPmHFrCDjFxYH\n\td6eF+r0nXVhqQQCrwkiiiceAKstETezYEbkv",
        "X-Google-Smtp-Source": "ABdhPJxoxN2gvYiSz4KVvTvGyesZOFYsJliTDYeKSWhW5okpEel+gOsIEI+gdMfgV3AJjUt81ooHUA==",
        "X-Received": "by 2002:a05:600c:1987:: with SMTP id\n\tt7mr5716432wmq.24.1638353719007; \n\tWed, 01 Dec 2021 02:15:19 -0800 (PST)",
        "From": "David Plowman <david.plowman@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed,  1 Dec 2021 10:15:07 +0000",
        "Message-Id": "<20211201101508.10619-2-david.plowman@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.30.2",
        "In-Reply-To": "<20211201101508.10619-1-david.plowman@raspberrypi.com>",
        "References": "<20211201101508.10619-1-david.plowman@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 1/2] pipeline: raspberrypi: Fix\n\tunder-allocation of embedded data buffers",
        "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": "The code was reducing the number of raw stream buffers allocated when\nthe application is providing some of its own. However, it was not\ntaking account of the fact that the application cannot supply embedded\ndata buffers, so it must always allocate a reasonable minimum number\nof these buffers (possibly more than the number of raw stream buffers)\nto prevent frame drops.\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: Naushir Patuck <naush@raspberrypi.com>\n---\n .../pipeline/raspberrypi/raspberrypi.cpp      | 25 ++++++++++++-------\n 1 file changed, 16 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex e31fa3b2..045725dd 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -1248,18 +1248,25 @@ int PipelineHandlerRPi::prepareBuffers(Camera *camera)\n \t/* Decide how many internal buffers to allocate. */\n \tfor (auto const stream : data->streams_) {\n \t\tunsigned int numBuffers;\n-\n-\t\tif (stream == &data->unicam_[Unicam::Image] ||\n-\t\t    stream == &data->unicam_[Unicam::Embedded]) {\n+\t\t/*\n+\t\t * For Unicam, allocate a minimum of 4 buffers as we want\n+\t\t * to avoid any frame drops.\n+\t\t */\n+\t\tconstexpr unsigned int minBuffers = 4;\n+\t\tif (stream == &data->unicam_[Unicam::Image]) {\n \t\t\t/*\n-\t\t\t * For Unicam, allocate a minimum of 4 buffers as we want\n-\t\t\t * to avoid any frame drops. If an application has configured\n-\t\t\t * a RAW stream, allocate additional buffers to make up the\n-\t\t\t * minimum, but ensure we have at least 2 sets of internal\n-\t\t\t * buffers to use to minimise frame drops.\n+\t\t\t * If an application has configured a RAW stream, allocate\n+\t\t\t * additional buffers to make up the minimum, but ensure\n+\t\t\t * we have at least 2 sets of internal buffers to use to\n+\t\t\t * minimise frame drops.\n \t\t\t */\n-\t\t\tconstexpr unsigned int minBuffers = 4;\n \t\t\tnumBuffers = std::max<int>(2, minBuffers - numRawBuffers);\n+\t\t} else if (stream == &data->unicam_[Unicam::Embedded]) {\n+\t\t\t/*\n+\t\t\t * Embedded data buffers are (currently) for internal use,\n+\t\t\t * so allocate the minimum required to avoid frame drops.\n+\t\t\t */\n+\t\t\tnumBuffers = minBuffers;\n \t\t} else {\n \t\t\t/*\n \t\t\t * Since the ISP runs synchronous with the IPA and requests,\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "1/2"
    ]
}