Patch Detail
Show a patch.
GET /api/1.1/patches/12515/?format=api
{ "id": 12515, "url": "https://patchwork.libcamera.org/api/1.1/patches/12515/?format=api", "web_url": "https://patchwork.libcamera.org/patch/12515/", "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": "<20210608110335.4078551-4-naush@raspberrypi.com>", "date": "2021-06-08T11:03:34", "name": "[libcamera-devel,v6,3/4] ipa: raspberrypi: Switch AgcAlgorithm API to use utils::Duration", "commit_ref": "2db8a767ca2c1a06658716e762b2fa8b4c005983", "pull_url": null, "state": "accepted", "archived": false, "hash": "04407be2bcd65a82f8220aa2a35ebfafada7aed0", "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/12515/mbox/", "series": [ { "id": 2110, "url": "https://patchwork.libcamera.org/api/1.1/series/2110/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2110", "date": "2021-06-08T11:03:31", "name": "Switch RaspberryPi IPA to use std::chrono::duration", "version": 6, "mbox": "https://patchwork.libcamera.org/series/2110/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/12515/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/12515/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 45F3BBD22E\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 8 Jun 2021 11:03:44 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id F2EEB68930;\n\tTue, 8 Jun 2021 13:03:43 +0200 (CEST)", "from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com\n\t[IPv6:2a00:1450:4864:20::32e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 0C7586892E\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 8 Jun 2021 13:03:42 +0200 (CEST)", "by mail-wm1-x32e.google.com with SMTP id\n\tl11-20020a05600c4f0bb029017a7cd488f5so1591063wmq.0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 08 Jun 2021 04:03:42 -0700 (PDT)", "from naush-laptop.pitowers.org\n\t([2a00:1098:3142:14:5aef:f665:51b0:d8c0])\n\tby smtp.gmail.com with ESMTPSA id\n\to129sm2639350wmo.22.2021.06.08.04.03.40\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 08 Jun 2021 04:03:41 -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=\"pK0SKqnl\"; 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=fdrC8KEhavjfv2hqPb4hbHb8dTYssUbrYPASaoaD9ks=;\n\tb=pK0SKqnlMaXubRXJ/EvUJnbYN39g4pHcc2nkBOrMYLz3anynuYd5wznnAUZUKHnGlr\n\tEj8eWogJTGCZr/fDKPetH10hZQ126XpgiD9Cfq2uvNy5Bwj9G5QCpkdpl4yzZC4yxCg4\n\tf8HjiKCnNAxRZSyWi241yfDcrrd+vyu0tW1abyqcII8qO80l4BgemqBUXI1GuYFYubp/\n\tW4ejXllNA0rtMae5CKCzIoW/mhX8x06868+yng5FzK+N9/gHmB0QUIxq5MTaTYBpoVvN\n\tqSFHODUGsI6/vqwJUd7FPjDPFsVgjnvWj6wBiKNykE4ry3Nq8Skh2yt8HUBkbeUlLqQa\n\tRczQ==", "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=fdrC8KEhavjfv2hqPb4hbHb8dTYssUbrYPASaoaD9ks=;\n\tb=S1L1Ic7WFv1df6WDZIPtbhw81RK9JwuKaWOsrJslsYehtc2i3WHqybxsMZcfczxGHC\n\teEMEGyohvPoJkC5e1gNBpQMXDX7MejWkA9rHc9y+2PvnGjIMV1OaPRLlQJLyw/WXOAmX\n\t4Twt5D3WBU370+qjsIHe74Cvolk0C2q/OtpkGEepa/UTd/oOUq/AD1k2rjofJQ7N+w44\n\tjgGblSTaQlyd4mrJ69S8jSq0WiYlAW5GXyIAjboQKZvzzfIwk2o08Y8MEjb2ylKdM0Hv\n\t9qyUhU/tbb70zuU9O7evFLgFde/dOdrfWW41oZC8+jFLTbdgN7Z4vqz9GtfDAegFd1Am\n\taV9g==", "X-Gm-Message-State": "AOAM531CFz4CAe/o+59DhLKsuRfS9Pe61HuANPWwruB059J3GJFzwJXG\n\tJFmD8IVm7PkyZ7qkrRmi1VGuqDRGXZGwOw==", "X-Google-Smtp-Source": "ABdhPJxw2yF6qFBpgMzw3YRvW/O5Ix+IBEk5trWaExYMoAAxY1Dhk7aWt7RgNap2khdbTWF9/j3iuw==", "X-Received": "by 2002:a7b:c414:: with SMTP id\n\tk20mr21717777wmi.90.1623150221378; \n\tTue, 08 Jun 2021 04:03:41 -0700 (PDT)", "From": "Naushir Patuck <naush@raspberrypi.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 8 Jun 2021 12:03:34 +0100", "Message-Id": "<20210608110335.4078551-4-naush@raspberrypi.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20210608110335.4078551-1-naush@raspberrypi.com>", "References": "<20210608110335.4078551-1-naush@raspberrypi.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v6 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>\nReviewed-by: Jacopo Mondi <jacopo@jmondi.org>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/ipa/raspberrypi/controller/agc_algorithm.hpp | 7 ++++---\n src/ipa/raspberrypi/controller/rpi/agc.cpp | 13 +++++++------\n src/ipa/raspberrypi/controller/rpi/agc.hpp | 6 +++---\n src/ipa/raspberrypi/raspberrypi.cpp | 6 +++---\n 4 files changed, 17 insertions(+), 15 deletions(-)", "diff": "diff --git a/src/ipa/raspberrypi/controller/agc_algorithm.hpp b/src/ipa/raspberrypi/controller/agc_algorithm.hpp\nindex f97deb0fca59..134bbcda50ce 100644\n--- a/src/ipa/raspberrypi/controller/agc_algorithm.hpp\n+++ b/src/ipa/raspberrypi/controller/agc_algorithm.hpp\n@@ -6,6 +6,7 @@\n */\n #pragma once\n \n+#include \"libcamera/internal/utils.h\"\n #include \"algorithm.hpp\"\n \n namespace RPiController {\n@@ -17,9 +18,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(libcamera::utils::Duration flicker_period) = 0;\n+\tvirtual void SetFixedShutter(libcamera::utils::Duration fixed_shutter) = 0;\n+\tvirtual void SetMaxShutter(libcamera::utils::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..fd3359a77958 100644\n--- a/src/ipa/raspberrypi/controller/rpi/agc.cpp\n+++ b/src/ipa/raspberrypi/controller/rpi/agc.cpp\n@@ -21,6 +21,7 @@\n \n using namespace RPiController;\n using namespace libcamera;\n+using libcamera::utils::Duration;\n \n LOG_DEFINE_CATEGORY(RPiAgc)\n \n@@ -222,19 +223,19 @@ void Agc::SetEv(double ev)\n \tev_ = ev;\n }\n \n-void Agc::SetFlickerPeriod(double flicker_period)\n+void Agc::SetFlickerPeriod(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(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(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..b52aaa23d51c 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(libcamera::utils::Duration flicker_period) override;\n+\tvoid SetMaxShutter(libcamera::utils::Duration max_shutter) override;\n+\tvoid SetFixedShutter(libcamera::utils::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 33b316b90d16..4aa8ccaa985a 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -638,8 +638,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@@ -1091,7 +1091,7 @@ void IPARPi::applyFrameDurations(Duration minFrameDuration, Duration maxFrameDur\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", "v6", "3/4" ] }