Show a patch.

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

{
    "id": 12569,
    "url": "https://patchwork.libcamera.org/api/patches/12569/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/12569/",
    "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": "<20210611100703.2285-2-david.plowman@raspberrypi.com>",
    "date": "2021-06-11T10:07:02",
    "name": "[libcamera-devel,v3,1/2] ipa: raspberrypi: Add sensitivity field to camera mode",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "abfd7c18061c9dad05a64ac3e608ba8308ee456b",
    "submitter": {
        "id": 42,
        "url": "https://patchwork.libcamera.org/api/people/42/?format=api",
        "name": "David Plowman",
        "email": "david.plowman@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/12569/mbox/",
    "series": [
        {
            "id": 2122,
            "url": "https://patchwork.libcamera.org/api/series/2122/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2122",
            "date": "2021-06-11T10:07:01",
            "name": "Raspberrypi: support per-mode camera sensitivities",
            "version": 3,
            "mbox": "https://patchwork.libcamera.org/series/2122/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/12569/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/12569/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 C1820C3214\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 11 Jun 2021 10:07:09 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 52F4068934;\n\tFri, 11 Jun 2021 12:07:09 +0200 (CEST)",
            "from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com\n\t[IPv6:2a00:1450:4864:20::32a])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6AC8F6892C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 11 Jun 2021 12:07:08 +0200 (CEST)",
            "by mail-wm1-x32a.google.com with SMTP id\n\tf16-20020a05600c1550b02901b00c1be4abso8321729wmg.2\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 11 Jun 2021 03:07:08 -0700 (PDT)",
            "from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72])\n\tby smtp.gmail.com with ESMTPSA id\n\tb135sm12568155wmb.5.2021.06.11.03.07.07\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 11 Jun 2021 03:07:07 -0700 (PDT)"
        ],
        "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"qz5QvdHO\"; dkim-atps=neutral",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=XACfAo3TeGNF0rp/SYZW+awF5o1J3CDFB0MciljeeOQ=;\n\tb=qz5QvdHOUGe1IfPGt8bnaBRkzgD5JoJGSk//DmlSH1ufFG3pdMkbMXZO7hSGNFKIGe\n\tess5jQITrVMiupk3fDL4409lo3L0KC7vwIT0T69woQBsPBvZDbUZ4iK3gOA9eAWMCo93\n\twfgRmfvf/Fcd8KjxZ5YvRYlSwa+Of2OY0NnUbzAHlcXAvp5LmZZTDdLX00TZ5a2758S0\n\tDhVIbpg1H+oi1H1psLsk00arjRF1+SOMV/SiD6fAmtIMhUNUvMhUqutOU7Y8I63gZpwI\n\tLCifjxJL6F2Sm3Hon9GT+hNaLfx8fc3XnMMbASDvZ7HoCG9uU4K2UQaYr/HFRwjG4ddg\n\tLfhA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=XACfAo3TeGNF0rp/SYZW+awF5o1J3CDFB0MciljeeOQ=;\n\tb=ZaYKcS6ZGIxTOhRcNc8PbLRqbZO6NQ5ZfLwRjJlJ9/zN998Pp5bV+yFutJ3lfjasVv\n\tWs2S7akucn6jfZJn+EYiX2wJLmIE7gYLrKL3/4yWQxK5Du2QI9e1GFaklLO6XqEAD0fI\n\tRmnzM8Jqi6UWuMX8h9Er3B3WACnc9z91/fGmSE3V468kC4mjUcfK3pV7/cTRzKMfuQvp\n\tt9x1K5V/aAg2v5t6T5siWMrYnhO2yZDT1hAdopYmtdAKBhqCxfznFcnOD5mjfk7JiFG7\n\tZE234/eFML7mjFtxi9Yl5s1sb/p9aNCTn5O7Z3cUWDdgIGvlYDbsikpyqxtNuX7J1lWN\n\tUgvQ==",
        "X-Gm-Message-State": "AOAM532QlMpPxSwa9aLEk2MJrZYVGp7zB9NDnBx73FZVFBf+BwHlE/1d\n\tsReRG05dh9vX8Dt57y0L8f2U23KEcpgARbuO",
        "X-Google-Smtp-Source": "ABdhPJwM9Ne/sexF84I3DfjmyrvDEfd8qIm/sObvjMw+VMtx5t/Om4ri/zLR6NjNy4HF4YUS1VcIrw==",
        "X-Received": "by 2002:a7b:c10b:: with SMTP id\n\tw11mr19565668wmi.186.1623406027675; \n\tFri, 11 Jun 2021 03:07:07 -0700 (PDT)",
        "From": "David Plowman <david.plowman@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Fri, 11 Jun 2021 11:07:02 +0100",
        "Message-Id": "<20210611100703.2285-2-david.plowman@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20210611100703.2285-1-david.plowman@raspberrypi.com>",
        "References": "<20210611100703.2285-1-david.plowman@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v3 1/2] ipa: raspberrypi: Add sensitivity\n\tfield to camera mode",
        "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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "We use the CamHelper class to initialise it to the usual value of 1.\n\nThe CamHelper's GetModeSensitivity method can be redefined to\nimplement a different behaviour for sensors that require it.\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\n---\n src/ipa/raspberrypi/cam_helper.cpp           | 11 +++++++++++\n src/ipa/raspberrypi/cam_helper.hpp           |  3 +++\n src/ipa/raspberrypi/controller/camera_mode.h |  2 ++\n src/ipa/raspberrypi/raspberrypi.cpp          |  6 ++++++\n 4 files changed, 22 insertions(+)",
    "diff": "diff --git a/src/ipa/raspberrypi/cam_helper.cpp b/src/ipa/raspberrypi/cam_helper.cpp\nindex 062e94c4..d0104da7 100644\n--- a/src/ipa/raspberrypi/cam_helper.cpp\n+++ b/src/ipa/raspberrypi/cam_helper.cpp\n@@ -130,6 +130,17 @@ bool CamHelper::SensorEmbeddedDataPresent() const\n \treturn false;\n }\n \n+double CamHelper::GetModeSensitivity([[maybe_unused]] const CameraMode &mode) const\n+{\n+\t/*\n+\t * Most sensors have the same sensitivity in every mode, but this\n+\t * method can be overridden for those that do not. Note that it is\n+\t * called before mode_ is set, so it must return the sensitivity\n+\t * of the mode that is passed in.\n+\t */\n+\treturn 1.0;\n+}\n+\n unsigned int CamHelper::HideFramesStartup() const\n {\n \t/*\ndiff --git a/src/ipa/raspberrypi/cam_helper.hpp b/src/ipa/raspberrypi/cam_helper.hpp\nindex f53f5c39..f524fe84 100644\n--- a/src/ipa/raspberrypi/cam_helper.hpp\n+++ b/src/ipa/raspberrypi/cam_helper.hpp\n@@ -40,6 +40,8 @@ namespace RPiController {\n //\n // A method to query if the sensor outputs embedded data that can be parsed.\n //\n+// A method to return the sensitivity of a given camera mode.\n+//\n // A parser to parse the embedded data buffers provided by some sensors (for\n // example, the imx219 does; the ov5647 doesn't). This allows us to know for\n // sure the exposure and gain of the frame we're looking at. CamHelper\n@@ -83,6 +85,7 @@ public:\n \tvirtual void GetDelays(int &exposure_delay, int &gain_delay,\n \t\t\t       int &vblank_delay) const;\n \tvirtual bool SensorEmbeddedDataPresent() const;\n+\tvirtual double GetModeSensitivity(const CameraMode &mode) const;\n \tvirtual unsigned int HideFramesStartup() const;\n \tvirtual unsigned int HideFramesModeSwitch() const;\n \tvirtual unsigned int MistrustFramesStartup() const;\ndiff --git a/src/ipa/raspberrypi/controller/camera_mode.h b/src/ipa/raspberrypi/controller/camera_mode.h\nindex 2aa2335d..72c68dc6 100644\n--- a/src/ipa/raspberrypi/controller/camera_mode.h\n+++ b/src/ipa/raspberrypi/controller/camera_mode.h\n@@ -41,6 +41,8 @@ struct CameraMode {\n \tlibcamera::Transform transform;\n \t// minimum and maximum fame lengths in units of lines\n \tuint32_t min_frame_length, max_frame_length;\n+\t// sensitivity of this mode\n+\tdouble sensitivity;\n };\n \n #ifdef __cplusplus\ndiff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex 1c1e802a..9ce0db08 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -324,6 +324,12 @@ void IPARPi::setMode(const IPACameraSensorInfo &sensorInfo)\n \t */\n \tmode_.min_frame_length = sensorInfo.minFrameLength;\n \tmode_.max_frame_length = sensorInfo.maxFrameLength;\n+\n+\t/*\n+\t * Some sensors may have different sensitivities in different modes;\n+\t * the CamHelper will know the correct value.\n+\t */\n+\tmode_.sensitivity = helper_->GetModeSensitivity(mode_);\n }\n \n int IPARPi::configure(const IPACameraSensorInfo &sensorInfo,\n",
    "prefixes": [
        "libcamera-devel",
        "v3",
        "1/2"
    ]
}