Show a patch.

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

{
    "id": 18208,
    "url": "https://patchwork.libcamera.org/api/patches/18208/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/18208/",
    "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": "<20230127154322.29019-9-naush@raspberrypi.com>",
    "date": "2023-01-27T15:43:15",
    "name": "[libcamera-devel,v6,08/15] pipeline: raspberrypi: Handle MandatoryStream hints for ISP Output0",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "6997a6ac21e39a5533855b1af96f25f63d29a819",
    "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/18208/mbox/",
    "series": [
        {
            "id": 3728,
            "url": "https://patchwork.libcamera.org/api/series/3728/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3728",
            "date": "2023-01-27T15:43:07",
            "name": "[libcamera-devel,v6,01/15] libcamera: stream: Add stream hints to StreamConfiguration",
            "version": 6,
            "mbox": "https://patchwork.libcamera.org/series/3728/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/18208/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/18208/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 9A602BDC71\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 27 Jan 2023 15:43:47 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 645B2625FF;\n\tFri, 27 Jan 2023 16:43:47 +0100 (CET)",
            "from mail-wm1-x32b.google.com (mail-wm1-x32b.google.com\n\t[IPv6:2a00:1450:4864:20::32b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id AE795625E4\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Jan 2023 16:43:40 +0100 (CET)",
            "by mail-wm1-x32b.google.com with SMTP id\n\tiv8-20020a05600c548800b003db04a0a46bso5849988wmb.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 27 Jan 2023 07:43:40 -0800 (PST)",
            "from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\th18-20020a05600c30d200b003c21ba7d7d6sm4549566wmn.44.2023.01.27.07.43.39\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 27 Jan 2023 07:43:39 -0800 (PST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1674834227;\n\tbh=xK2wcpQnZCDzyHE/dpHSFOEbJ7h/9g8/6FWAzLqHuw8=;\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=rHNM/Eb0BHpFxU5ORTw1wUfZFQdkTSepKKAI6YQTxvVGAZ4g4VgSs/aqQWasxFien\n\t6MqCp5bV+/egYuebnM9FAF5ZEgE3oi359CGU7mnXYapBe6kuS2ET4mOJSCbx6NEmUl\n\tSTlTZnrQJVFrGNa3RrYS9revwpZhlR/OVg/sIySEprcKEjkVepXPCMC6EmYqgcrIfB\n\t8OHVKPu+E9zzTZBkvmLoV25PHor2fpGqP1TvbOtmEc5SWinPdck1MFFcXxLtLmXBGa\n\tW+qDV749zzS457E/ZrH816A9QWx9FDTn45ZYrhZwtP4WpzegAiVeCWa7INLpW6OTQG\n\thSsUFwbnbdXUg==",
            "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=afcKaE04BexTLMjLTfmnTqFdQC6rwFUactfLih+k2m0=;\n\tb=j3pipNP9e8NgOlCfqM1GmAJoGNaqryXd+zfLdAWQIz1iPV+9V5/6EvZZ1XvkNzaWRV\n\tFm6fQEXdCOogNJatj8N5CBpr3ej9/o2pqtOfOVg/9+PGVJ/dnsiJ4J6CPyT0cEkC2SN0\n\tebnOJFRnccD6lUfYpRH9ARR8rxc7NtIek8v5eX2xSyT+7UYjMWfwd8z/lTmRqfLiEZ5k\n\tH8m8SMnCdRCq0T//z5Dx4F2EUzW/4vkE+ybc4fPR4ssl/EnjYfgNNV9x49gADeBk6yKf\n\t+H3n+XKPsrJl08lVCy5yEE5yhqhCECadqyToc8E7rpWBXcawHY1BN8V6gIoOC9qT+Fxx\n\tys/w=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"j3pipNP9\"; 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=afcKaE04BexTLMjLTfmnTqFdQC6rwFUactfLih+k2m0=;\n\tb=OIUaGpR1trMI1Sq5TQHIgi8KPh1q4YgBoIN6xkljtp2dbJC596WcVPW9+TUeV3KJxi\n\tutcLE4rE2QxSL/MxCb/02rADEx+Zfs10uyTQHdFDsbCM+R4EH8tQHlhuEgpuGIc5sgil\n\tOLp13Wllc8BpIfd/BmIkxZuND802F3Z2C6kDG+7WAbasYGJmq91xFuL4p5TALc5pFMtO\n\tCugnN2lGWUCDIXDV5aBWEofYuCy4isE1PpYabcZD2LzmbHNSiEBhft9pAirF3agT/9K4\n\t2ry8p15jY3um+wvDptLv50XquLsdJoZwDxZobeqDFb5osijt6/fyj+VFQ/dzRbV+sV+w\n\tGprw==",
        "X-Gm-Message-State": "AFqh2krEP0r3k99yP52v/Ok/v6+7pXvozZxxgJ+m35qmC/AhvRJzMSBZ\n\t7t6ub0kpEI0SUKkcshY2y3Qo4zx/XgQ7TdyJclY=",
        "X-Google-Smtp-Source": "AMrXdXuq6Rirle1AEUwL9n6Ez1fQEwcOewprFfESaYF/AhFf0c5+dKL7UWY1lZkGYjm62SsB2uJxDQ==",
        "X-Received": "by 2002:a1c:cc11:0:b0:3da:1d52:26b5 with SMTP id\n\th17-20020a1ccc11000000b003da1d5226b5mr47332010wmb.14.1674834220207; \n\tFri, 27 Jan 2023 07:43:40 -0800 (PST)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri, 27 Jan 2023 15:43:15 +0000",
        "Message-Id": "<20230127154322.29019-9-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20230127154322.29019-1-naush@raspberrypi.com>",
        "References": "<20230127154322.29019-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v6 08/15] pipeline: raspberrypi: Handle\n\tMandatoryStream 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 MandatoryStream flag in the hints field of the ISP Output0\nStreamConfiguration structure. If this flag is set, it guarantees that\nthe application will provide buffers for the ISP, do not allocate any\ninternal buffers for the device.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.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 83e82bd2880d..7c6db070dfc0 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -1457,7 +1457,7 @@ int PipelineHandlerRPi::prepareBuffers(Camera *camera)\n \tRPiCameraData *data = cameraData(camera);\n \tunsigned int minUnicamBuffers = data->config_.minUnicamBuffers;\n \tunsigned int minTotalUnicamBuffers = data->config_.minTotalUnicamBuffers;\n-\tunsigned int numRawBuffers = 0;\n+\tunsigned int numRawBuffers = 0, minIspBuffers = 1;\n \tint ret;\n \n \tfor (Stream *s : camera->streams()) {\n@@ -1481,8 +1481,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 (!data->dropFrameCount_ &&\n+\t\t\t    s->configuration().hints & StreamConfiguration::Hint::MandatoryStream)\n+\t\t\t\tminIspBuffers = 0;\n \t\t}\n \t}\n \n@@ -1518,12 +1531,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",
        "v6",
        "08/15"
    ]
}