Patch Detail
Show a patch.
GET /api/1.1/patches/16423/?format=api
{ "id": 16423, "url": "https://patchwork.libcamera.org/api/1.1/patches/16423/?format=api", "web_url": "https://patchwork.libcamera.org/patch/16423/", "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": "<20220629085722.11786-3-naush@raspberrypi.com>", "date": "2022-06-29T08:57:20", "name": "[libcamera-devel,v4,2/4] ipa: raspberrypi: Add sensor temperature to DeviceStatus", "commit_ref": "2a321be376dbc3c534d3634fdcaf141aff79cd48", "pull_url": null, "state": "accepted", "archived": false, "hash": "0bda18121fe1c905edcc02a4ac9c0ec89388a494", "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/16423/mbox/", "series": [ { "id": 3231, "url": "https://patchwork.libcamera.org/api/1.1/series/3231/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3231", "date": "2022-06-29T08:57:18", "name": "Add SensorTemperature control", "version": 4, "mbox": "https://patchwork.libcamera.org/series/3231/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/16423/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/16423/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 45FAEBD808\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 29 Jun 2022 08:57:33 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0771865640;\n\tWed, 29 Jun 2022 10:57:33 +0200 (CEST)", "from mail-wr1-x432.google.com (mail-wr1-x432.google.com\n\t[IPv6:2a00:1450:4864:20::432])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 1B8C565632\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 29 Jun 2022 10:57:29 +0200 (CEST)", "by mail-wr1-x432.google.com with SMTP id d17so15718855wrc.10\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 29 Jun 2022 01:57:29 -0700 (PDT)", "from naush-laptop.localdomain ([93.93.133.154])\n\tby smtp.gmail.com with ESMTPSA id\n\tf15-20020a05600c154f00b003a032c88877sm2897102wmg.15.2022.06.29.01.57.27\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tWed, 29 Jun 2022 01:57:27 -0700 (PDT)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1656493053;\n\tbh=cTDyvnhIURTW0R4V5fGA65Hb3TQoxTJ7BxIYsVxB5/k=;\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=E5zTKZWeD1BVGHhNvQuSsceapeG6Tu6+2hPE5mLHMl13kPMmSJykjlvMq8Vx2a6mB\n\tfToYGCC+vLSZC8QeqcN4TnFjXxNiHEXhifNMgEtfYE8+kO8my7qSLcFnHo2s8YDLkF\n\tnwzSobn1MqEVOwTxQpLLwD/++mxvuifxBFqp3YCEv80EbRsIEjjpKDm3zM6nLJPosJ\n\tvCPqRAMCOot8asTFx5oUWuFgAjS2A93k35GgcNifGJEQxdql4gKOvka5e1bMxYDkCT\n\tEfu+rzWYkD2lQ/r7sCy8ksk1fJ55cWQo9uP3zRPOqLA/85BQ9Mz8iuZF/j/LILSIK4\n\tsTocnXNZET+CQ==", "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=weQED+1mys2mhgHP4iQlmcHoTRJvWho5Ugz62KPfY20=;\n\tb=G25mraLtkeEEktCfQjyUp5t7uY3DDCdg9knRZkE7l1zpyJ3+9lLI8aW6ALJ9phGOwJ\n\tK4v+ZNbk89uDRCuPs0T0VxCvpYqV02Umh1OgoYBJE4sNjvnJxK3Wfb5o7dm9YDqN9nDl\n\tz/WWNrijfwrxqZt9g9usAV1gAyL0EFgJ7elFeoARJS56qsFmQmsaK8Ita5UrgdxAQTnw\n\t+Zax3sLtOpYaV7ONJPk1C2o2uSmvhQ7WlH+DkmffmbvKnGPPWNxRiDeUrVBQJs9UP/rD\n\t8hHB6bC4De6VEcUk0qPfYbeycdg6BhqGqSm6Qq7kchr7viTf/GMpVk5k4ugWQ0tgYfmT\n\t3VQw==" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"G25mraLt\"; dkim-atps=neutral", "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=weQED+1mys2mhgHP4iQlmcHoTRJvWho5Ugz62KPfY20=;\n\tb=kc9VFdZzW5Ebp95GAnYmSDMJmcgnrRpw8yr4TfOpeM4lqCZKEyHWYlwxHEar8/w/LE\n\tRPIJ426LaTHty9iEI2STiHRMkminZOXzCmo5vXE2cuazAkwJ83bg/zz9p64hyRL5kToS\n\tdjTJImHZP5NrDgnCzEo1vF26Xl5zxGDITNMu+qOnSgZX0RCljVMr1lbt3yWlG2Mqw8is\n\tCF2a7a8JG63gSX6D937WG1ga11kLdtGrPJLitugrwDM5v1d7OHTjJq4fRZX9TtnN91te\n\tdw945cnDAWQm1Opez5cMcu6jtrH/iC5K8BsN6KFHqsghZTZb4NwkzjWuao571F3/qcDq\n\tbEtA==", "X-Gm-Message-State": "AJIora9aj6kPLdZIBrUJ8/6HLdm3qGMt2xZ4EzPaZJXXYOrcVCnBhnqI\n\txq+gb9zegQT4GRGQiRz1yvkY7S+5r9GJgzB/", "X-Google-Smtp-Source": "AGRyM1sVMXQ37PcpZ3gSYSbHo9c23Cfn3hyLpLmcAGF7jg/P1R/7MfqcXw1fMifowayflAP3StxUWA==", "X-Received": "by 2002:adf:e5d2:0:b0:21b:bfd5:cacd with SMTP id\n\ta18-20020adfe5d2000000b0021bbfd5cacdmr1955877wrn.474.1656493048482; \n\tWed, 29 Jun 2022 01:57:28 -0700 (PDT)", "To": "libcamera-devel@lists.libcamera.org", "Date": "Wed, 29 Jun 2022 09:57:20 +0100", "Message-Id": "<20220629085722.11786-3-naush@raspberrypi.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20220629085722.11786-1-naush@raspberrypi.com>", "References": "<20220629085722.11786-1-naush@raspberrypi.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v4 2/4] ipa: raspberrypi: Add sensor\n\ttemperature 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 an optional sensor_temperature field to the DeviceStatus structure. If a\ntemperature measurement is available for a frame, the value is returned out\nthrough the SensorTemperature control in the Request metadata.\n\nAdditionally, provide the sensor temperature value from the std::ostream &operator<<\noverload.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n---\n src/ipa/raspberrypi/cam_helper.cpp | 8 +++++---\n src/ipa/raspberrypi/controller/device_status.cpp | 3 +++\n src/ipa/raspberrypi/controller/device_status.h | 3 +++\n src/ipa/raspberrypi/raspberrypi.cpp | 2 ++\n 4 files changed, 13 insertions(+), 3 deletions(-)", "diff": "diff --git a/src/ipa/raspberrypi/cam_helper.cpp b/src/ipa/raspberrypi/cam_helper.cpp\nindex 74179399e86a..3f81d4187d4d 100644\n--- a/src/ipa/raspberrypi/cam_helper.cpp\n+++ b/src/ipa/raspberrypi/cam_helper.cpp\n@@ -185,9 +185,9 @@ void CamHelper::parseEmbeddedData(Span<const uint8_t> buffer,\n \tmetadata.Merge(parsedMetadata);\n \n \t/*\n-\t * Overwrite the exposure/gain values in the existing DeviceStatus with\n-\t * values from the parsed embedded buffer. Fetch it first in case any\n-\t * other fields were set meaningfully.\n+\t * Overwrite the exposure/gain, frame length and sensor temperature values\n+\t * in the existing DeviceStatus with values from the parsed embedded buffer.\n+\t * Fetch it first in case any other fields were set meaningfully.\n \t */\n \tDeviceStatus deviceStatus, parsedDeviceStatus;\n \tif (metadata.Get(\"device.status\", deviceStatus) ||\n@@ -199,6 +199,8 @@ void CamHelper::parseEmbeddedData(Span<const uint8_t> buffer,\n \tdeviceStatus.shutter_speed = parsedDeviceStatus.shutter_speed;\n \tdeviceStatus.analogue_gain = parsedDeviceStatus.analogue_gain;\n \tdeviceStatus.frame_length = parsedDeviceStatus.frame_length;\n+\tif (parsedDeviceStatus.sensor_temperature)\n+\t\tdeviceStatus.sensor_temperature = parsedDeviceStatus.sensor_temperature;\n \n \tLOG(IPARPI, Debug) << \"Metadata updated - \" << deviceStatus;\n \ndiff --git a/src/ipa/raspberrypi/controller/device_status.cpp b/src/ipa/raspberrypi/controller/device_status.cpp\nindex f052ea8b7bed..05897fc15b50 100644\n--- a/src/ipa/raspberrypi/controller/device_status.cpp\n+++ b/src/ipa/raspberrypi/controller/device_status.cpp\n@@ -17,5 +17,8 @@ std::ostream &operator<<(std::ostream &out, const DeviceStatus &d)\n \t << \" Lens: \" << d.lens_position\n \t << \" Flash: \" << d.flash_intensity;\n \n+\tif (d.sensor_temperature)\n+\t\tout << \" Temperature: \" << *d.sensor_temperature;\n+\n \treturn out;\n }\ndiff --git a/src/ipa/raspberrypi/controller/device_status.h b/src/ipa/raspberrypi/controller/device_status.h\nindex c4a5d9c8e8c7..eca3bf4b042e 100644\n--- a/src/ipa/raspberrypi/controller/device_status.h\n+++ b/src/ipa/raspberrypi/controller/device_status.h\n@@ -7,6 +7,7 @@\n #pragma once\n \n #include <iostream>\n+#include <optional>\n \n #include <libcamera/base/utils.h>\n \n@@ -36,4 +37,6 @@ struct DeviceStatus {\n \tdouble aperture;\n \t/* proportional to brightness with 0 = no flash, 1 = maximum flash */\n \tdouble flash_intensity;\n+\t/* Sensor reported temperature value (in degrees) */\n+\tstd::optional<double> sensor_temperature;\n };\ndiff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex 3b126bb5175e..cb0025a17aff 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -491,6 +491,8 @@ void IPARPi::reportMetadata()\n \t\tlibcameraMetadata_.set(controls::AnalogueGain, deviceStatus->analogue_gain);\n \t\tlibcameraMetadata_.set(controls::FrameDuration,\n \t\t\t\t helper_->Exposure(deviceStatus->frame_length).get<std::micro>());\n+\t\tif (deviceStatus->sensor_temperature)\n+\t\t\tlibcameraMetadata_.set(controls::SensorTemperature, *deviceStatus->sensor_temperature);\n \t}\n \n \tAgcStatus *agcStatus = rpiMetadata_.GetLocked<AgcStatus>(\"agc.status\");\n", "prefixes": [ "libcamera-devel", "v4", "2/4" ] }