Patch Detail
Show a patch.
GET /api/1.1/patches/13345/?format=api
{ "id": 13345, "url": "https://patchwork.libcamera.org/api/1.1/patches/13345/?format=api", "web_url": "https://patchwork.libcamera.org/patch/13345/", "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": "<20210813142218.3521879-1-kieran.bingham@ideasonboard.com>", "date": "2021-08-13T14:22:18", "name": "[libcamera-devel,IPU3-IPA] ipu3: Initialise controls in the IPA", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "85de0c1bf0d5d9851c816c5fcc0d90ed8e00697f", "submitter": { "id": 4, "url": "https://patchwork.libcamera.org/api/1.1/people/4/?format=api", "name": "Kieran Bingham", "email": "kieran.bingham@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/13345/mbox/", "series": [ { "id": 2354, "url": "https://patchwork.libcamera.org/api/1.1/series/2354/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2354", "date": "2021-08-13T14:22:18", "name": "[libcamera-devel,IPU3-IPA] ipu3: Initialise controls in the IPA", "version": 1, "mbox": "https://patchwork.libcamera.org/series/2354/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/13345/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/13345/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 09D31BD87D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 13 Aug 2021 14:22:24 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 705026888F;\n\tFri, 13 Aug 2021 16:22:23 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 38A55687FA\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 13 Aug 2021 16:22:22 +0200 (CEST)", "from Monstersaurus.local\n\t(cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id B18744A1;\n\tFri, 13 Aug 2021 16:22:21 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"pdfeh2vR\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1628864541;\n\tbh=c7ty28wy/4DNIlvEGy+9CZKXQR5YjZ/JFqxmFfu8bfQ=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=pdfeh2vRwWbQs1GiZ9QQFSmFyW7Gl8u9JNKocL2kJ4uVhTKFC52hIwy1IhSdAfMjs\n\t+qkgsBdhqPiwKPGUJ5peKwO2U3SDPsftDHd285oLaNk5qbt7k1aL3jF0yOoCIBdpiM\n\thwr9wKBiPGsDfyfP59hju7XxXt/E5i1tHLcuI0kI=", "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>", "To": "libcamera devel <libcamera-devel@lists.libcamera.org>", "Date": "Fri, 13 Aug 2021 15:22:18 +0100", "Message-Id": "<20210813142218.3521879-1-kieran.bingham@ideasonboard.com>", "X-Mailer": "git-send-email 2.30.2", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [IPU3-IPA PATCH] ipu3: Initialise controls in the\n\tIPA", "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": "In commit 11fe4333c54d (\"libcamera: ipu3: Initialize controls in the\nIPA\") the interface for the IPA was updated and the creation of exposure\nand frame duration controls are now the responsibility of the IPA.\n\nIn libcamera, the code that creates these controls was moved to the\nintegrated IPA for the IPU3.\n\nDuplicate the implementation here.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n ipu3.cpp | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--\n 1 file changed, 56 insertions(+), 2 deletions(-)", "diff": "diff --git a/ipu3.cpp b/ipu3.cpp\nindex b8015af20454..3e89e6dd4e02 100644\n--- a/ipu3.cpp\n+++ b/ipu3.cpp\n@@ -36,7 +36,10 @@ namespace ipa::ipu3 {\n class IPAIPU3 : public IPAIPU3Interface\n {\n public:\n-\tint init(const IPASettings &settings) override;\n+\tint init(const IPASettings &settings,\n+\t\t const IPACameraSensorInfo &sensorInfo,\n+\t\t const ControlInfoMap &sensorControls,\n+\t\t ControlInfoMap *ipaControls) override;\n \n \tint start() override;\n \tvoid stop() override {}\n@@ -83,7 +86,10 @@ private:\n \tBinaryData aiqd_;\n };\n \n-int IPAIPU3::init(const IPASettings &settings)\n+int IPAIPU3::init(const IPASettings &settings,\n+\t\t const IPACameraSensorInfo &sensorInfo,\n+\t\t const ControlInfoMap &sensorControls,\n+\t\t ControlInfoMap *ipaControls)\n {\n \tint ret;\n \n@@ -135,6 +141,54 @@ int IPAIPU3::init(const IPASettings &settings)\n \n \taiqInputParams_.init();\n \n+\t/* Initialize Controls. */\n+\tControlInfoMap::Map controls{};\n+\n+\t/*\n+\t * Compute exposure time limits.\n+\t *\n+\t * Initialize the control using the line length and pixel rate of the\n+\t * current configuration converted to microseconds. Use the\n+\t * V4L2_CID_EXPOSURE control to get exposure min, max and default and\n+\t * convert it from lines to microseconds.\n+\t */\n+\tdouble lineDuration = sensorInfo.lineLength / (sensorInfo.pixelRate / 1e6);\n+\tconst ControlInfo &v4l2Exposure = sensorControls.find(V4L2_CID_EXPOSURE)->second;\n+\tint32_t minExposure = v4l2Exposure.min().get<int32_t>() * lineDuration;\n+\tint32_t maxExposure = v4l2Exposure.max().get<int32_t>() * lineDuration;\n+\tint32_t defExposure = v4l2Exposure.def().get<int32_t>() * lineDuration;\n+\tcontrols[&controls::ExposureTime] = ControlInfo(minExposure, maxExposure,\n+\t\t\t\t\t\t\tdefExposure);\n+\n+\t/*\n+\t * Compute the frame duration limits.\n+\t *\n+\t * The frame length is computed assuming a fixed line length combined\n+\t * with the vertical frame sizes.\n+\t */\n+\tconst ControlInfo &v4l2HBlank = sensorControls.find(V4L2_CID_HBLANK)->second;\n+\tuint32_t hblank = v4l2HBlank.def().get<int32_t>();\n+\tuint32_t lineLength = sensorInfo.outputSize.width + hblank;\n+\n+\tconst ControlInfo &v4l2VBlank = sensorControls.find(V4L2_CID_VBLANK)->second;\n+\tstd::array<uint32_t, 3> frameHeights{\n+\t\tv4l2VBlank.min().get<int32_t>() + sensorInfo.outputSize.height,\n+\t\tv4l2VBlank.max().get<int32_t>() + sensorInfo.outputSize.height,\n+\t\tv4l2VBlank.def().get<int32_t>() + sensorInfo.outputSize.height,\n+\t};\n+\n+\tstd::array<int64_t, 3> frameDurations;\n+\tfor (unsigned int i = 0; i < frameHeights.size(); ++i) {\n+\t\tuint64_t frameSize = lineLength * frameHeights[i];\n+\t\tframeDurations[i] = frameSize / (sensorInfo.pixelRate / 1000000U);\n+\t}\n+\n+\tcontrols[&controls::FrameDurationLimits] = ControlInfo(frameDurations[0],\n+\t\t\t\t\t\t\t frameDurations[1],\n+\t\t\t\t\t\t\t frameDurations[2]);\n+\n+\t*ipaControls = ControlInfoMap(std::move(controls), controls::controls);\n+\n \treturn 0;\n }\n \n", "prefixes": [ "libcamera-devel", "IPU3-IPA" ] }