{"id":15988,"url":"https://patchwork.libcamera.org/api/patches/15988/?format=json","web_url":"https://patchwork.libcamera.org/patch/15988/","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":"<20220519141642.1043792-1-kieran.bingham@ideasonboard.com>","date":"2022-05-19T14:16:42","name":"[libcamera-devel,RFC] ipa: ipu3: Retain request controls in the IPA","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"a230c8806fe02cb3809595fb39f6cf69d9352298","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/?format=json","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"delegate":{"id":11,"url":"https://patchwork.libcamera.org/api/users/11/?format=json","username":"kbingham","first_name":"Kieran","last_name":"Bingham","email":"kieran.bingham@ideasonboard.com"},"mbox":"https://patchwork.libcamera.org/patch/15988/mbox/","series":[{"id":3128,"url":"https://patchwork.libcamera.org/api/series/3128/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=3128","date":"2022-05-19T14:16:42","name":"[libcamera-devel,RFC] ipa: ipu3: Retain request controls in the IPA","version":1,"mbox":"https://patchwork.libcamera.org/series/3128/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/15988/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/15988/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 9F577C3256\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 19 May 2022 14:16:30 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id C7C9065665;\n\tThu, 19 May 2022 16:16:29 +0200 (CEST)","from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 069DE60420\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 19 May 2022 16:16:28 +0200 (CEST)","from localhost.localdomain (unknown [45.131.31.124])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 49EA99DA;\n\tThu, 19 May 2022 16:16:27 +0200 (CEST)"],"DKIM-Signature":["v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1652969789;\n\tbh=T7QFH4KcPrGBti7IvATH8DZXW9DkbCRecgilCkkUgHg=;\n\th=To:Date:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post:\n\tList-Help:List-Subscribe:From:Reply-To:From;\n\tb=Be2/3viSWOy4+CLlHE3217dqqFk10onv8wQRyVPW1FufSgmN7rHqrVjXKeLD6N422\n\tyNiQDQPOJDsJCRwNW3Graude379Ii7QySaN5C3hkCRraLAmbnHlvEGVC0j0/cwCuG2\n\tulORUeK+RzR85+N7Hi1vUbXzWe5Mb6D6n8KzXmLiPz3rFmIX2Q1iXuXpCFje8ZCXWj\n\tZhTEGEZv8DKgVBLFOltdi57+UOF1KiYisgQMiUiHZ7CAy1MUjmz7NBQeeX1T4rJDFW\n\t3PPzIDdTIOKZiGi5eKns7iupL8f0B+l5VWxsn0E9ce+cOYe4Buufls67fSXBxlMRoa\n\tOYzGnjZVG2u6w==","v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1652969787;\n\tbh=T7QFH4KcPrGBti7IvATH8DZXW9DkbCRecgilCkkUgHg=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=ePSAcWuHDKeugsRN8Jp5YtQrA9h1TKbpLSxjFeUB7M/H41K0d9mz+QPRIugXMgYuO\n\tgTaDEGdcm19OdvUlUXCqhdX3DWKD97OycQe7Ig2UwB/JJBdgEKwtA5hXaGXan+jI+1\n\tCRHRf9zLD2OeAHyVpLgmAl+C7+mk3jAOXLMF8Y54="],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"ePSAcWuH\"; dkim-atps=neutral","To":"libcamera devel <libcamera-devel@lists.libcamera.org>","Date":"Thu, 19 May 2022 16:16:42 +0200","Message-Id":"<20220519141642.1043792-1-kieran.bingham@ideasonboard.com>","X-Mailer":"git-send-email 2.25.1","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","Subject":"[libcamera-devel] [RFC PATCH] ipa: ipu3: Retain request controls in\n\tthe IPA","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>","From":"Kieran Bingham via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>","Reply-To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Errors-To":"libcamera-devel-bounces@lists.libcamera.org","Sender":"\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>"},"content":"To ensure consistency in processing control lists, an application does\nnot have to continually set controls that were already set, but not\nexpected to change.\n\nTo ensure we keep that state, merge incoming request control lists with\na stored ControlList that is owned by the IPA and store the state of\nthat merged list to the per frame FrameContext so that algorithms know\nthe full expected control state at that time.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n---\n\nRFC:\n\n1)\n\nIf ControlList.update() were implemented like .merge, but with\noverriding existing values, instead of leaving them then this could be\nsimplified to :\n\n+\tretainedControls_.update(controls);\n+\tcontext_.frameContexts[frame % kMaxFrameContexts] = { frame, std::copy(retainedControls_) };\n\nNot yet sure if that's more efficient or if it doesn't make much\ndifference.\n\n2)\n\nThis will not support triggered controls that are set once to\n'fire'... Do we have / plan to have any of those?\n\n3)\n\nDo we want to keep both a delta control list (the incoming controls) as\nwell as the merged/retained list for full state so IPA's can know if\nsomething was changed?\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/ipa/ipu3/ipu3.cpp | 23 ++++++++++++++++++++++-\n 1 file changed, 22 insertions(+), 1 deletion(-)","diff":"diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp\nindex 2f6bb672f7bb..89fc34f86e46 100644\n--- a/src/ipa/ipu3/ipu3.cpp\n+++ b/src/ipa/ipu3/ipu3.cpp\n@@ -176,6 +176,9 @@ private:\n \n \t/* Local parameter storage */\n \tstruct IPAContext context_;\n+\n+\t/* Control retention to maintain mode states */\n+\tControlList retainedControls_;\n };\n \n /**\n@@ -456,6 +459,8 @@ int IPAIPU3::configure(const IPAConfigInfo &configInfo,\n \n \t/* Clean IPAActiveState at each reconfiguration. */\n \tcontext_.activeState = {};\n+\tretainedControls_.clear();\n+\n \tIPAFrameContext initFrameContext;\n \tcontext_.frameContexts.fill(initFrameContext);\n \n@@ -617,8 +622,24 @@ void IPAIPU3::processStatsBuffer(const uint32_t frame,\n  */\n void IPAIPU3::queueRequest(const uint32_t frame, const ControlList &controls)\n {\n+\t/*\n+\t * Controls are retained, to ensure any mode updates are persistant.\n+\t * We merge them into our class control storage before assigning to\n+\t * the frame context.\n+\t *\n+\t * \\todo This will not support trigger controls and may need rework if\n+\t *\t we add any to prevent continually retriggering.\n+\t *\n+\t * \\todo We may wish to store both the full merged control list, as well\n+\t *\t as the delta (\\a controls) to facilitate algorithms identifying\n+\t *\t when things have changed.\n+\t */\n+\tControlList mergeControls = controls;\n+\tmergeControls.merge(retainedControls_);\n+\tretainedControls_ = mergeControls;\n+\n \t/* \\todo Start processing for 'frame' based on 'controls'. */\n-\tcontext_.frameContexts[frame % kMaxFrameContexts] = { frame, controls };\n+\tcontext_.frameContexts[frame % kMaxFrameContexts] = { frame, std::move(mergeControls) };\n }\n \n /**\n","prefixes":["libcamera-devel","RFC"]}