Show a patch.

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

{
    "id": 18160,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/18160/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/18160/",
    "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": "<20230119104544.9456-13-naush@raspberrypi.com>",
    "date": "2023-01-19T10:45:42",
    "name": "[libcamera-devel,v1,12/14] ipa: raspberrypi: Add lens position to DeviceStatus",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "d9cbb87983e29ce8a61d4049f5b3e0348bdb068c",
    "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/18160/mbox/",
    "series": [
        {
            "id": 3715,
            "url": "https://patchwork.libcamera.org/api/1.1/series/3715/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3715",
            "date": "2023-01-19T10:45:30",
            "name": "Raspberry Pi: Camera Module 3 support",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/3715/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/18160/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/18160/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 57C45C3299\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 19 Jan 2023 10:46:08 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 05FBC6260D;\n\tThu, 19 Jan 2023 11:46:08 +0100 (CET)",
            "from mail-wm1-x333.google.com (mail-wm1-x333.google.com\n\t[IPv6:2a00:1450:4864:20::333])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 71E64625FF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 19 Jan 2023 11:46:01 +0100 (CET)",
            "by mail-wm1-x333.google.com with SMTP id\n\tl41-20020a05600c1d2900b003daf986faaeso923704wms.3\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 19 Jan 2023 02:46:01 -0800 (PST)",
            "from localhost.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tbe12-20020a05600c1e8c00b003db06224953sm5332029wmb.41.2023.01.19.02.46.00\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 19 Jan 2023 02:46:00 -0800 (PST)"
        ],
        "DKIM-Signature": [
            "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1674125168;\n\tbh=9ZG7A02w3xBIZWGiPWhbv2aDDQmxJ1BjGnnw5aKsFYw=;\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=2jrHCR2os3K8V5JHlpP1LBIX+eUVB2bLJqdMsyz49qMvc4hTAKSwZOInR6rbvr/CG\n\tZf2qPeN9w+HFIQzLz5kfMtaUyF3qNhKnWkhhViRYdrBClXZn0z8ZFW/FOfNzRe8MpX\n\timSCsx2asflnYegAzQTF3Y8Zds75f3xGzJIt1ZvRYoICC+3AsSQDh99QcdqUMo1gkK\n\t8Az/Sc8hpx/dAx/Qkk+EOAO9IoRZDvRjRY+EJ242zGd1AHrXcwdMG5QgAeuS/4Cz5E\n\tMz7frcdg5GkthVWFAxiUGXo8k+WFdEEAMPGmS/Wn9OfCIY6IEGNfEiXZ0weYyoGLkt\n\tqqIKUvilaprLg==",
            "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\t:message-id:reply-to;\n\tbh=6oRk+CQDW/U6TdVVYX9FHJVOlZ4Hp8UtCy5Yhpw/CYE=;\n\tb=dWv3o0pA6bn4y9mAODxSjSMMTPigSVDl+rrHSMn4jjWEbAwoRQFD/e6BcUiQMXkoSu\n\t6CDHMDWN4yMOmwfGYU7zqh/Mc8fqeQPH0a/ThSEkIoDrpu64tkG99YYWyj5zHbVOIpFt\n\t7J8nv/SWQVdGfRG8tfOyaCbIIaJ4bL4gNLJhT8+jGm72wY5TTunGHV+rZ7gyhIDTJPzQ\n\tuM9ME4SCOkVg+jz2rMHS0iHJVlhdKKI5ke3NGLYaHVzhyQXPGqhlXAXgc7YpBRhEXHNs\n\twjb6OUFja+ePQ+k7WB+hBV2iKfmZDHeS8VlQ9Q770LkaLcgu8N0HoX50D28ZT4yt5vxn\n\tl2PQ=="
        ],
        "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"dWv3o0pA\"; 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:message-id:reply-to;\n\tbh=6oRk+CQDW/U6TdVVYX9FHJVOlZ4Hp8UtCy5Yhpw/CYE=;\n\tb=5IpuhlG0gTXdU4bkRkul8QBgnuFYS5cfRNlTMhcmkOIVpW/h1LONoyMK0/AFQA69mn\n\tLLVQC+3GovbysqYJgYvIAFHQnRKUjHjNcABX9W8/0EiZ+eh7xxbxiRUFLMK1+sIMsyMy\n\tFmIk47wJU13y8UiimnZMh3dUmytVoXP/etrb2BXnvQ8YDV3fHZTQeRQaWzLXd6ivCfq+\n\tr6jeuOkWuaF2jI/q7k9KUsaIBRrTqW1dq8RV4KhqObj914QR17DwEIEpVt4dle2Ykwmc\n\tiI+vEm/+rGzPMq4lJyQ9MgXQ2qxmRbvA+B9ihfXPWH06t26nO4NSXqXgsQCgvhBL+aP6\n\tDNAQ==",
        "X-Gm-Message-State": "AFqh2kpqA05sEtOQxjzqsnb0VkYs6wiBpttCotujUY/dpM0NW230M+Z8\n\tPjbifSL+bi4VZecjW57YzVUzZ1g066HXw5Pwpbk=",
        "X-Google-Smtp-Source": "AMrXdXv6FdimLMkCXtDmVXXxXPcy9W3VBah8SNz1zQ9fe0G5/7xRuEB16akq5sY1l/LQGD04IR0jhA==",
        "X-Received": "by 2002:a05:600c:1d8e:b0:3d1:ebdf:d586 with SMTP id\n\tp14-20020a05600c1d8e00b003d1ebdfd586mr9670680wms.29.1674125160748; \n\tThu, 19 Jan 2023 02:46:00 -0800 (PST)",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Thu, 19 Jan 2023 10:45:42 +0000",
        "Message-Id": "<20230119104544.9456-13-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20230119104544.9456-1-naush@raspberrypi.com>",
        "References": "<20230119104544.9456-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v1 12/14] ipa: raspberrypi: Add lens\n\tposition to DeviceStatus",
        "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": "Add the current frame's lens position (in dioptres) to the DeviceStatus\nstructure. This value is obtained from the AfAlgorithm::getLensPosition()\nmember function. Return this lens position back to the pipeline handler to\nstore in the metadata field of the request.\n\nAs a drive-by, fixup some inaccurate comments in the DeviceStatus structure.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Nick Hollinghurst nick.hollinghurst@raspberrypi.com\n---\n src/ipa/raspberrypi/controller/device_status.h | 4 ++--\n src/ipa/raspberrypi/raspberrypi.cpp            | 7 +++++++\n 2 files changed, 9 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/src/ipa/raspberrypi/controller/device_status.h b/src/ipa/raspberrypi/controller/device_status.h\nindex 4384c2149589..c45db7499f94 100644\n--- a/src/ipa/raspberrypi/controller/device_status.h\n+++ b/src/ipa/raspberrypi/controller/device_status.h\n@@ -32,9 +32,9 @@ struct DeviceStatus {\n \t/* line length for the current frame */\n \tlibcamera::utils::Duration lineLength;\n \tdouble analogueGain;\n-\t/* 1.0/distance-in-metres, or 0 if unknown */\n+\t/* 1.0/distance-in-metres */\n \tstd::optional<double> lensPosition;\n-\t/* 1/f so that brightness quadruples when this doubles, or 0 if unknown */\n+\t/* 1/f so that brightness quadruples when this doubles */\n \tstd::optional<double> aperture;\n \t/* proportional to brightness with 0 = no flash, 1 = maximum flash */\n \tstd::optional<double> flashIntensity;\ndiff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex fbace14b1afe..5f7397e2ab21 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -586,6 +586,8 @@ void IPARPi::reportMetadata(unsigned int ipaContext)\n \t\t\t\t       helper_->exposure(deviceStatus->frameLength, deviceStatus->lineLength).get<std::micro>());\n \t\tif (deviceStatus->sensorTemperature)\n \t\t\tlibcameraMetadata_.set(controls::SensorTemperature, *deviceStatus->sensorTemperature);\n+\t\tif (deviceStatus->lensPosition)\n+\t\t\tlibcameraMetadata_.set(controls::LensPosition, *deviceStatus->lensPosition);\n \t}\n \n \tAgcStatus *agcStatus = rpiMetadata.getLocked<AgcStatus>(\"agc.status\");\n@@ -1352,6 +1354,11 @@ void IPARPi::fillDeviceStatus(const ControlList &sensorControls, unsigned int ip\n \tdeviceStatus.analogueGain = helper_->gain(gainCode);\n \tdeviceStatus.frameLength = mode_.height + vblank;\n \n+\tRPiController::AfAlgorithm *af = dynamic_cast<RPiController::AfAlgorithm *>(\n+\t\t\tcontroller_.getAlgorithm(\"af\"));\n+\tif (af)\n+\t\tdeviceStatus.lensPosition = af->getLensPosition();\n+\n \tLOG(IPARPI, Debug) << \"Metadata - \" << deviceStatus;\n \n \trpiMetadata_[ipaContext].set(\"device.status\", deviceStatus);\n",
    "prefixes": [
        "libcamera-devel",
        "v1",
        "12/14"
    ]
}