Patch Detail
Show a patch.
GET /api/patches/12887/?format=api
{ "id": 12887, "url": "https://patchwork.libcamera.org/api/patches/12887/?format=api", "web_url": "https://patchwork.libcamera.org/patch/12887/", "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": "<20210709145825.2943443-5-naush@raspberrypi.com>", "date": "2021-07-09T14:58:21", "name": "[libcamera-devel,v6,4/8] ipa: raspberrypi: Add frame_length to DeviceStatus", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "83a7af068be355a0ed48c4aa8cdf15ba2ff75e22", "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/12887/mbox/", "series": [ { "id": 2223, "url": "https://patchwork.libcamera.org/api/series/2223/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2223", "date": "2021-07-09T14:58:17", "name": "ipa: raspberrypi: Allow long exposure modes for imx477.", "version": 6, "mbox": "https://patchwork.libcamera.org/series/2223/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/12887/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/12887/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 A0C69BD794\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 9 Jul 2021 14:58:35 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 40A946852D;\n\tFri, 9 Jul 2021 16:58:35 +0200 (CEST)", "from mail-wr1-x433.google.com (mail-wr1-x433.google.com\n\t[IPv6:2a00:1450:4864:20::433])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 55D2468524\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 9 Jul 2021 16:58:33 +0200 (CEST)", "by mail-wr1-x433.google.com with SMTP id l7so11608585wrv.7\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 09 Jul 2021 07:58:33 -0700 (PDT)", "from naush-laptop.pitowers.org\n\t([2a00:1098:3142:14:35c2:26d3:e217:4410])\n\tby smtp.gmail.com with ESMTPSA id\n\tc2sm1480995wrn.28.2021.07.09.07.58.32\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 09 Jul 2021 07:58:32 -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=\"ATsMNzSQ\"; 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=BaTL83jvOXSdWoI1dTPwX0aZv+Y/Ov8YWzEfe+v8ktE=;\n\tb=ATsMNzSQFs/3Rgm1Lb6oF2sQWQf1kfXNI9uenWUzEBdfp3sOdzhMY92Tl2NlFG26YV\n\tzHxJ4hmeqmdlkos9zmXPDrmZW5WZWPTLc5dXLdsqqqTu+/FXSD9AVJkNgR3Zx9wDr89B\n\tbETQMRMY6bivYcTLxZsLjAoTMnKNvkl/c2aIopX6swrKb3+ZIXFcQiV/6LAmEjeu4j/r\n\tyW9P/+eu95VubXfeTmRWuqqWh3V6JiXr5Bn/LNGZP8fKjEiFpUpsNk0xl5wJhejAMUUw\n\t5JpbRNVE1oxFoM6V3T7CHLaoJ8Mt13iP76g1jqDgb+5AAQawtoafZ1ba2/IkS404ji6F\n\tW0ag==", "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=BaTL83jvOXSdWoI1dTPwX0aZv+Y/Ov8YWzEfe+v8ktE=;\n\tb=QIHrQqjtrgs2qCJnoHd3UgETUbAMd7rauv/1E7iZIiNZQUWKAI+gMElxHVJI+uKyff\n\td8o98ODQTmU2TZqn+5Rrt26ba50c7xR0c3nanBDFOD1mL7OlfYljiHe4N7QET8PZ3lqS\n\tScNPWlkaF3VdlzZ6o/nBkGzkvbtPHCrzFFce2hcdo1lD248jXx2w3lAU/N3ILOEDWTRI\n\txxvBZGYzxStPYA/3OkaFD4FhiAI0md48r8SdI/bP3mkpaP6BVGi9Ob44VFpTy1FkmzPk\n\trhVIRiWJYWax8kQOyrym8NA7jS673Z0uB2RylN4K8zxnA58bSu3v4hD7PJsOM6XN306+\n\tbaqA==", "X-Gm-Message-State": "AOAM530H9ObPb/oR09R4q3tG1RBQdzCC24bke7N7/kzaAPur4Tl2wqmv\n\t0BGu82Vb7gaMLMM/Jibb5kFLcyFQ5aD+9A==", "X-Google-Smtp-Source": "ABdhPJyo0V/FPlJymnxXWo6bidv96c0plXA5tRbrV7tM+tHpWe99j4SPt8PxY7dpF6xcTSpXxhyMmQ==", "X-Received": "by 2002:a05:6000:1843:: with SMTP id\n\tc3mr42964007wri.301.1625842712721; \n\tFri, 09 Jul 2021 07:58:32 -0700 (PDT)", "From": "Naushir Patuck <naush@raspberrypi.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Fri, 9 Jul 2021 15:58:21 +0100", "Message-Id": "<20210709145825.2943443-5-naush@raspberrypi.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20210709145825.2943443-1-naush@raspberrypi.com>", "References": "<20210709145825.2943443-1-naush@raspberrypi.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v6 4/8] ipa: raspberrypi: Add frame_length\n\tto 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": "Update the IPA to fill frame length into the DeviceStatus struct from the\nVBLANK Control value passed from DelayedControls.\n\nUpdate imx477 and imx219 CamHelper classes to extract the frame length from the\nembedded data buffer.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/ipa/raspberrypi/cam_helper.cpp | 1 +\n src/ipa/raspberrypi/cam_helper_imx219.cpp | 6 +++++-\n src/ipa/raspberrypi/cam_helper_imx477.cpp | 6 +++++-\n src/ipa/raspberrypi/controller/device_status.h | 5 ++++-\n src/ipa/raspberrypi/raspberrypi.cpp | 2 ++\n 5 files changed, 17 insertions(+), 3 deletions(-)", "diff": "diff --git a/src/ipa/raspberrypi/cam_helper.cpp b/src/ipa/raspberrypi/cam_helper.cpp\nindex 1ec3f03e1aa3..3c6afce7572b 100644\n--- a/src/ipa/raspberrypi/cam_helper.cpp\n+++ b/src/ipa/raspberrypi/cam_helper.cpp\n@@ -187,6 +187,7 @@ void CamHelper::parseEmbeddedData(Span<const uint8_t> buffer,\n \n \tdeviceStatus.shutter_speed = parsedDeviceStatus.shutter_speed;\n \tdeviceStatus.analogue_gain = parsedDeviceStatus.analogue_gain;\n+\tdeviceStatus.frame_length = parsedDeviceStatus.frame_length;\n \n \tLOG(IPARPI, Debug) << \"Metadata updated - \" << deviceStatus;\n \ndiff --git a/src/ipa/raspberrypi/cam_helper_imx219.cpp b/src/ipa/raspberrypi/cam_helper_imx219.cpp\nindex 4d68e01fce71..a3caab714602 100644\n--- a/src/ipa/raspberrypi/cam_helper_imx219.cpp\n+++ b/src/ipa/raspberrypi/cam_helper_imx219.cpp\n@@ -30,7 +30,10 @@ using namespace RPiController;\n constexpr uint32_t gainReg = 0x157;\n constexpr uint32_t expHiReg = 0x15a;\n constexpr uint32_t expLoReg = 0x15b;\n-constexpr std::initializer_list<uint32_t> registerList [[maybe_unused]] = { expHiReg, expLoReg, gainReg };\n+constexpr uint32_t frameLengthHiReg = 0x160;\n+constexpr uint32_t frameLengthLoReg = 0x161;\n+constexpr std::initializer_list<uint32_t> registerList [[maybe_unused]]\n+\t= { expHiReg, expLoReg, gainReg, frameLengthHiReg, frameLengthLoReg };\n \n class CamHelperImx219 : public CamHelper\n {\n@@ -93,6 +96,7 @@ void CamHelperImx219::PopulateMetadata(const MdParser::RegisterMap ®isters,\n \n \tdeviceStatus.shutter_speed = Exposure(registers.at(expHiReg) * 256 + registers.at(expLoReg));\n \tdeviceStatus.analogue_gain = Gain(registers.at(gainReg));\n+\tdeviceStatus.frame_length = registers.at(frameLengthHiReg) * 256 + registers.at(frameLengthLoReg);\n \n \tmetadata.Set(\"device.status\", deviceStatus);\n }\ndiff --git a/src/ipa/raspberrypi/cam_helper_imx477.cpp b/src/ipa/raspberrypi/cam_helper_imx477.cpp\nindex efd1a5893db8..91d05d9226ff 100644\n--- a/src/ipa/raspberrypi/cam_helper_imx477.cpp\n+++ b/src/ipa/raspberrypi/cam_helper_imx477.cpp\n@@ -23,7 +23,10 @@ constexpr uint32_t expHiReg = 0x0202;\n constexpr uint32_t expLoReg = 0x0203;\n constexpr uint32_t gainHiReg = 0x0204;\n constexpr uint32_t gainLoReg = 0x0205;\n-constexpr std::initializer_list<uint32_t> registerList = { expHiReg, expLoReg, gainHiReg, gainLoReg };\n+constexpr uint32_t frameLengthHiReg = 0x0340;\n+constexpr uint32_t frameLengthLoReg = 0x0341;\n+constexpr std::initializer_list<uint32_t> registerList =\n+\t{ expHiReg, expLoReg, gainHiReg, gainLoReg, frameLengthHiReg, frameLengthLoReg };\n \n class CamHelperImx477 : public CamHelper\n {\n@@ -81,6 +84,7 @@ void CamHelperImx477::PopulateMetadata(const MdParser::RegisterMap ®isters,\n \n \tdeviceStatus.shutter_speed = Exposure(registers.at(expHiReg) * 256 + registers.at(expLoReg));\n \tdeviceStatus.analogue_gain = Gain(registers.at(gainHiReg) * 256 + registers.at(gainLoReg));\n+\tdeviceStatus.frame_length = registers.at(frameLengthHiReg) * 256 + registers.at(frameLengthLoReg);\n \n \tmetadata.Set(\"device.status\", deviceStatus);\n }\ndiff --git a/src/ipa/raspberrypi/controller/device_status.h b/src/ipa/raspberrypi/controller/device_status.h\nindex e2511d19b96d..7bb8852375bd 100644\n--- a/src/ipa/raspberrypi/controller/device_status.h\n+++ b/src/ipa/raspberrypi/controller/device_status.h\n@@ -17,7 +17,7 @@\n \n struct DeviceStatus {\n \tDeviceStatus()\n-\t\t: shutter_speed(std::chrono::seconds(0)), analogue_gain(0.0),\n+\t\t: shutter_speed(std::chrono::seconds(0)), frame_length(0), analogue_gain(0.0),\n \t\t lens_position(0.0), aperture(0.0), flash_intensity(0.0)\n \t{\n \t}\n@@ -28,6 +28,7 @@ struct DeviceStatus {\n \n \t\tout << \"Exposure: \" << d.shutter_speed\n \t\t << \" Gain: \" << d.analogue_gain\n+\t\t << \" Frame Length: \" << d.frame_length\n \t\t << \" Aperture: \" << d.aperture\n \t\t << \" Lens: \" << d.lens_position\n \t\t << \" Flash: \" << d.flash_intensity;\n@@ -37,6 +38,8 @@ struct DeviceStatus {\n \n \t/* time shutter is open */\n \tlibcamera::utils::Duration shutter_speed;\n+\t/* frame length given in number of lines */\n+\tuint32_t frame_length;\n \tdouble analogue_gain;\n \t/* 1.0/distance-in-metres, or 0 if unknown */\n \tdouble lens_position;\ndiff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex f51c970befb5..db103a885b7a 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -1015,9 +1015,11 @@ void IPARPi::fillDeviceStatus(const ControlList &sensorControls)\n \n \tint32_t exposureLines = sensorControls.get(V4L2_CID_EXPOSURE).get<int32_t>();\n \tint32_t gainCode = sensorControls.get(V4L2_CID_ANALOGUE_GAIN).get<int32_t>();\n+\tint32_t vblank = sensorControls.get(V4L2_CID_VBLANK).get<int32_t>();\n \n \tdeviceStatus.shutter_speed = helper_->Exposure(exposureLines);\n \tdeviceStatus.analogue_gain = helper_->Gain(gainCode);\n+\tdeviceStatus.frame_length = mode_.height + vblank;\n \n \tLOG(IPARPI, Debug) << \"Metadata - \" << deviceStatus;\n \n", "prefixes": [ "libcamera-devel", "v6", "4/8" ] }