Show a patch.

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

{
    "id": 12904,
    "url": "https://patchwork.libcamera.org/api/patches/12904/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/12904/",
    "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": "<20210712100209.447893-4-naush@raspberrypi.com>",
    "date": "2021-07-12T10:02:04",
    "name": "[libcamera-devel,v7,3/8] ipa: raspberrypi: Add an operator<< to struct DeviceStatus",
    "commit_ref": "f24d83720f0ecd5656699f5013d7b5532e6e72c2",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "26c62d77a65c1ef692cbf07a4bab5a7936ab64e4",
    "submitter": {
        "id": 34,
        "url": "https://patchwork.libcamera.org/api/people/34/?format=api",
        "name": "Naushir Patuck",
        "email": "naush@raspberrypi.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/12904/mbox/",
    "series": [
        {
            "id": 2227,
            "url": "https://patchwork.libcamera.org/api/series/2227/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2227",
            "date": "2021-07-12T10:02:01",
            "name": "ipa: raspberrypi: Allow long exposure modes for imx477.",
            "version": 7,
            "mbox": "https://patchwork.libcamera.org/series/2227/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/12904/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/12904/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 07557C3224\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 12 Jul 2021 10:02:22 +0000 (UTC)",
            "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id B01446852A;\n\tMon, 12 Jul 2021 12:02:21 +0200 (CEST)",
            "from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com\n\t[IPv6:2a00:1450:4864:20::32d])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3AB4F6852A\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 12 Jul 2021 12:02:18 +0200 (CEST)",
            "by mail-wm1-x32d.google.com with SMTP id\n\tl4-20020a05600c4f04b0290220f8455631so3473715wmq.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 12 Jul 2021 03:02:18 -0700 (PDT)",
            "from naush-laptop.pitowers.org\n\t([2a00:1098:3142:14:3395:5e50:10bb:f8fd])\n\tby smtp.gmail.com with ESMTPSA id\n\tb16sm14249941wrs.51.2021.07.12.03.02.16\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 12 Jul 2021 03:02:17 -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=\"shSnnXUA\"; 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=VHbiovgBa81RqZUmpEMLgj2ypP55uY9DSSVQxj3EZM4=;\n\tb=shSnnXUAELm87sM1eTiiTuLvGlK7B52c60NUQTm9W4SPSlgEupwtEstVvjQySe6WjA\n\tlbfjE/0KXLkqZj7mjhF+HJjBZ4gC9ww+pS/60kl33gBbVpkV8rpA4yzxuRGREsQTJx1/\n\ttu8oHN9Vk99oX140Gl9hbFRIEF6xMR/DabKACyqQ2c77ZOozQvADlRtZQiSHjFKxMWxn\n\t68mI4IAWr2OA6Dd+MmM/uMzvEa/AKSq6FY8g1zgUu01gjAzqzUQAfdvTCM+rp3kVmoht\n\tmleGFwS/08/j2b50gZrzN/CmnetJ1pN7YhKiqBScoj9Zzw8sLGGmV2cAlqDeoXHdzccs\n\tN92w==",
        "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=VHbiovgBa81RqZUmpEMLgj2ypP55uY9DSSVQxj3EZM4=;\n\tb=BoCk31AzzFA+cBEUk9VXfQzhKfG1/FOgzwWI5MjXmfUZWOU1V8uEzBPWXgjFbj0vBF\n\tBdB7tzrkk2xoi0kQ8lUoePm3vRON6lJMhULzfXec1pxPzOZtZowXIoAVePe4vQJNjRrT\n\trBFABfTIMqexOg49iUQnQLJv6jyzS8/eXHPMZjszh/1z4nXLZl20Sds8iL4IAqDlPvGh\n\trcwgJ7Z26JO42wRVjDhjMF2e2kAskBpzib6h6zsfy4ZqSBHunrtqneYBrC7C6iPSpeFp\n\tLkyBoqX7GhRlap746/tbNFe94HSQN/CWVE6cA5FXKQDX8DzoPu9OJzxUwTr9zrZTswWr\n\t1UUw==",
        "X-Gm-Message-State": "AOAM5314mgAWUJQkAuHsw6HTw1ZHirBFZ3K/5vgLxSr+cYrmIO0GFkyt\n\tJ97AyE/FD30oORwc3BafsSuqRJLEfLzAjA==",
        "X-Google-Smtp-Source": "ABdhPJzfGhh2nG4dKJD1GzlMfzirYN6xlZx9Do+Jjj1ckEokneBZsnvkVcd0X3UHRT7UuWNP4pxQcQ==",
        "X-Received": "by 2002:a1c:1bc3:: with SMTP id\n\tb186mr13655814wmb.27.1626084137707; \n\tMon, 12 Jul 2021 03:02:17 -0700 (PDT)",
        "From": "Naushir Patuck <naush@raspberrypi.com>",
        "To": "libcamera-devel@lists.libcamera.org",
        "Date": "Mon, 12 Jul 2021 11:02:04 +0100",
        "Message-Id": "<20210712100209.447893-4-naush@raspberrypi.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20210712100209.447893-1-naush@raspberrypi.com>",
        "References": "<20210712100209.447893-1-naush@raspberrypi.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH v7 3/8] ipa: raspberrypi: Add an\n\toperator<< to struct 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>",
        "Errors-To": "libcamera-devel-bounces@lists.libcamera.org",
        "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"
    },
    "content": "Add an operator<< overload to log all fields in DeviceStatus, and remove the\nmanual logging statements in the IPA and CamHelper.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\n---\n src/ipa/raspberrypi/cam_helper.cpp            |  5 +----\n .../raspberrypi/controller/device_status.cpp  | 20 +++++++++++++++++++\n .../raspberrypi/controller/device_status.h    |  4 ++++\n src/ipa/raspberrypi/meson.build               |  1 +\n src/ipa/raspberrypi/raspberrypi.cpp           |  5 +----\n 5 files changed, 27 insertions(+), 8 deletions(-)\n create mode 100644 src/ipa/raspberrypi/controller/device_status.cpp",
    "diff": "diff --git a/src/ipa/raspberrypi/cam_helper.cpp b/src/ipa/raspberrypi/cam_helper.cpp\nindex e6d2258c66d7..1ec3f03e1aa3 100644\n--- a/src/ipa/raspberrypi/cam_helper.cpp\n+++ b/src/ipa/raspberrypi/cam_helper.cpp\n@@ -188,10 +188,7 @@ void CamHelper::parseEmbeddedData(Span<const uint8_t> buffer,\n \tdeviceStatus.shutter_speed = parsedDeviceStatus.shutter_speed;\n \tdeviceStatus.analogue_gain = parsedDeviceStatus.analogue_gain;\n \n-\tLOG(IPARPI, Debug) << \"Metadata updated - Exposure : \"\n-\t\t\t   << deviceStatus.shutter_speed\n-\t\t\t   << \" Gain : \"\n-\t\t\t   << deviceStatus.analogue_gain;\n+\tLOG(IPARPI, Debug) << \"Metadata updated - \" << deviceStatus;\n \n \tmetadata.Set(\"device.status\", deviceStatus);\n }\ndiff --git a/src/ipa/raspberrypi/controller/device_status.cpp b/src/ipa/raspberrypi/controller/device_status.cpp\nnew file mode 100644\nindex 000000000000..7b8218ca67d5\n--- /dev/null\n+++ b/src/ipa/raspberrypi/controller/device_status.cpp\n@@ -0,0 +1,20 @@\n+/* SPDX-License-Identifier: BSD-2-Clause */\n+/*\n+ * Copyright (C) 2021, Raspberry Pi (Trading) Limited\n+ *\n+ * device_status.cpp - device (image sensor) status\n+ */\n+#include \"device_status.h\"\n+\n+using namespace libcamera; /* for the Duration operator<< overload */\n+\n+std::ostream &operator<<(std::ostream &out, const DeviceStatus &d)\n+{\n+\tout << \"Exposure: \" << d.shutter_speed\n+\t    << \" Gain: \" << d.analogue_gain\n+\t    << \" Aperture: \" << d.aperture\n+\t    << \" Lens: \" << d.lens_position\n+\t    << \" Flash: \" << d.flash_intensity;\n+\n+\treturn out;\n+}\ndiff --git a/src/ipa/raspberrypi/controller/device_status.h b/src/ipa/raspberrypi/controller/device_status.h\nindex 73df7ce228dd..ec4bbe738b35 100644\n--- a/src/ipa/raspberrypi/controller/device_status.h\n+++ b/src/ipa/raspberrypi/controller/device_status.h\n@@ -6,6 +6,8 @@\n  */\n #pragma once\n \n+#include <iostream>\n+\n #include <libcamera/base/utils.h>\n \n /*\n@@ -20,6 +22,8 @@ struct DeviceStatus {\n \t{\n \t}\n \n+\tfriend std::ostream &operator<<(std::ostream &out, const DeviceStatus &d);\n+\n \t/* time shutter is open */\n \tlibcamera::utils::Duration shutter_speed;\n \tdouble analogue_gain;\ndiff --git a/src/ipa/raspberrypi/meson.build b/src/ipa/raspberrypi/meson.build\nindex c98550180d7b..1af31e4aa021 100644\n--- a/src/ipa/raspberrypi/meson.build\n+++ b/src/ipa/raspberrypi/meson.build\n@@ -40,6 +40,7 @@ rpi_ipa_sources = files([\n     'controller/rpi/contrast.cpp',\n     'controller/rpi/sdn.cpp',\n     'controller/pwl.cpp',\n+    'controller/device_status.cpp',\n ])\n \n mod = shared_module(ipa_name,\ndiff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex 4d09a84f6532..f51c970befb5 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -1019,10 +1019,7 @@ void IPARPi::fillDeviceStatus(const ControlList &sensorControls)\n \tdeviceStatus.shutter_speed = helper_->Exposure(exposureLines);\n \tdeviceStatus.analogue_gain = helper_->Gain(gainCode);\n \n-\tLOG(IPARPI, Debug) << \"Metadata - Exposure : \"\n-\t\t\t   << deviceStatus.shutter_speed\n-\t\t\t   << \" Gain : \"\n-\t\t\t   << deviceStatus.analogue_gain;\n+\tLOG(IPARPI, Debug) << \"Metadata - \" << deviceStatus;\n \n \trpiMetadata_.Set(\"device.status\", deviceStatus);\n }\n",
    "prefixes": [
        "libcamera-devel",
        "v7",
        "3/8"
    ]
}