Show a patch.

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

{
    "id": 17952,
    "url": "https://patchwork.libcamera.org/api/patches/17952/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/17952/",
    "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": "<20221206135459.25521-10-naush@raspberrypi.com>",
    "date": "2022-12-06T13:54:55",
    "name": "[libcamera-devel,v3,09/13] pipeline: raspberrypi: Handle MandatoryRequestBuffer hints for ISP Output0",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "276c2964d33da74523a97816aa7108ec065ee6a9",
    "submitter": {
        "id": 34,
        "url": "https://patchwork.libcamera.org/api/people/34/?format=api",
        "name": "Naushir Patuck",
        "email": "naush@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/17952/mbox/",
    "series": [
        {
            "id": 3659,
            "url": "https://patchwork.libcamera.org/api/series/3659/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3659",
            "date": "2022-12-06T13:54:46",
            "name": "Raspberry Pi: Platform configuration and buffer allocation improvements",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/3659/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/17952/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/17952/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 12FC9BE08B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue,  6 Dec 2022 13:55:18 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id A7CD063356;\n\tTue,  6 Dec 2022 14:55:17 +0100 (CET)",
            "from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com\n\t[IPv6:2a00:1450:4864:20::42f])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id BDAD86334A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue,  6 Dec 2022 14:55:12 +0100 (CET)",
            "by mail-wr1-x42f.google.com with SMTP id y16so23574303wrm.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 06 Dec 2022 05:55:12 -0800 (PST)",
            "from naush-laptop.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tq6-20020a05600c2e4600b003c6bd91caa5sm19444059wmf.17.2022.12.06.05.55.11\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 06 Dec 2022 05:55:11 -0800 (PST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1670334917;\n\tbh=SLhgGrpHJFQMhrTxEFNQhmxANozPE8v+5FMHPLX9wts=;\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=ASb+rqYFFEU4FmsFo4s4FlVRTJKTNSzaZnzyApFDZp7MMd0M6PvCb+Wa8wrhCRqX5\n\tI18RN082gmoA1lHUFfrTGU6PLf/2DKifTS+sWqsGPDM8Pg7Sk3Iugk5iGUzEPyVEzB\n\tewlwVdneL2D0k/c9rU1v3450NygOt9eJgyzpjm/vsXPab1QkPKXr8bePyGGCdVp5tB\n\tzUc5l0EZ9CvT4QJvoLUYRL7EGIT3s7qPQDedG3x/acxsR/iJpad82jP2MsKvR0rhpV\n\t+HXEafTNs+UbKFcIQglr376g0saU9tu43TXi9tgvTfg3AIzcK/rqSWyOppcwyvAJiS\n\tg2e8ed+OYJ0vw==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:from:to:cc:subject:date\n\t:message-id:reply-to;\n\tbh=Ccy7ljO79JZF7M7m8/PMAoKlgfWygspiQx69DEnlU1k=;\n\tb=bl/gTEI79dt0mrJ2vKtEJbzF0mdMJW6amKQMd2Nrjn2eazx9xMFdOEMItiXIs8MO21\n\tT/5Ra05QDRct8pXVn2K1aNCDn9AjORaHnEjMMsYvdZEQoI0yf+VNwIie2Z5bd/Nh3UUH\n\t1/tSNAKI/1+SM0rjg9UXTGtFhBwGNLmllJ//2rbembKZt1Nxz28qIqfI0h+KuR1Dj/zG\n\toTB1zpf8zXhQ+2crhqX0CJB1We4VP0zROcK1IKhf+3f7GZHiDhBx2DshlyA5A/mhbHyM\n\teCWK4iqPClJMSaaVdVjbR50H+944OfRPJmaN39iw3NNVtWlQFDaCn6gqshEhbd/dELQx\n\tOCng=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"bl/gTEI7\"; dkim-atps=neutral",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\n\th=content-transfer-encoding:mime-version:references:in-reply-to\n\t:message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n\t:subject:date:message-id:reply-to;\n\tbh=Ccy7ljO79JZF7M7m8/PMAoKlgfWygspiQx69DEnlU1k=;\n\tb=stfWAlzjkVpxMHFQI9rrKLIjkFrLxZzU8yO6VrOjBIriioz8NmkIQ/zX/lPf740xGZ\n\tOHHfSEekXHPyBOcpaHODirKdCyyQ4q72wQh4r+O4JtduxKm7Sv+yq6j2y5wMKvdeRFp2\n\t753a0Q0m+pRI0DHg7FeUqF9PcTpXPZ8TVn0jD2l+0GoQS7NyCkYrzDDx4n97ucrQZU5E\n\toWqeR8FecUsgEpKoPguRDS7ccskBn9x6rdbsJr3bNiGXQEsuNiiPwEvFLrkeUq7jPTbK\n\tgV4CH46no1/wZVpgHwcor2nN6AGO9kbrudBXjFlVbAkeQz1BtgRd25WQE7rXc/0LKoLF\n\tkzFA==",
        "X-Gm-Message-State": "ANoB5pnrLM10fWmPsiSu12azCydhEObN/qcAR9VcB8pcUV0vwBndQNRC\n\t3IN7veNJTHevXcYx7bYRqX0RC6wLjciU88GM",
        "X-Google-Smtp-Source": "AA0mqf5pLE9HtTKcbCLKW/tSkOszWRG5HZR+FNJo1toM6LaCif6gA1Xdbq1bLPe3w9dqdhkm5UEC5A==",
        "X-Received": "by 2002:a5d:5545:0:b0:242:3207:c516 with SMTP id\n\tg5-20020a5d5545000000b002423207c516mr14668167wrw.243.1670334912025; \n\tTue, 06 Dec 2022 05:55:12 -0800 (PST)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue,  6 Dec 2022 13:54:55 +0000",
        "Message-Id": "<20221206135459.25521-10-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20221206135459.25521-1-naush@raspberrypi.com>",
        "References": "<20221206135459.25521-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v3 09/13] pipeline: raspberrypi: Handle\n\tMandatoryRequestBuffer hints for ISP Output0",
        "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": "Naushir Patuck via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Naushir Patuck <naush@raspberrypi.com>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Look for MandatoryRequestBuffer flag in the hints field of the ISP Output0\nStreamConfiguration structure. If this flag is set, it guarantees that the\napplication will provide buffers for the ISP, do not allocate any internal\nbuffers for the device.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\n---\n .../pipeline/raspberrypi/raspberrypi.cpp      | 29 ++++++++++++++-----\n 1 file changed, 22 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 302279ac5e01..371610be649a 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -1470,7 +1470,7 @@ int PipelineHandlerRPi::prepareBuffers(Camera *camera)\n \tRPiCameraData *data = cameraData(camera);\n \tunsigned int minUnicamBuffers = data->config_.minUnicamBuffers,\n \t\t     minTotalUnicamBuffers = data->config_.minTotalUnicamBuffers,\n-\t\t     numRawBuffers = 0;\n+\t\t     numRawBuffers = 0, minIspBuffers = 1;\n \tint ret;\n \n \tfor (Stream *s : camera->streams()) {\n@@ -1494,8 +1494,21 @@ int PipelineHandlerRPi::prepareBuffers(Camera *camera)\n \t\t\t\t\tminTotalUnicamBuffers = 0;\n \t\t\t\t}\n \t\t\t}\n-\n-\t\t\tbreak;\n+\t\t} else if (s == &data->isp_[Isp::Output0]) {\n+\t\t\t/*\n+\t\t\t * Since the ISP runs synchronous with the IPA and requests,\n+\t\t\t * we only ever need a maximum of one internal buffer. Any\n+\t\t\t * buffers the application wants to hold onto will already\n+\t\t\t * be exported through PipelineHandlerRPi::exportFrameBuffers().\n+\t\t\t *\n+\t\t\t * However, as above, if the application provides a guarantee\n+\t\t\t * that the buffer will always be provided for the ISP Output0\n+\t\t\t * stream in a Request, we don't need any internal buffers\n+\t\t\t * allocated.\n+\t\t\t */\n+\t\t\tif (s->configuration().hints &\n+\t\t\t    StreamConfiguration::Hint::MandatoryRequestBuffer)\n+\t\t\t\tminIspBuffers = 0;\n \t\t}\n \t}\n \n@@ -1531,12 +1544,14 @@ int PipelineHandlerRPi::prepareBuffers(Camera *camera)\n \t\t\t * so allocate the minimum required to avoid frame drops.\n \t\t\t */\n \t\t\tnumBuffers = data->config_.minTotalUnicamBuffers;\n+\t\t} else if (stream == &data->isp_[Isp::Output0]) {\n+\t\t\t/* Buffer count for this is handled in the earlier loop above. */\n+\t\t\tnumBuffers = minIspBuffers;\n \t\t} else {\n \t\t\t/*\n-\t\t\t * Since the ISP runs synchronous with the IPA and requests,\n-\t\t\t * we only ever need one set of internal buffers. Any buffers\n-\t\t\t * the application wants to hold onto will already be exported\n-\t\t\t * through PipelineHandlerRPi::exportFrameBuffers().\n+\t\t\t * Same reasoning as for ISP Output 0, we only ever need\n+\t\t\t * a maximum of one internal buffer for Output1 (required\n+\t\t\t * for colour denoise) and ISP statistics.\n \t\t\t */\n \t\t\tnumBuffers = 1;\n \t\t}\n",
    "prefixes": [
        "libcamera-devel",
        "v3",
        "09/13"
    ]
}