Show a patch.

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

{
    "id": 17529,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/17529/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/17529/",
    "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": "<20221005113145.9325-1-naush@raspberrypi.com>",
    "date": "2022-10-05T11:31:45",
    "name": "[libcamera-devel] pipeline: raspberrypi: Update naming convention for tuning files",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "e074c7a06b9ce982cdd3ab137178444e57b25174",
    "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/17529/mbox/",
    "series": [
        {
            "id": 3533,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3533/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3533",
            "date": "2022-10-05T11:31:45",
            "name": "[libcamera-devel] pipeline: raspberrypi: Update naming convention for tuning files",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3533/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/17529/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/17529/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 61C36BD16B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed,  5 Oct 2022 11:31:53 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id BAF5A622F3;\n\tWed,  5 Oct 2022 13:31:52 +0200 (CEST)",
            "from mail-wr1-x429.google.com (mail-wr1-x429.google.com\n\t[IPv6:2a00:1450:4864:20::429])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1CFDB601C7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed,  5 Oct 2022 13:31:51 +0200 (CEST)",
            "by mail-wr1-x429.google.com with SMTP id bk15so25503698wrb.13\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 05 Oct 2022 04:31:51 -0700 (PDT)",
            "from naush-laptop.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tck14-20020a5d5e8e000000b0022e3978fd07sm9187429wrb.39.2022.10.05.04.31.49\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 05 Oct 2022 04:31:50 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1664969512;\n\tbh=JbxNExpetysfWikibUElVypom/54EsDtBmEs15i+19c=;\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=ON++2pBtgZqSBngT/N2MfsJ/YPIhP0GCErT9GnWDtjsYG3DrOdkf7ROgZQ1O+MvYg\n\tj/8MwV6F1SK99G2vL1W5XAZyenhleteJCfyfyT99McJOrBX3pOI8sxaOSczRRQZ4nc\n\t+IyHubmvPigWCW4xaZCQhw6Rvd9z7WYOcbNQN7taVCR8tll3mNadTyXabPrhYKW/+t\n\t5ayGu953SrPN8Vb6pCotfv34RomXq5OKe6AMmAbKl8WRECIfNcLGt7uiX78dIKc+jJ\n\tSdPn582O/ZggGp7TuxMuypL++uzIm930PY/KYy5ICGJjACUAVQjJlyJta3Ezqt95DW\n\tdao7MVsfg4g0Q==",
            "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\tbh=Ni216vs3iUMM6P4IkW7PaMnrdX6UHLhWcGTCrT1tzE0=;\n\tb=VQ8BoDQ0u+WQ6bmVL+d9c367yru/ihya5ugvRIxW8ktM6sVbQuFrMKeBvA2ZoDrEd6\n\toU9UA4cE7MfDuEEsMuANhJlhZccsVIcAdqZxiktkJLImG+94Z9jEBqvZA/XG+Y5jg1Ee\n\tZ9BItju1PL34RRFASIcNQSJr3FSfZ6MkxWjwR1GfIbpywL268VsSJ0Kc9cgojt4vct7l\n\t1ZeLDR2tVE9ra1VYYH9rBCb2SRNkirA+Vn2+kZ7j8sYQzfTdKNyoRNqyryDD9QHih6/K\n\ty1kZJ50nD/L7mwSjr/8Mn1O2DrZkGQrLaUtER/5YEVzTtGWJ6dYr0LNXcDR8jsTZH7T9\n\t0UEQ=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"VQ8BoDQ0\"; 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;\n\tbh=Ni216vs3iUMM6P4IkW7PaMnrdX6UHLhWcGTCrT1tzE0=;\n\tb=lbrKMJxwNYnw097et8zKAFLLWB9HV7v+d3IA45SGXLJE3z/f8PWhXYPeGSf/iNpktr\n\tFz4gTgsG5W492rTZ6sAF8jLAPzyRK1pso4CiN4JTt4AP/8mScaQbA3/lXgcehoa0Goif\n\tSysFI7MtcdexSMjVDPG2T5vtbTrHkUZuz+5tRTA18GrIDfLkwOVtv9in+jwGPCzhCVDA\n\tNhlpC9cgg5TU96JIzrc060bmRnJfXzo90OoqtlI4rZlGvIMeTi9wgsdVItwt49LlEzoj\n\tEPzmBW+vd7IFuYP2eMyH8t7szpOYaCUSQO0e5T2AKQyEJxN9ewz/Y5ZhdHqf6YZG95R1\n\trKZA==",
        "X-Gm-Message-State": "ACrzQf1HQrVrFsN/Kp7zlC2cUb8PCMSLSf12qkVt0PLa8isOfCf8Uv72\n\tenaXBlrESRiMGRaMANXS6CTXfxjkvvLCzA==",
        "X-Google-Smtp-Source": "AMsMyM4xeOAsOc+1TPyqNq5fu35uext2zglJdony+fqho20GoH2b/o82xUH785hb1prjeBF0JvJUEw==",
        "X-Received": "by 2002:a5d:4a4d:0:b0:22d:c8cb:8687 with SMTP id\n\tv13-20020a5d4a4d000000b0022dc8cb8687mr14898530wrs.554.1664969510503; \n\tWed, 05 Oct 2022 04:31:50 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed,  5 Oct 2022 12:31:45 +0100",
        "Message-Id": "<20221005113145.9325-1-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20221003095558.1993-3-naush@raspberrypi.com>",
        "References": "<20221003095558.1993-3-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH] pipeline: raspberrypi: Update naming\n\tconvention for tuning files",
        "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": "Append \"_mono\" to the sensor name when generating the tuning filename for\nmonochrome sensor variants. So the new naming convention is as follows:\n\n<sensor_name>.json - Standard colour sensor variant\n<sensor_name>_mono.json - Monochrom sensor variant\n\nRename the existing imx296.json file to imx296_mono.json as this tuning file\nis based on the monochrome variant of the IMX296.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n---\n .../data/{imx296.json => imx296_mono.json}     |  0\n src/ipa/raspberrypi/data/meson.build           |  2 +-\n .../pipeline/raspberrypi/raspberrypi.cpp       | 18 +++++++++++++++---\n 3 files changed, 16 insertions(+), 4 deletions(-)\n rename src/ipa/raspberrypi/data/{imx296.json => imx296_mono.json} (100%)",
    "diff": "diff --git a/src/ipa/raspberrypi/data/imx296.json b/src/ipa/raspberrypi/data/imx296_mono.json\nsimilarity index 100%\nrename from src/ipa/raspberrypi/data/imx296.json\nrename to src/ipa/raspberrypi/data/imx296_mono.json\ndiff --git a/src/ipa/raspberrypi/data/meson.build b/src/ipa/raspberrypi/data/meson.build\nindex 211811cfa915..465a7a17ce6f 100644\n--- a/src/ipa/raspberrypi/data/meson.build\n+++ b/src/ipa/raspberrypi/data/meson.build\n@@ -4,7 +4,7 @@ conf_files = files([\n     'imx219.json',\n     'imx219_noir.json',\n     'imx290.json',\n-    'imx296.json',\n+    'imx296_mono.json',\n     'imx378.json',\n     'imx477.json',\n     'imx477_noir.json',\ndiff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex dcd81650c32d..5d77715f3448 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -67,6 +67,14 @@ SensorFormats populateSensorFormats(std::unique_ptr<CameraSensor> &sensor)\n \treturn formats;\n }\n \n+bool isMonoSensor(std::unique_ptr<CameraSensor> &sensor)\n+{\n+\tunsigned int mbusCode = sensor->mbusCodes()[0];\n+\tconst BayerFormat &bayer = BayerFormat::fromMbusCode(mbusCode);\n+\n+\treturn bayer.order == BayerFormat::Order::MONO;\n+}\n+\n PixelFormat mbusCodeToPixelFormat(unsigned int mbus_code,\n \t\t\t\t  BayerFormat::Packing packingReq)\n {\n@@ -1551,10 +1559,14 @@ int RPiCameraData::loadIPA(ipa::RPi::IPAInitResult *result)\n \t */\n \tstd::string configurationFile;\n \tchar const *configFromEnv = utils::secure_getenv(\"LIBCAMERA_RPI_TUNING_FILE\");\n-\tif (!configFromEnv || *configFromEnv == '\\0')\n-\t\tconfigurationFile = ipa_->configurationFile(sensor_->model() + \".json\");\n-\telse\n+\tif (!configFromEnv || *configFromEnv == '\\0') {\n+\t\tstd::string model = sensor_->model();\n+\t\tif (isMonoSensor(sensor_))\n+\t\t\tmodel += \"_mono\";\n+\t\tconfigurationFile = ipa_->configurationFile(model + \".json\");\n+\t} else {\n \t\tconfigurationFile = std::string(configFromEnv);\n+\t}\n \n \tIPASettings settings(configurationFile, sensor_->model());\n \n",
    "prefixes": [
        "libcamera-devel"
    ]
}