{"id":14760,"url":"https://patchwork.libcamera.org/api/patches/14760/?format=json","web_url":"https://patchwork.libcamera.org/patch/14760/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20211124134019.110765-12-jeanmichel.hautbois@ideasonboard.com>","date":"2021-11-24T13:40:19","name":"[libcamera-devel,v4,11/11] ipa: rkisp1: agc: Introduce prepare call","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"9904f0ce3ada171969c9d4d26ffc5f5cac952b4c","submitter":{"id":75,"url":"https://patchwork.libcamera.org/api/people/75/?format=json","name":"Jean-Michel Hautbois","email":"jeanmichel.hautbois@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/14760/mbox/","series":[{"id":2751,"url":"https://patchwork.libcamera.org/api/series/2751/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=2751","date":"2021-11-24T13:40:08","name":"Introduce AGC for RkISP1","version":4,"mbox":"https://patchwork.libcamera.org/series/2751/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/14760/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/14760/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 187BEC3250\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 24 Nov 2021 13:40:38 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9737060394;\n\tWed, 24 Nov 2021 14:40:37 +0100 (CET)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 499F4603BE\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 24 Nov 2021 14:40:25 +0100 (CET)","from tatooine.ideasonboard.com (unknown\n\t[IPv6:2a01:e0a:169:7140:968b:bd0c:97fc:7c17])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D0E2190E;\n\tWed, 24 Nov 2021 14:40:24 +0100 (CET)"],"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=\"LTlMvoLL\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1637761224;\n\tbh=5Crdsyz3SjtVysgJUqaTefvgYfb5Gx+AOkK3zgUmOn4=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=LTlMvoLLQ4eIWOeGYrHLq+wOeXSmPnPP+/iEBh3eA+LuzAmHqlBbP5vBw8u8VxN7J\n\t6ojYLLLX+II6ic0Zjp1ns0BdRYtktvw73Ig4LITB5aNXVSC4BXH0g9fqnsFi0o/8WN\n\txJOJnNYiwlBvK94K44ydJuY5w3xVCYImsWmsXQoQ=","From":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Wed, 24 Nov 2021 14:40:19 +0100","Message-Id":"<20211124134019.110765-12-jeanmichel.hautbois@ideasonboard.com>","X-Mailer":"git-send-email 2.32.0","In-Reply-To":"<20211124134019.110765-1-jeanmichel.hautbois@ideasonboard.com>","References":"<20211124134019.110765-1-jeanmichel.hautbois@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [PATCH v4 11/11] ipa: rkisp1: agc: Introduce\n\tprepare call","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":"When a new parameter buffer needs to be queued, we need to specify which\nalgorithm is activated or not in the ISP. Add a simple prepare function\nin AGC for that, which may later evolve to take the exposure locking\ninto account. For that function to be called, we also need to add the\nloop on the algorithms in IPARkISP1::queueRequest.\n\nWe no longer disable the AE algorithm based on the controls::AeEnable,\nwhich will be handled in a different manner later.\n\nSigned-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/ipa/rkisp1/algorithms/agc.cpp |  7 +++++++\n src/ipa/rkisp1/algorithms/agc.h   |  1 +\n src/ipa/rkisp1/rkisp1.cpp         | 12 +++---------\n 3 files changed, 11 insertions(+), 9 deletions(-)","diff":"diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp\nindex 84ff8c7a..4827b9ac 100644\n--- a/src/ipa/rkisp1/algorithms/agc.cpp\n+++ b/src/ipa/rkisp1/algorithms/agc.cpp\n@@ -274,6 +274,13 @@ void Agc::process(IPAContext &context, const rkisp1_stat_buffer *stats)\n \tframeCount_++;\n }\n \n+void Agc::prepare([[maybe_unused]] IPAContext &context,\n+\t\t  rkisp1_params_cfg *params)\n+{\n+\tparams->module_ens |= RKISP1_CIF_ISP_MODULE_AEC;\n+\tparams->module_en_update |= RKISP1_CIF_ISP_MODULE_AEC;\n+}\n+\n } /* namespace ipa::rkisp1::algorithms */\n \n } /* namespace libcamera */\ndiff --git a/src/ipa/rkisp1/algorithms/agc.h b/src/ipa/rkisp1/algorithms/agc.h\nindex a59ae9c8..279d21b6 100644\n--- a/src/ipa/rkisp1/algorithms/agc.h\n+++ b/src/ipa/rkisp1/algorithms/agc.h\n@@ -27,6 +27,7 @@ public:\n \t~Agc() = default;\n \n \tint configure(IPAContext &context, const IPACameraSensorInfo &configInfo) override;\n+\tvoid prepare(IPAContext &context, rkisp1_params_cfg *params) override;\n \tvoid process(IPAContext &context, const rkisp1_stat_buffer *stats) override;\n \n private:\ndiff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\nindex 5c0a0330..539f10af 100644\n--- a/src/ipa/rkisp1/rkisp1.cpp\n+++ b/src/ipa/rkisp1/rkisp1.cpp\n@@ -274,19 +274,13 @@ void IPARkISP1::processEvent(const RkISP1Event &event)\n }\n \n void IPARkISP1::queueRequest(unsigned int frame, rkisp1_params_cfg *params,\n-\t\t\t     const ControlList &controls)\n+\t\t\t     [[maybe_unused]] const ControlList &controls)\n {\n \t/* Prepare parameters buffer. */\n \tmemset(params, 0, sizeof(*params));\n \n-\t/* Auto Exposure on/off. */\n-\tif (controls.contains(controls::AeEnable)) {\n-\t\tautoExposure_ = controls.get(controls::AeEnable);\n-\t\tif (autoExposure_)\n-\t\t\tparams->module_ens = RKISP1_CIF_ISP_MODULE_AEC;\n-\n-\t\tparams->module_en_update = RKISP1_CIF_ISP_MODULE_AEC;\n-\t}\n+\tfor (auto const &algo : algorithms_)\n+\t\talgo->prepare(context_, params);\n \n \tRkISP1Action op;\n \top.op = ActionParamFilled;\n","prefixes":["libcamera-devel","v4","11/11"]}