{"id":11778,"url":"https://patchwork.libcamera.org/api/1.1/patches/11778/?format=json","web_url":"https://patchwork.libcamera.org/patch/11778/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/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":"<20210329191826.77817-4-jeanmichel.hautbois@ideasonboard.com>","date":"2021-03-29T19:18:24","name":"[libcamera-devel,v3,3/5] ipa: ipu3: Use a local parameter object and prepare for 3A algorithms","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"b01286c7f065dc793df54e39de287cf40bf5014f","submitter":{"id":75,"url":"https://patchwork.libcamera.org/api/1.1/people/75/?format=json","name":"Jean-Michel Hautbois","email":"jeanmichel.hautbois@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/11778/mbox/","series":[{"id":1865,"url":"https://patchwork.libcamera.org/api/1.1/series/1865/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1865","date":"2021-03-29T19:18:21","name":"Implement IPA algorithms and demo with IPU3","version":3,"mbox":"https://patchwork.libcamera.org/series/1865/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/11778/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/11778/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 A1099C32F0\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 29 Mar 2021 19:18:41 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 55F3C6878D;\n\tMon, 29 Mar 2021 21:18:41 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 64B1A6877D\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Mar 2021 21:18:36 +0200 (CEST)","from localhost.localdomain (unknown\n\t[IPv6:2a01:e0a:169:7140:9714:da21:50fd:f63f])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id F261AA49;\n\tMon, 29 Mar 2021 21:18:35 +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=\"NJ0jCwGc\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1617045516;\n\tbh=qc9pD4A5hjZO2xSNHx4vTYsDKsqv2di52PIgpw102DM=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=NJ0jCwGcgfPiqmZ7gguILvyedtCwym3EoNRoqVaFQpSIx/chL8DeeobMGRcpKTSHx\n\t6v21xe9Wghhhts2PgyI8FNdLoGpApU+4086sM9T/sSInAMwT1QZOSYKx5Ax3azeRRb\n\tx/E3foAYzSrraFy1ie9DuxgYr3xmdM1E7qMgx4wI=","From":"Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Mon, 29 Mar 2021 21:18:24 +0200","Message-Id":"<20210329191826.77817-4-jeanmichel.hautbois@ideasonboard.com>","X-Mailer":"git-send-email 2.27.0","In-Reply-To":"<20210329191826.77817-1-jeanmichel.hautbois@ideasonboard.com>","References":"<20210329191826.77817-1-jeanmichel.hautbois@ideasonboard.com>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v3 3/5] ipa: ipu3: Use a local parameter\n\tobject and prepare for 3A algorithms","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>","Content-Type":"text/plain; charset=\"us-ascii\"","Content-Transfer-Encoding":"7bit","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"The IPA will locally modify the parameters before they are passed down\nto the imgU. Use a local parameter object to give a reference to those\nalgorithms.\n\nAGC algorithm calculates a brightness level at min and max\nexposure/gains.\nStarting at the minimum value for both of them shortens the time to\nconverge (as the first frames will already have the correct level).\n\nSigned-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>\n---\n src/ipa/ipu3/ipu3.cpp    | 11 +++++++++--\n src/ipa/ipu3/meson.build |  6 +++++-\n 2 files changed, 14 insertions(+), 3 deletions(-)","diff":"diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\nindex 34a907f2..07dbc24a 100644\n--- a/src/ipa/ipu3/ipu3.cpp\n+++ b/src/ipa/ipu3/ipu3.cpp\n@@ -61,6 +61,9 @@ private:\n \tuint32_t gain_;\n \tuint32_t minGain_;\n \tuint32_t maxGain_;\n+\n+\t/* Local parameter storage */\n+\tipu3_uapi_params params_;\n };\n \n int IPAIPU3::start()\n@@ -92,11 +95,15 @@ void IPAIPU3::configure(const std::map<uint32_t, ControlInfoMap> &entityControls\n \n \tminExposure_ = std::max(itExp->second.min().get<int32_t>(), 1);\n \tmaxExposure_ = itExp->second.max().get<int32_t>();\n-\texposure_ = maxExposure_;\n+\texposure_ = minExposure_;\n \n \tminGain_ = std::max(itGain->second.min().get<int32_t>(), 1);\n \tmaxGain_ = itGain->second.max().get<int32_t>();\n-\tgain_ = maxGain_;\n+\tgain_ = minGain_;\n+\n+\tparams_ = {};\n+\n+\tsetControls(0);\n }\n \n void IPAIPU3::mapBuffers(const std::vector<IPABuffer> &buffers)\ndiff --git a/src/ipa/ipu3/meson.build b/src/ipa/ipu3/meson.build\nindex a241f617..52d98c8e 100644\n--- a/src/ipa/ipu3/meson.build\n+++ b/src/ipa/ipu3/meson.build\n@@ -2,8 +2,12 @@\n \n ipa_name = 'ipa_ipu3'\n \n+ipu3_ipa_sources = files([\n+  'ipu3.cpp',\n+])\n+\n mod = shared_module(ipa_name,\n-                    ['ipu3.cpp', libcamera_generated_ipa_headers],\n+                    [ipu3_ipa_sources, libcamera_generated_ipa_headers],\n                     name_prefix : '',\n                     include_directories : [ipa_includes, libipa_includes],\n                     dependencies : libcamera_dep,\n","prefixes":["libcamera-devel","v3","3/5"]}