Show a patch.

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

{
    "id": 18133,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/18133/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/18133/",
    "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": "<20230118085953.7027-9-naush@raspberrypi.com>",
    "date": "2023-01-18T08:59:49",
    "name": "[libcamera-devel,v5,08/12] pipeline: raspberrypi: Handle OptionalStream hints for ISP Output0",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "e404dc471cc347df1e479911d2c5c80399b57db1",
    "submitter": {
        "id": 34,
        "url": "https://patchwork.libcamera.org/api/1.1/people/34/?format=api",
        "name": "Naushir Patuck",
        "email": "naush@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/18133/mbox/",
    "series": [
        {
            "id": 3713,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3713/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3713",
            "date": "2023-01-18T08:59:41",
            "name": "Raspberry Pi: Platform configuration and buffer allocation improvements",
            "version": 5,
            "mbox": "https://patchwork.libcamera.org/series/3713/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/18133/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/18133/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 52ACFC3240\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 18 Jan 2023 09:01:26 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 17AB2625F6;\n\tWed, 18 Jan 2023 10:01:26 +0100 (CET)",
            "from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com\n\t[IPv6:2a00:1450:4864:20::42c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id E13B4625EB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 Jan 2023 10:01:20 +0100 (CET)",
            "by mail-wr1-x42c.google.com with SMTP id d2so13062029wrp.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 18 Jan 2023 01:01:20 -0800 (PST)",
            "from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\ti6-20020adfe486000000b002423dc3b1a9sm30312464wrm.52.2023.01.18.01.01.20\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 18 Jan 2023 01:01:20 -0800 (PST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1674032486;\n\tbh=vuQseQL50Web6ilc98fPnTOnE7PpKyM5XiUabaPa4xo=;\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=ooUHbqq0xII44hCEuEO56EXWLi4Qf33jxeDU4yMivB50tIqZUVVVTSy4SnTEbMemo\n\tI5gKl+/2Z21y4GGoZaQAIr1xXOD+VvYgHStlRTekTko3s5FjDCdW7pdyhRc2XuyCGB\n\tPHO8Y/BdXP3uje60iFuR5k/ehYi/XhxQgjLmdAVGENOO81m636HGef6VZkXceA86lx\n\tJQ7JBTPrM992OHEx/L+26mjj9NJhbRvDBNsFNtYTICu1lnbeiB3kbgWgKmrsoPXcsq\n\tS6DFivBk1P/yZuKq/cxNyRjd1aBrPq1Zyg06FaZuP/1U8CvXmRKh1+JlrUArv6Ojs9\n\t8EtMJpjPkWrtQ==",
            "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=lnM2OXv07hslcltNdshxDVv/HvxqNMcVEFP3wRy+Ugo=;\n\tb=Qltgl0TZBMLdGafULXUJj2Hwwf+1YA9LWbkY4G4kIwnQT1TYu8JqQIMi+J80VnUWdP\n\t5K/q0fs0Ae6pvw83FoNFbABm8pMhj4CdJopzHAZ8dVJp4zHnSpjFzbJjzmN8IeYM1ZUb\n\tTsKkcGPb9tZ8ZxRUUX/VCovGx1zgzmeL+ycGoAPsFW4OU6eJCFZK97g1QyAIw8WyhaaA\n\teKkO7V5vm5wCIBfzrPrPTYs2bzqFP8oLt9lKN17TJacDVmSs1gdPUpksgpDREumVyVpa\n\tI52BOVWUXjq6lhhHvlQQG8MJ9cLq4+yIvUHM/GL2Bs8WMYZADuWKJsVEcosy3MKDnKDb\n\tHS0Q=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"Qltgl0TZ\"; 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=lnM2OXv07hslcltNdshxDVv/HvxqNMcVEFP3wRy+Ugo=;\n\tb=Adw34kM/1LPPxIo0KaxF6EVTHst6wF5jfcDErozzM0GHB+Ec6p0GbChlzSFexGCxOg\n\tq/Y+BdNXx9Sz8C9Yp9eewP1ADU5/3getwzCvGGCgox5SjhgkQYWki0FeEI37Hwu9RPnm\n\t8lZHYUSnRIgtvPHzxegxLHcs2lOIMTYE+5Mq2b6WuBz7OcfnPYacEv5YB+xGaqDmPr59\n\t6grWlbmClRwBvUUQPP/0LSnoRlzOv6QXoC6eBrvKGETEBuf5ZlSkz6n4g+zGhe09HlYZ\n\t5/Xg1lo9XN62wD7UhuD3n2j0zdr/5463RnHEdob5hh3TXvpKT54k37Ipu6W7fn7zvC7A\n\t01+A==",
        "X-Gm-Message-State": "AFqh2kpryh0B5k5zLECPoRjjhvaFmktUtF5XSIedwNxuxVStDe5Y9UOI\n\tDTmN88ctnyVxLObaD+AWmbzacDYXih+IyM91R6Q=",
        "X-Google-Smtp-Source": "AMrXdXt9suwAefXVlT10YNjWMX7lLwygBytFKPsrv5eJbh/NRdHDt8frAZc1xBsDWMG3STqZ2e1axw==",
        "X-Received": "by 2002:adf:ffc3:0:b0:2bb:ede4:5dd4 with SMTP id\n\tx3-20020adfffc3000000b002bbede45dd4mr15286388wrs.34.1674032480448; \n\tWed, 18 Jan 2023 01:01:20 -0800 (PST)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 18 Jan 2023 08:59:49 +0000",
        "Message-Id": "<20230118085953.7027-9-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20230118085953.7027-1-naush@raspberrypi.com>",
        "References": "<20230118085953.7027-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v5 08/12] pipeline: raspberrypi: Handle\n\tOptionalStream 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 OptionalStream flag in the hints field of the ISP Output0\nStreamConfiguration structure. If this flag is not 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 2b396f1db9b6..13d0ab4c4968 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -1453,7 +1453,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@@ -1477,8 +1477,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 & StreamConfiguration::Hint::OptionalStream) &&\n+\t\t\t    !data->dropFrameCount_)\n+\t\t\t\tminIspBuffers = 0;\n \t\t}\n \t}\n \n@@ -1514,12 +1527,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",
        "v5",
        "08/12"
    ]
}