Show a patch.

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

{
    "id": 13886,
    "url": "https://patchwork.libcamera.org/api/patches/13886/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/13886/",
    "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": "<20210922132915.14881-3-david.plowman@raspberrypi.com>",
    "date": "2021-09-22T13:29:15",
    "name": "[libcamera-devel,v2,2/2] libcamera: raspberrypi: Fetch correct value for sensor's modeSensitivity",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "5315f6b48611d60932941007b93c33d6106a46ca",
    "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/13886/mbox/",
    "series": [
        {
            "id": 2545,
            "url": "https://patchwork.libcamera.org/api/series/2545/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2545",
            "date": "2021-09-22T13:29:13",
            "name": "Application support for per-mode sensitivities",
            "version": 2,
            "mbox": "https://patchwork.libcamera.org/series/2545/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/13886/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/13886/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 62FEBBF01C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 22 Sep 2021 13:29:30 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9CEBE69196;\n\tWed, 22 Sep 2021 15:29:29 +0200 (CEST)",
            "from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com\n\t[IPv6:2a00:1450:4864:20::42b])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4000B6917F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 22 Sep 2021 15:29:26 +0200 (CEST)",
            "by mail-wr1-x42b.google.com with SMTP id t7so6694362wrw.13\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 22 Sep 2021 06:29:26 -0700 (PDT)",
            "from pi4-davidp.pitowers.org\n\t([2a00:1098:3142:14:1ce1:9965:4328:89c4])\n\tby smtp.gmail.com with ESMTPSA id\n\tq126sm5776310wma.10.2021.09.22.06.29.24\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 22 Sep 2021 06:29:24 -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=\"Vkyotmk7\"; 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=TB6Bt57clhDipCaxaFUZl8FofXJfzseyc3L+AJBLXmQ=;\n\tb=Vkyotmk7nRPy+pHRR3sn/SfAcaK4Bss5INVk0l/FTOsjrB1oNyWwwDwAUifWrtxyMy\n\tNj51mnQfoFtuHd6hLmZLrkBJqDB3ueLziVeNs6GWia1IwAljhawnG8/bi7YHFuZUtxDh\n\tMIoAZUhNDpV5UJpSe/hOVDumhGgIQWMTXwePf3Dy1Xgf027C5fWlI0Sb7nv+U/z/UmME\n\teiZ0SoqzR8JxH/6DaXUFGzGohT5QiE02XZv2RT25+XVucDl3oO5WMi6FcWZijZvwwEJT\n\tY1phZrES2jRPtnR7oqI3t9O/BvPk8id6JkGJA7Cfx20wT94DetG4ulD/nhAakLdzaY/n\n\tdjdw==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112;\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=TB6Bt57clhDipCaxaFUZl8FofXJfzseyc3L+AJBLXmQ=;\n\tb=gHYfDekQ9Y5JwK1faW/uOYezcVuTHBiPd5pVVAxt+SypE4ZZCHcjpRs36kUWiwgX8Q\n\tvcSsRuRWU3BlHP91MA22qNLFzw8Xw25xpo2bkwZ6wvSqVIYoocs/gqfI1VKtysbrCmVE\n\tTgcupdg408qT8r7PWWrWSxeeKXd4nAG5PbQG6elpejwjKONc1rW59ipeVvcuA0BQT7t6\n\teYMQxH1hIh/mJdJjx2aeCno2MX/BHLl7gV8mjXvIpDROdXrp0jIYM4ZMkjmaDPXKwqy6\n\t3B8SqLkKiFIDt6vJHQyoRRczDrF54Lfq/4k+c4oW7pPXXAkndRTyvCawavKO8J9tlXMI\n\tMLuQ==",
        "X-Gm-Message-State": "AOAM533wC41/6f+fI8G1OoSrW3RRGHX7oCXi1jTDBe4/cMKh69m+F570\n\t3r7sXwOKne/5SrM6/sXNEr+c8AsK7BoMx97z",
        "X-Google-Smtp-Source": "ABdhPJxtFYY7qG5P7aOvnWwQx9ydDNZ7XNNwsefEYVroOJtmzykEQMyia6u/kQ/106ZpOE0w/iQ9Mw==",
        "X-Received": "by 2002:a05:600c:3585:: with SMTP id\n\tp5mr10658012wmq.88.1632317365705; \n\tWed, 22 Sep 2021 06:29:25 -0700 (PDT)",
        "From": "David Plowman <david.plowman@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Wed, 22 Sep 2021 14:29:15 +0100",
        "Message-Id": "<20210922132915.14881-3-david.plowman@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20210922132915.14881-1-david.plowman@raspberrypi.com>",
        "References": "<20210922132915.14881-1-david.plowman@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v2 2/2] libcamera: raspberrypi: Fetch\n\tcorrect value for sensor's modeSensitivity",
        "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": "These changes retrieve the correct value for sensitivity of the mode\nselected for the sensor. This value is known to the CamHelper which\npasses it across to the pipeline handler so that it can be set\ncorrectly in the CameraConfiguration.\n\nSigned-off-by: David Plowman <david.plowman@raspberrypi.com>\n---\n include/libcamera/ipa/raspberrypi.mojom            |  7 ++++++-\n src/ipa/raspberrypi/raspberrypi.cpp                |  7 +++++--\n src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 10 +++++++---\n 3 files changed, 18 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/include/libcamera/ipa/raspberrypi.mojom b/include/libcamera/ipa/raspberrypi.mojom\nindex e453d46c..a92a76f8 100644\n--- a/include/libcamera/ipa/raspberrypi.mojom\n+++ b/include/libcamera/ipa/raspberrypi.mojom\n@@ -38,6 +38,10 @@ struct IPAConfig {\n \tlibcamera.FileDescriptor lsTableHandle;\n };\n \n+struct IPAConfigResult {\n+       float modeSensitivity;\n+};\n+\n struct StartConfig {\n \tlibcamera.ControlList controls;\n \tint32 dropFrameCount;\n@@ -57,6 +61,7 @@ interface IPARPiInterface {\n \t * \\param[in] entityControls Controls provided by the pipeline entities\n \t * \\param[in] ipaConfig Pipeline-handler-specific configuration data\n \t * \\param[out] controls Controls to apply by the pipeline entity\n+\t * \\param[out] result Other results that the pipeline handler may require\n \t *\n \t * This function shall be called when the camera is configured to inform\n \t * the IPA of the camera's streams and the sensor settings.\n@@ -71,7 +76,7 @@ interface IPARPiInterface {\n \t\t  map<uint32, libcamera.IPAStream> streamConfig,\n \t\t  map<uint32, libcamera.ControlInfoMap> entityControls,\n \t\t  IPAConfig ipaConfig)\n-\t\t=> (int32 ret, libcamera.ControlList controls);\n+\t\t=> (int32 ret, libcamera.ControlList controls, IPAConfigResult result);\n \n \t/**\n \t * \\fn mapBuffers()\ndiff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex 047123ab..796e6d15 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -97,7 +97,7 @@ public:\n \t\t      const std::map<unsigned int, IPAStream> &streamConfig,\n \t\t      const std::map<unsigned int, ControlInfoMap> &entityControls,\n \t\t      const ipa::RPi::IPAConfig &data,\n-\t\t      ControlList *controls) override;\n+\t\t      ControlList *controls, ipa::RPi::IPAConfigResult *result) override;\n \tvoid mapBuffers(const std::vector<IPABuffer> &buffers) override;\n \tvoid unmapBuffers(const std::vector<unsigned int> &ids) override;\n \tvoid signalStatReady(const uint32_t bufferId) override;\n@@ -337,7 +337,7 @@ int IPARPi::configure(const IPACameraSensorInfo &sensorInfo,\n \t\t      [[maybe_unused]] const std::map<unsigned int, IPAStream> &streamConfig,\n \t\t      const std::map<unsigned int, ControlInfoMap> &entityControls,\n \t\t      const ipa::RPi::IPAConfig &ipaConfig,\n-\t\t      ControlList *controls)\n+\t\t      ControlList *controls, ipa::RPi::IPAConfigResult *result)\n {\n \tif (entityControls.size() != 2) {\n \t\tLOG(IPARPI, Error) << \"No ISP or sensor controls found.\";\n@@ -389,6 +389,9 @@ int IPARPi::configure(const IPACameraSensorInfo &sensorInfo,\n \t/* Pass the camera mode to the CamHelper to setup algorithms. */\n \thelper_->SetCameraMode(mode_);\n \n+\t/* The pipeline handler passes out the mode's sensitivity. */\n+\tresult->modeSensitivity = mode_.sensitivity;\n+\n \tif (firstStart_) {\n \t\t/* Supply initial values for frame durations. */\n \t\tapplyFrameDurations(defaultMinFrameDuration, defaultMaxFrameDuration);\ndiff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex 0bdfa727..caf0030e 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -147,7 +147,7 @@ public:\n \tvoid frameStarted(uint32_t sequence);\n \n \tint loadIPA(ipa::RPi::SensorConfig *sensorConfig);\n-\tint configureIPA(const CameraConfiguration *config);\n+\tint configureIPA(CameraConfiguration *config);\n \n \tvoid statsMetadataComplete(uint32_t bufferId, const ControlList &controls);\n \tvoid runIsp(uint32_t bufferId);\n@@ -1250,7 +1250,7 @@ int RPiCameraData::loadIPA(ipa::RPi::SensorConfig *sensorConfig)\n \treturn ipa_->init(settings, sensorConfig);\n }\n \n-int RPiCameraData::configureIPA(const CameraConfiguration *config)\n+int RPiCameraData::configureIPA(CameraConfiguration *config)\n {\n \t/* We know config must be an RPiCameraConfiguration. */\n \tconst RPiCameraConfiguration *rpiConfig =\n@@ -1299,13 +1299,17 @@ int RPiCameraData::configureIPA(const CameraConfiguration *config)\n \n \t/* Ready the IPA - it must know about the sensor resolution. */\n \tControlList controls;\n+\tipa::RPi::IPAConfigResult result;\n \tret = ipa_->configure(sensorInfo_, streamConfig, entityControls, ipaConfig,\n-\t\t\t      &controls);\n+\t\t\t      &controls, &result);\n \tif (ret < 0) {\n \t\tLOG(RPI, Error) << \"IPA configuration failed!\";\n \t\treturn -EPIPE;\n \t}\n \n+\t/* Store the mode sensitivity for the application. */\n+\tconfig->modeSensitivity = result.modeSensitivity;\n+\n \t/*\n \t * Configure the H/V flip controls based on the combination of\n \t * the sensor and user transform.\n",
    "prefixes": [
        "libcamera-devel",
        "v2",
        "2/2"
    ]
}