Patch Detail
Show a patch.
GET /api/1.1/patches/12376/?format=api
{ "id": 12376, "url": "https://patchwork.libcamera.org/api/1.1/patches/12376/?format=api", "web_url": "https://patchwork.libcamera.org/patch/12376/", "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": "<20210524084822.3690690-4-naush@raspberrypi.com>", "date": "2021-05-24T08:48:21", "name": "[libcamera-devel,v4,3/4] ipa: raspberrypi: Switch AgcAlgorithm API to use utils::Duration", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "c7596289966317af51db4f686ab94d082bcd9688", "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/12376/mbox/", "series": [ { "id": 2052, "url": "https://patchwork.libcamera.org/api/1.1/series/2052/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2052", "date": "2021-05-24T08:48:18", "name": "Switch RaspberryPi IPA to use std::chrono::duration", "version": 4, "mbox": "https://patchwork.libcamera.org/series/2052/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/12376/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/12376/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 9AD82C3201\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 24 May 2021 08:48:35 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 447D068925;\n\tMon, 24 May 2021 10:48:35 +0200 (CEST)", "from mail-wm1-x329.google.com (mail-wm1-x329.google.com\n\t[IPv6:2a00:1450:4864:20::329])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 078B868922\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 24 May 2021 10:48:31 +0200 (CEST)", "by mail-wm1-x329.google.com with SMTP id\n\tn17-20020a7bc5d10000b0290169edfadac9so1165192wmk.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 24 May 2021 01:48:31 -0700 (PDT)", "from naush-laptop.pitowers.org\n\t([2a00:1098:3142:14:4bf6:b415:2edf:916a])\n\tby smtp.gmail.com with ESMTPSA id\n\tx10sm11275767wrt.65.2021.05.24.01.48.30\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 24 May 2021 01:48:30 -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=\"FggvbYo5\"; 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=l9Rhxy7l9fwAKZj9Q2e2L0sQKBLDPV0pSpzK9+xure4=;\n\tb=FggvbYo5vNgpZhNiHyHziAEj/kZW+spVvfl6xdnURLEJpH4xEDHvETEAWFbMWgxKk0\n\tZecRitYQX8Xnt5s+dpPqPp7G5DMPZ5HveyEUirg4hmmjvzyYo8/9DklWVvdQIjlbQSsL\n\tpRqqbVb0/0ScouT4bt6//+faFy911isUmooTywXBlJuXJOoLV7zVZw1KP27wX8PBID9p\n\thMvEhgerUG9iMM7ATSOmlzl5Qz3BU9S6vL9Wre+BOYpjUEUxirQlewKBVc+oLuGD0sl1\n\tPfybxNtNNYK+nNljlFEM6U96tOYkyoEXYI1w2V7Q32duCvhVA+E77Qh3e+diDVZ8qcok\n\tTrBQ==", "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=l9Rhxy7l9fwAKZj9Q2e2L0sQKBLDPV0pSpzK9+xure4=;\n\tb=WpHtPCtBaRoFpTy33gv4hv22QjPW+0oPBWMHENv927y9T6IvGPIQxpq7iBxMIRx5np\n\tD3+R9zQ3HTJl/x2p3/XoI6XkCaDN8mWfnmoXCUErBfnNRbZ8D1B42BBfF51Pg6kAPSrv\n\tKTkDLdUSTTinJVszrLoaJfU/8F5SY/scKHnk26677+quC5YZ5ui6MmvU/1KlD61Ee5Bl\n\tHHvEzpN6k38RFn/S1ch7NXv8G5ZVHEZZwOoj6NwQwkfxYPs3iiTRq9X/qK/+welGbyld\n\tEfWpwIuJYlVdwzpaEsoD3g6QSTLrUjvE66FkQ5MJwEf9HYmb6hyjVorpsVq5w9sSHqGU\n\t7U2w==", "X-Gm-Message-State": "AOAM5300bwM+FKhx6xjuQ1todnf5Tt+XklSQmnOhOXA+wZKIdRoFA92I\n\tXK2tGY3X207ElfUGFXuPXeC3YqzVPv2q0Q==", "X-Google-Smtp-Source": "ABdhPJzLczBsuChYCBbMsI6BvX0XA0zBDAIL9SbTa5CpCjQatuPVNfY5tmeD7MQ0vll5CMvwAH/fhQ==", "X-Received": "by 2002:a05:600c:2054:: with SMTP id\n\tp20mr19390493wmg.165.1621846110474; \n\tMon, 24 May 2021 01:48:30 -0700 (PDT)", "From": "Naushir Patuck <naush@raspberrypi.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 24 May 2021 09:48:21 +0100", "Message-Id": "<20210524084822.3690690-4-naush@raspberrypi.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20210524084822.3690690-1-naush@raspberrypi.com>", "References": "<20210524084822.3690690-1-naush@raspberrypi.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v4 3/4] ipa: raspberrypi: Switch\n\tAgcAlgorithm API to use utils::Duration", "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": "Switch the AgcAlgorithm API functions to use utils::Duration for all\ntime based variables.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReviewed-by: David Plowman <david.plowman@raspberrypi.com>\n---\n src/ipa/raspberrypi/controller/agc_algorithm.hpp | 9 ++++++---\n src/ipa/raspberrypi/controller/rpi/agc.cpp | 12 ++++++------\n src/ipa/raspberrypi/controller/rpi/agc.hpp | 6 +++---\n src/ipa/raspberrypi/raspberrypi.cpp | 6 +++---\n 4 files changed, 18 insertions(+), 15 deletions(-)", "diff": "diff --git a/src/ipa/raspberrypi/controller/agc_algorithm.hpp b/src/ipa/raspberrypi/controller/agc_algorithm.hpp\nindex f97deb0fca59..dabb814ea3dd 100644\n--- a/src/ipa/raspberrypi/controller/agc_algorithm.hpp\n+++ b/src/ipa/raspberrypi/controller/agc_algorithm.hpp\n@@ -6,10 +6,13 @@\n */\n #pragma once\n \n+#include \"libcamera/internal/utils.h\"\n #include \"algorithm.hpp\"\n \n namespace RPiController {\n \n+using libcamera::utils::Duration;\n+\n class AgcAlgorithm : public Algorithm\n {\n public:\n@@ -17,9 +20,9 @@ public:\n \t// An AGC algorithm must provide the following:\n \tvirtual unsigned int GetConvergenceFrames() const = 0;\n \tvirtual void SetEv(double ev) = 0;\n-\tvirtual void SetFlickerPeriod(double flicker_period) = 0;\n-\tvirtual void SetFixedShutter(double fixed_shutter) = 0; // microseconds\n-\tvirtual void SetMaxShutter(double max_shutter) = 0; // microseconds\n+\tvirtual void SetFlickerPeriod(const Duration &flicker_period) = 0;\n+\tvirtual void SetFixedShutter(const Duration &fixed_shutter) = 0;\n+\tvirtual void SetMaxShutter(const Duration &max_shutter) = 0;\n \tvirtual void SetFixedAnalogueGain(double fixed_analogue_gain) = 0;\n \tvirtual void SetMeteringMode(std::string const &metering_mode_name) = 0;\n \tvirtual void SetExposureMode(std::string const &exposure_mode_name) = 0;\ndiff --git a/src/ipa/raspberrypi/controller/rpi/agc.cpp b/src/ipa/raspberrypi/controller/rpi/agc.cpp\nindex f4cd5d26fb4e..482eb3ef962d 100644\n--- a/src/ipa/raspberrypi/controller/rpi/agc.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/agc.cpp\n@@ -222,19 +222,19 @@ void Agc::SetEv(double ev)\n \tev_ = ev;\n }\n \n-void Agc::SetFlickerPeriod(double flicker_period)\n+void Agc::SetFlickerPeriod(const Duration &flicker_period)\n {\n-\tflicker_period_ = flicker_period;\n+\tflicker_period_ = flicker_period.get<std::micro>();\n }\n \n-void Agc::SetMaxShutter(double max_shutter)\n+void Agc::SetMaxShutter(const Duration &max_shutter)\n {\n-\tmax_shutter_ = max_shutter;\n+\tmax_shutter_ = max_shutter.get<std::micro>();\n }\n \n-void Agc::SetFixedShutter(double fixed_shutter)\n+void Agc::SetFixedShutter(const Duration &fixed_shutter)\n {\n-\tfixed_shutter_ = fixed_shutter;\n+\tfixed_shutter_ = fixed_shutter.get<std::micro>();\n \t// Set this in case someone calls Pause() straight after.\n \tstatus_.shutter_time = clipShutter(fixed_shutter_);\n }\ndiff --git a/src/ipa/raspberrypi/controller/rpi/agc.hpp b/src/ipa/raspberrypi/controller/rpi/agc.hpp\nindex 0427fb59ec1b..16a65959d90e 100644\n--- a/src/ipa/raspberrypi/controller/rpi/agc.hpp\n+++ b/src/ipa/raspberrypi/controller/rpi/agc.hpp\n@@ -77,9 +77,9 @@ public:\n \tvoid Resume() override;\n \tunsigned int GetConvergenceFrames() const override;\n \tvoid SetEv(double ev) override;\n-\tvoid SetFlickerPeriod(double flicker_period) override;\n-\tvoid SetMaxShutter(double max_shutter) override; // microseconds\n-\tvoid SetFixedShutter(double fixed_shutter) override; // microseconds\n+\tvoid SetFlickerPeriod(const Duration &flicker_period) override;\n+\tvoid SetMaxShutter(const Duration &max_shutter) override;\n+\tvoid SetFixedShutter(const Duration &fixed_shutter) override;\n \tvoid SetFixedAnalogueGain(double fixed_analogue_gain) override;\n \tvoid SetMeteringMode(std::string const &metering_mode_name) override;\n \tvoid SetExposureMode(std::string const &exposure_mode_name) override;\ndiff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex 4e02e94084f7..e083f6c254cc 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -640,8 +640,8 @@ void IPARPi::queueRequest(const ControlList &controls)\n \t\t\t\tbreak;\n \t\t\t}\n \n-\t\t\t/* This expects units of micro-seconds. */\n-\t\t\tagc->SetFixedShutter(ctrl.second.get<int32_t>());\n+\t\t\t/* The control provides units of microseconds. */\n+\t\t\tagc->SetFixedShutter(ctrl.second.get<int32_t>() * 1.0us);\n \n \t\t\tlibcameraMetadata_.set(controls::ExposureTime, ctrl.second.get<int32_t>());\n \t\t\tbreak;\n@@ -1094,7 +1094,7 @@ void IPARPi::applyFrameDurations(const Duration &minFrameDuration,\n \n \tRPiController::AgcAlgorithm *agc = dynamic_cast<RPiController::AgcAlgorithm *>(\n \t\tcontroller_.GetAlgorithm(\"agc\"));\n-\tagc->SetMaxShutter(maxShutter.get<std::micro>());\n+\tagc->SetMaxShutter(maxShutter);\n }\n \n void IPARPi::applyAGC(const struct AgcStatus *agcStatus, ControlList &ctrls)\n", "prefixes": [ "libcamera-devel", "v4", "3/4" ] }