Show a patch.

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

{
    "id": 18392,
    "url": "https://patchwork.libcamera.org/api/patches/18392/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/18392/",
    "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": "<20230314144834.85193-2-dse@thaumatec.com>",
    "date": "2023-03-14T14:48:25",
    "name": "[libcamera-devel,v4,01/10] rkisp1: Add camera lens to PH and expose it to the IPA",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "3d0f0fd42984010afdd62b2b805c16d0a6250136",
    "submitter": {
        "id": 126,
        "url": "https://patchwork.libcamera.org/api/people/126/?format=api",
        "name": "Daniel Semkowicz",
        "email": "dse@thaumatec.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/18392/mbox/",
    "series": [
        {
            "id": 3805,
            "url": "https://patchwork.libcamera.org/api/series/3805/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3805",
            "date": "2023-03-14T14:48:24",
            "name": "ipa: rkisp1: Add autofocus algorithm",
            "version": 4,
            "mbox": "https://patchwork.libcamera.org/series/3805/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/18392/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/18392/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 2E9B9BD80A\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 14 Mar 2023 14:49:54 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C88116270E;\n\tTue, 14 Mar 2023 15:49:53 +0100 (CET)",
            "from mail-lj1-x22c.google.com (mail-lj1-x22c.google.com\n\t[IPv6:2a00:1450:4864:20::22c])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 008AD626D6\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Mar 2023 15:49:52 +0100 (CET)",
            "by mail-lj1-x22c.google.com with SMTP id b10so16320920ljr.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 14 Mar 2023 07:49:51 -0700 (PDT)",
            "from localhost.localdomain ([91.90.166.178])\n\tby smtp.gmail.com with ESMTPSA id\n\tq25-20020a2eb4b9000000b00295a35f30e1sm470961ljm.115.2023.03.14.07.49.22\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 14 Mar 2023 07:49:51 -0700 (PDT)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1678805393;\n\tbh=Z6VTu0zidCzMXOnvglkDj64XlU2ckQvY+pnZGFLWnOY=;\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:Cc:\n\tFrom;\n\tb=BpM9ZCZvt4lPQ7uLLRd3Tcf/B3jj4fRwsOCfaKTB/K9p67KVZt2RvxWnA84Tr94P0\n\tsNoHmMDv/lU6iRhPeqMoWQwFhtNO9ungwO4oxBffN3edirhEivWgz+e4EQnQE8Trnv\n\t6NrlSHEpjSLr3qBd68m3JLbXnYNGH8FsDuk1+yE9XukA2HTWOZ1VZAGA7o4VHkzioO\n\ta+PT4C+8UZYAwjDHFiNJH0cHLzZTI+UAHLQ2ZdPaA3bPP57HvqOBNP/neb0lKFMRQS\n\tdOPRMMxWotmwtii1Kb0UMwazXxh12JwAB/aD6+cbFngyalas34jbP0E79nRZbd3YfK\n\tsAGmm0YLoaYaQ==",
            "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=thaumatec-com.20210112.gappssmtp.com; s=20210112; t=1678805391;\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=r4NPnLMb4QG0NlqecrFPvrV8a7pjMAgwk3MN6og/a88=;\n\tb=AORGVMt24yxthdUL94YX1Ea9tf93Zh/t877JSlo6gT448qMnFi9etsTBgZkDxH0NML\n\tx3COgG5/jzTgh1fi2V7aZkXuwmFNU+A6u3fSJYi1NmW0RTm5rkldohsyHWhpt2rzSb1n\n\tJsYVR7nZalx6ElbcnzbMVwwcPRwwJ9R5+FceIKHc6jgfspL72zesRZCIxuQ2mCwMoeww\n\tpPhruF5FkMOMPQvx34uObHfaV9Q4wezVSXNdA+pxHAebxmhG1Qe80O/B3G8uWEYKDKJX\n\tGl6WViLc1DZuvu3eDEUG1KVo1oHoUNwiEWiRAOcugg1hyCIjrcvo9UtMIvZCULZBR1/m\n\tVg4w=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected)\n\theader.d=thaumatec-com.20210112.gappssmtp.com\n\theader.i=@thaumatec-com.20210112.gappssmtp.com header.b=\"AORGVMt2\"; \n\tdkim-atps=neutral",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20210112; t=1678805391;\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=r4NPnLMb4QG0NlqecrFPvrV8a7pjMAgwk3MN6og/a88=;\n\tb=abw9B66wwHvLawIWhP+NgjOL7/w02JcGGR54j8naWcUldsCOLP3DmCuCUun1RL70qo\n\t2HWQc/O1vX8w15LcFisTM/OGnMwxPFzImoSwAk68km5ttGiQFoa19rJj8pe+kQ5dAeDW\n\tLvhEFiEC0yHTCFuSHP/MHcojkKIvng0joq3N2R/yPyhTkRCKxCKwgLEylCTkXR0hap8d\n\tn+ROPZkGh08DNA//ZeHxYzrxC7AZTOifiH5bueCeNhInJVncX9jye91kXk2vyEMRWhqe\n\tNh8c+EQDZXiWC2Y4pxlfdx0ZEa8PuWh3C/LYk9I+OndC+xnlazGO3MIzcw6jjgst1qhC\n\taCxQ==",
        "X-Gm-Message-State": "AO0yUKXFgKOiyeLGgj9clYFjt76ESl3qCb8/CPOXGL42yw3r9/VL+py0\n\tzxvDgyqRQyPZt5XOkgtTx+jAAJmLq8dOCbhX8To=",
        "X-Google-Smtp-Source": "AK7set9ntMGZ8yPlHpEaoZ896SEK5Cvgd7Nu7pzI6GMTfg7HGlDMNaOGBxoXkKibxplYHAGyaC8IQQ==",
        "X-Received": "by 2002:a2e:97d1:0:b0:298:9fbf:61dd with SMTP id\n\tm17-20020a2e97d1000000b002989fbf61ddmr825963ljj.16.1678805391269; \n\tTue, 14 Mar 2023 07:49:51 -0700 (PDT)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Tue, 14 Mar 2023 15:48:25 +0100",
        "Message-Id": "<20230314144834.85193-2-dse@thaumatec.com>",
        "X-Mailer": "git-send-email 2.39.2",
        "In-Reply-To": "<20230314144834.85193-1-dse@thaumatec.com>",
        "References": "<20230314144834.85193-1-dse@thaumatec.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v4 01/10] rkisp1: Add camera lens to PH\n\tand expose it to the IPA",
        "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": "Daniel Semkowicz via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>",
        "Reply-To": "Daniel Semkowicz <dse@thaumatec.com>",
        "Cc": "jacopo.mondi@ideasonboard.com",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Check in pipeline handler if camera lens exists, and expose its controls\nto the IPA.\n\nSigned-off-by: Daniel Semkowicz <dse@thaumatec.com>\n---\nI did not include the \"reviewed-by\" markers from last review as there was\na change in this commit. Code in IPA file has been moved a bit down to better\nfit with the changes from the next commit.\n\n include/libcamera/ipa/rkisp1.mojom       | 1 +\n src/ipa/rkisp1/rkisp1.cpp                | 5 +++++\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 5 +++++\n 3 files changed, 11 insertions(+)",
    "diff": "diff --git a/include/libcamera/ipa/rkisp1.mojom b/include/libcamera/ipa/rkisp1.mojom\nindex 1009e970..bf6e9141 100644\n--- a/include/libcamera/ipa/rkisp1.mojom\n+++ b/include/libcamera/ipa/rkisp1.mojom\n@@ -11,6 +11,7 @@ import \"include/libcamera/ipa/core.mojom\";\n struct IPAConfigInfo {\n \tlibcamera.IPACameraSensorInfo sensorInfo;\n \tlibcamera.ControlInfoMap sensorControls;\n+\tlibcamera.ControlInfoMap lensControls;\n };\n \n interface IPARkISP1Interface {\ndiff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\nindex 6544c925..248cf5e0 100644\n--- a/src/ipa/rkisp1/rkisp1.cpp\n+++ b/src/ipa/rkisp1/rkisp1.cpp\n@@ -7,6 +7,7 @@\n \n #include <algorithm>\n #include <math.h>\n+#include <optional>\n #include <queue>\n #include <stdint.h>\n #include <string.h>\n@@ -80,6 +81,7 @@ private:\n \tstd::map<unsigned int, MappedFrameBuffer> mappedBuffers_;\n \n \tControlInfoMap sensorControls_;\n+\tstd::optional<ControlInfoMap> lensControls_;\n \n \t/* revision-specific data */\n \trkisp1_cif_isp_version hwRevision_;\n@@ -265,6 +267,9 @@ int IPARkISP1::configure(const IPAConfigInfo &ipaConfig,\n \t\t\treturn format.colourEncoding == PixelFormatInfo::ColourEncodingRAW;\n \t\t});\n \n+\tif (!ipaConfig.lensControls.empty())\n+\t\tlensControls_ = ipaConfig.lensControls;\n+\n \tfor (auto const &a : algorithms()) {\n \t\tAlgorithm *algo = static_cast<Algorithm *>(a.get());\n \ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 8a30fe06..83fb6287 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -32,6 +32,7 @@\n #include <libcamera/ipa/rkisp1_ipa_proxy.h>\n \n #include \"libcamera/internal/camera.h\"\n+#include \"libcamera/internal/camera_lens.h\"\n #include \"libcamera/internal/camera_sensor.h\"\n #include \"libcamera/internal/delayed_controls.h\"\n #include \"libcamera/internal/device_enumerator.h\"\n@@ -812,6 +813,10 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n \n \tipaConfig.sensorControls = data->sensor_->controls();\n \n+\tCameraLens *lens = data->sensor_->focusLens();\n+\tif (lens)\n+\t\tipaConfig.lensControls = lens->controls();\n+\n \tret = data->ipa_->configure(ipaConfig, streamConfig, &data->controlInfo_);\n \tif (ret) {\n \t\tLOG(RkISP1, Error) << \"failed configuring IPA (\" << ret << \")\";\n",
    "prefixes": [
        "libcamera-devel",
        "v4",
        "01/10"
    ]
}