Show a patch.

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

{
    "id": 19109,
    "url": "https://patchwork.libcamera.org/api/patches/19109/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/19109/",
    "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": "<20231006132000.23504-8-naush@raspberrypi.com>",
    "date": "2023-10-06T13:19:47",
    "name": "[libcamera-devel,07/20] ipa: rpi: Add statsInline to the Controller hardware description",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "5225f67dcc94c1e09370be40ed117aeb8dedc863",
    "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/19109/mbox/",
    "series": [
        {
            "id": 4047,
            "url": "https://patchwork.libcamera.org/api/series/4047/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4047",
            "date": "2023-10-06T13:19:40",
            "name": "Raspberry Pi: Preliminary PiSP support",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/4047/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/19109/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/19109/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 9C5DCC32BA\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  6 Oct 2023 13:20:06 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4B3F36297E;\n\tFri,  6 Oct 2023 15:20:06 +0200 (CEST)",
            "from mail-wr1-x436.google.com (mail-wr1-x436.google.com\n\t[IPv6:2a00:1450:4864:20::436])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9144262975\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  6 Oct 2023 15:20:04 +0200 (CEST)",
            "by mail-wr1-x436.google.com with SMTP id\n\tffacd0b85a97d-3231d6504e1so1917682f8f.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 06 Oct 2023 06:20:04 -0700 (PDT)",
            "from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tm8-20020a056000180800b00321773bb933sm1639478wrh.77.2023.10.06.06.20.02\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 06 Oct 2023 06:20:03 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1696598406;\n\tbh=LHz8u37OwGI/wuTVdZF3yv9dmJRF0tMBAMBIG9SMWzI=;\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=xiBnsElYYxlNdIUKx+1oOZBONZxXLCooAhrzxUlyluDIjv2cDN+xe8U9b7DM9ai1A\n\tGT4EqML5J7XceWzYRxLbmumWdqqX1g5zk2oiJZmLtWBgmxLpbHNX51OiKzpN8MdSQU\n\td4e7hHEkC1LqCnseRqq87iQMpUOFbC/V1/tyR+vU56a4Am25awdYH3bNzpbeaOM6rg\n\tD8Hg+/ilZLlADF7wOx2kZTa5t2YrATi1EalRwvt+PMp2oeij8tKCRnX4x4TF0G/0Tm\n\tkzGzY42W7tbovkZ07QPJnzOM/NOaonmF3gctE9IJD9yM+lSrOdB39GxTxHrYnkdtJZ\n\tVAkIWCqgRm1Aw==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1696598404; x=1697203204;\n\tdarn=lists.libcamera.org; \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=Gfnf3eFrGWi5BuX3QgWJhR2IgqMg0A06aPgA4jJrFJ4=;\n\tb=ON1SKNZsihWpluDpxJOMTRMhpPCfSGgDWS9Kd5OLqEB/OM+RXY/KyysvV/KD+j8jX1\n\tjhktZLEnrwpnHts9jK3JIh4aIoFpbc2yQM+KuB6Vfu26lmZhU6sJLT99wTiolFKo8jLr\n\tGvgX04HSn7peiiinzRCtX0gRJlWF1fJS84qV20ddQt43whhnbvbQw0859wNeKadaSOEG\n\tULatF4q1TVcj8Si41TvpnoG6sxorz3SF0anE72H8BhwhcXE6ZJUUa55JYbjTXuhZY4zd\n\tzrul0Z7v9m3jFHvdg7pdP9F6ubsC0KVILVRG50X8DyFpmBzPe3AJsQtAdQ/defoAEhfo\n\tR7uQ=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"ON1SKNZs\"; dkim-atps=neutral",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1696598404; x=1697203204;\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=Gfnf3eFrGWi5BuX3QgWJhR2IgqMg0A06aPgA4jJrFJ4=;\n\tb=uTVQ99/sO4QUW5bpNjhSvy1MoxKdyzow0RN+ZJSxW3ywQRjujxj0k/iYBXQkaVcaIj\n\tak0LmGGQZYmT5zQB4qSEksN1Wa3+IBviYaGUOiH+s2U9kza9VI+k3YxcgUMqljVjzAnw\n\toW0cI4K3olFrMl0l55PWRmavJB5YymlcFdxZs54TJAUw+9JhD9wJoM2m0moAoP9Nx/LB\n\t6go+gzSLHqhG+9it4v+vRMAAlb/cDag8zwbG2acPK+uIwyh84GQTl+3EwsxnyjimT9l4\n\tQzWnxlT2xUHslH2irOl/MaO6Dq3MRJ+IXCS4EFxVBl915z5Yx6YnsK4kWqlVx43s5Sec\n\t5CYQ==",
        "X-Gm-Message-State": "AOJu0YwhBrCE+YetEz9wXNUWUEDELfWQQUW7gWoahzOeDsv4z/MIOCRr\n\tscoB69khLzgzmnRL2UPu2Wf7nVDvCHysQR/GpiOGrg==",
        "X-Google-Smtp-Source": "AGHT+IE41HKWRTBpaXXgTmzkoElLh+4FGquUI/13kX1PvR2p+6+3PDvZmOaiw8Z2vPZxQd8oUR4h6g==",
        "X-Received": "by 2002:a5d:5448:0:b0:320:7fa:c71e with SMTP id\n\tw8-20020a5d5448000000b0032007fac71emr7815787wrv.15.1696598403916; \n\tFri, 06 Oct 2023 06:20:03 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri,  6 Oct 2023 14:19:47 +0100",
        "Message-Id": "<20231006132000.23504-8-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20231006132000.23504-1-naush@raspberrypi.com>",
        "References": "<20231006132000.23504-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH 07/20] ipa: rpi: Add statsInline to the\n\tController hardware description",
        "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": "Add a new boolean field (statsInline) to Controller::HardwareConfigMap.\nThis field indicates where the statistics are generated in the hardware\nISP pipeline. For statsInline == true, statistics are generated before\nthe frame is processed (e.g. the PiSP case), and statsInline == false\nindicates statistics are generated after the frame is processed (e.g.\nthe VC4 case).\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n---\n src/ipa/rpi/common/ipa_base.cpp       | 19 ++++++++++++++-----\n src/ipa/rpi/controller/controller.cpp |  3 ++-\n src/ipa/rpi/controller/controller.h   |  1 +\n 3 files changed, 17 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp\nindex 97f647a9e53e..f28eb36b7a44 100644\n--- a/src/ipa/rpi/common/ipa_base.cpp\n+++ b/src/ipa/rpi/common/ipa_base.cpp\n@@ -429,11 +429,10 @@ void IpaBase::prepareIsp(const PrepareParams &params)\n \t}\n \n \t/*\n-\t * If a statistics buffer has been passed in, call processStats\n-\t * directly now before prepare() since the statistics are available in-line\n-\t * with the Bayer frame.\n+\t * If the statistics are inline (i.e. already available with the Bayer\n+\t * frame), call processStats() now before prepare().\n \t */\n-\tif (params.buffers.stats)\n+\tif (controller_.getHardwareConfig().statsInline)\n \t\tprocessStats({ params.buffers, params.ipaContext });\n \n \t/* Do we need/want to call prepare? */\n@@ -445,6 +444,10 @@ void IpaBase::prepareIsp(const PrepareParams &params)\n \n \tframeCount_++;\n \n+\t/* If the statistics are inline the metadata can be returned early. */\n+\tif (controller_.getHardwareConfig().statsInline)\n+\t\treportMetadata(ipaContext);\n+\n \t/* Ready to push the input buffer into the ISP. */\n \tprepareIspComplete.emit(params.buffers, false);\n }\n@@ -479,7 +482,13 @@ void IpaBase::processStats(const ProcessParams &params)\n \t\t}\n \t}\n \n-\treportMetadata(ipaContext);\n+\t/*\n+\t * If the statistics are not inline the metadata must be returned now,\n+\t * before the processStatsComplete signal.\n+\t */\n+\tif (!controller_.getHardwareConfig().statsInline)\n+\t\treportMetadata(ipaContext);\n+\n \tprocessStatsComplete.emit(params.buffers);\n }\n \ndiff --git a/src/ipa/rpi/controller/controller.cpp b/src/ipa/rpi/controller/controller.cpp\nindex 14d245da2ce7..4b6f82b41916 100644\n--- a/src/ipa/rpi/controller/controller.cpp\n+++ b/src/ipa/rpi/controller/controller.cpp\n@@ -34,7 +34,8 @@ static const std::map<std::string, Controller::HardwareConfig> HardwareConfigMap\n \t\t\t.focusRegions = { 4, 3 },\n \t\t\t.numHistogramBins = 128,\n \t\t\t.numGammaPoints = 33,\n-\t\t\t.pipelineWidth = 13\n+\t\t\t.pipelineWidth = 13,\n+\t\t\t.statsInline = false,\n \t\t}\n \t},\n };\ndiff --git a/src/ipa/rpi/controller/controller.h b/src/ipa/rpi/controller/controller.h\nindex c6af5cd6c7d4..a8bc61880ab4 100644\n--- a/src/ipa/rpi/controller/controller.h\n+++ b/src/ipa/rpi/controller/controller.h\n@@ -45,6 +45,7 @@ public:\n \t\tunsigned int numHistogramBins;\n \t\tunsigned int numGammaPoints;\n \t\tunsigned int pipelineWidth;\n+\t\tbool statsInline;\n \t};\n \n \tController();\n",
    "prefixes": [
        "libcamera-devel",
        "07/20"
    ]
}