Show a patch.

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

{
    "id": 19111,
    "url": "https://patchwork.libcamera.org/api/patches/19111/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/19111/",
    "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-10-naush@raspberrypi.com>",
    "date": "2023-10-06T13:19:49",
    "name": "[libcamera-devel,09/20] ipa: rpi: Prepare ALSC for PiSP support",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "4a6251f65b057c95eb3401970cc31b62c173a28a",
    "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/19111/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/19111/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/19111/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 0A4D5C32BB\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri,  6 Oct 2023 13:20:10 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B126862973;\n\tFri,  6 Oct 2023 15:20:09 +0200 (CEST)",
            "from mail-wm1-x335.google.com (mail-wm1-x335.google.com\n\t[IPv6:2a00:1450:4864:20::335])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id D0E0A62976\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri,  6 Oct 2023 15:20:07 +0200 (CEST)",
            "by mail-wm1-x335.google.com with SMTP id\n\t5b1f17b1804b1-40651a726acso19065715e9.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 06 Oct 2023 06:20:07 -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.06\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 06 Oct 2023 06:20:06 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1696598409;\n\tbh=DjzjUWLUnAHZALJOWBNhMzRGZXmd4bbCcswnCZ87r5o=;\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=WIcT6rDyb6ikhvw8nnjVVCG5LLfiTBd2P0+yJiMncc3uH4uVMpeMB2RmkRQ2nNwCV\n\tB9D4U3RSlauQDfIgYV/wWtn/3W7m22M51QoMABDd/2GS3jwYgglnq/PfhJjcL6BJTF\n\tqDzr4khE2pcMHJqv/pDm5QCJg/BDNazL8DrYQpyg7tGrrfgosJJ6oWb03NmtHoF2Yd\n\tV1hWIMoa5/XWSxV9/6t90vSWhCgwT0hcpgnWst2ZPPVK1fbHBpdZxcDawpAMEjqntd\n\tdZjgFrZq3gpBxHP3Wn/gvFPt0Hv6mLXT3L9QMNh3nAwot+SOAD3AKF7rrG8UwP4VaF\n\tPCiWdzrTqD28Q==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google; t=1696598407; x=1697203207;\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=kL4411ue6KUoItjo2jH8OvVljS7ZlVEJVZMzhhlz4F8=;\n\tb=bj35JJUW+s70a078WUeUBaGkx/wnQ8K+sOGl/94WvISsAqg8lBXoX5TyyU2u4lVERz\n\tIvu0uh6sfBz+pZPDhNp2LawNNG/hdvUm6iI3FvjXbSmcLYgn4vOmiEPJcP3OaEGvvYXn\n\tu+htU69/sMYVXo1urw2J6glKFenC34f82CzaJH73Q+7QASoiQNnQMFzzvYddmUM4fBVd\n\tngF/fmz+SivuGEQYVUzR+Ygj3ee2hy5eYbc53AscKBmHUHbwYvYqey+ZyFUnfUu8PEqG\n\tjSV/1OXFQOwOMaclLlH1tvkNii1rCgE7cPjx080mclC73vM6A3TzcfVR+F2hAZ90++gz\n\tGqsQ=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"bj35JJUW\"; dkim-atps=neutral",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20230601; t=1696598407; x=1697203207;\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=kL4411ue6KUoItjo2jH8OvVljS7ZlVEJVZMzhhlz4F8=;\n\tb=D8Q0Pxx6+v/z4Y5F9W6fu2zuadSK9rI2wdn04y+PG1TZi8LWF9oB8RWjSo3w2BSJyj\n\tAdcn6PAyYBjoFdNgBsSiTZii0ORYof0+UrdIEDYmUqtV9XiZZHiALxbLzRQVoVCmoZaV\n\tXSz67JBWlBu3E0Bw8Bbm5w1/JxtwdC0zON90eHkGKcwvhssO4rYi2EVabTWulgUTNWlX\n\tltgdgKOpl7lv62Syc/GMURqGPYiQPM0ytOCmG/5fdsgiE9uvwaGCz2nyX4md4Q7CsMNz\n\tWKn352v6TH0kmJq1kQDbisEoyPXu6Ym/Xuh5TU0BTIXAKHLYNvNmeuLOCw1PaU0Hv8Vt\n\txB9g==",
        "X-Gm-Message-State": "AOJu0YykWBH+caHMjQ3oNrsWevm8t08A3tjmp1L8GwHHTnovwqsuGXfn\n\tXt2Q523qw1bpI/KkBD5HuH/nYNYmH7OkBK7Rey8GKA==",
        "X-Google-Smtp-Source": "AGHT+IEvs6BmJnde4jXeYaD5TrAUd63ci8Vff3DsQGbswiXPEgDUz7BNmTJvEF247jdVW8TmzUPV6g==",
        "X-Received": "by 2002:adf:a3d6:0:b0:329:6b93:e346 with SMTP id\n\tm22-20020adfa3d6000000b003296b93e346mr1078709wrb.11.1696598407236; \n\tFri, 06 Oct 2023 06:20:07 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri,  6 Oct 2023 14:19:49 +0100",
        "Message-Id": "<20231006132000.23504-10-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 09/20] ipa: rpi: Prepare ALSC for PiSP\n\tsupport",
        "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": "Prepare the ALSC algorithm to support the PiSP hardware. The key change\nis to avoid factoring out the WB correction in the AWB zone statistics.\n\nAdd the ALSC correction to the global metadata so that AWB can use it to\nfactor the gains back in for the AWB calculations.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n---\n src/ipa/rpi/controller/rpi/alsc.cpp | 16 ++++++++++++----\n 1 file changed, 12 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/src/ipa/rpi/controller/rpi/alsc.cpp b/src/ipa/rpi/controller/rpi/alsc.cpp\nindex 3a2e8fe00ca6..f1ccef87c70c 100644\n--- a/src/ipa/rpi/controller/rpi/alsc.cpp\n+++ b/src/ipa/rpi/controller/rpi/alsc.cpp\n@@ -348,9 +348,11 @@ static void copyStats(RgbyRegions &regions, StatisticsPtr &stats,\n \tconst std::vector<double> &bTable = status.b;\n \tfor (unsigned int i = 0; i < stats->awbRegions.numRegions(); i++) {\n \t\tauto r = stats->awbRegions.get(i);\n-\t\tr.val.rSum = static_cast<uint64_t>(r.val.rSum / rTable[i]);\n-\t\tr.val.gSum = static_cast<uint64_t>(r.val.gSum / gTable[i]);\n-\t\tr.val.bSum = static_cast<uint64_t>(r.val.bSum / bTable[i]);\n+\t\tif (stats->colourStatsPos == Statistics::ColourStatsPos::PostLsc) {\n+\t\t\tr.val.rSum = static_cast<uint64_t>(r.val.rSum / rTable[i]);\n+\t\t\tr.val.gSum = static_cast<uint64_t>(r.val.gSum / gTable[i]);\n+\t\t\tr.val.bSum = static_cast<uint64_t>(r.val.bSum / bTable[i]);\n+\t\t}\n \t\tregions.set(i, r);\n \t}\n }\n@@ -368,7 +370,8 @@ void Alsc::restartAsync(StatisticsPtr &stats, Metadata *imageMetadata)\n \t * the LSC table that the pipeline applied to them.\n \t */\n \tAlscStatus alscStatus;\n-\tif (imageMetadata->get(\"alsc.status\", alscStatus) != 0) {\n+\tif (stats->colourStatsPos == Statistics::ColourStatsPos::PostLsc &&\n+\t    imageMetadata->get(\"alsc.status\", alscStatus) != 0) {\n \t\tLOG(RPiAlsc, Warning)\n \t\t\t<< \"No ALSC status found for applied gains!\";\n \t\talscStatus.r.resize(config_.tableSize.width * config_.tableSize.height, 1.0);\n@@ -414,6 +417,11 @@ void Alsc::prepare(Metadata *imageMetadata)\n \tstatus.g = prevSyncResults_[1].data();\n \tstatus.b = prevSyncResults_[2].data();\n \timageMetadata->set(\"alsc.status\", status);\n+\t/*\n+\t * Put the results in the global metadata as well. This will be used by\n+\t * AWB to factor in the colour shading correction.\n+\t */\n+\tgetGlobalMetadata().set(\"alsc.status\", status);\n }\n \n void Alsc::process(StatisticsPtr &stats, Metadata *imageMetadata)\n",
    "prefixes": [
        "libcamera-devel",
        "09/20"
    ]
}