From patchwork Fri Jun 3 13:22:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 16138 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id AA7E2C3256 for ; Fri, 3 Jun 2022 13:23:08 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id F019F65639; Fri, 3 Jun 2022 15:23:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1654262588; bh=vzOxlCkU1d8zf16gF6O0d6hz2qGWA70wddX4Y8mdK54=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=F3wYiOx5ukRq2GAVfcJtxUJ8uxWvXYuye+DgyqvFwzL7ZnXiNROyFDlOcWTupXQ4H oExrW+t5JuvmHh/vwEI7kqO6D9Sedpv9DQicDZWdazI0yW1zcd2mweHroVzNI2DlQM dbo7KPwyBFeXkigMcKq0HJkff+UaM4Vo6cXYarKb+nT0hdWl5dRFK9SYw4HLjhCXSw Ah/cb7OY8ZCvV8EhBiNdIfMvVLQKzqcgbS5zNlzfi6MDy/1lfcrmbKzt3Kr4Wvqd+B Ie5ttIXoR7Ik3Wiu1lHdiTAe14pWERO7q6AC21vwqJvDyj/yY65fNhv2gWtB/S8E03 scScmKmn/2l3g== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 4368360105 for ; Fri, 3 Jun 2022 15:23:05 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="vk9bYQvw"; dkim-atps=neutral Received: from perceval.ideasonboard.com (static-127-186-62-95.ipcom.comunitel.net [95.62.186.127]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id C750710DD; Fri, 3 Jun 2022 15:23:04 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1654262585; bh=vzOxlCkU1d8zf16gF6O0d6hz2qGWA70wddX4Y8mdK54=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vk9bYQvwRvqvlOok8v2WiYH+VSNbjmY5zo6ZqX3/z8JdQ/k8714uhNEytZJf2gmac t76f+fL15REQqEJkbb0fZ38L/2RGgNafWAPcQoGBP92N2wuoeeJ4eZPMLUSubPP/Cg qh1DF7De6qAwb0PkXT0wym7guukZ8zapSd9QKcko= To: libcamera-devel@lists.libcamera.org Date: Fri, 3 Jun 2022 15:22:56 +0200 Message-Id: <20220603132259.188845-2-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220603132259.188845-1-umang.jain@ideasonboard.com> References: <20220603132259.188845-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1 1/4] ipa: ipu3: Separate out frame context queue as a distinct class X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Umang Jain via libcamera-devel From: Umang Jain Reply-To: Umang Jain Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" There are cases where we need more checks and balance to be carried out by the frame context queue class. For that, separate it out as a distinct class on which we can build upon. For now, a minimialistic implementation is provided with .get(frame) helper which returns a IPAFrameContext pointer for the required frame. Going ahead more such helpers can be provided to access/modify the frame context queue. Signed-off-by: Umang Jain Reviewed-by: Paul Elder Reviewed-by: Jean-Michel Hautbois --- src/ipa/ipu3/ipa_context.cpp | 57 ++++++++++++++++++++++++++++++++++-- src/ipa/ipu3/ipa_context.h | 11 ++++++- src/ipa/ipu3/ipu3.cpp | 18 ++++++------ 3 files changed, 74 insertions(+), 12 deletions(-) diff --git a/src/ipa/ipu3/ipa_context.cpp b/src/ipa/ipu3/ipa_context.cpp index 13cdb835..9f95a61c 100644 --- a/src/ipa/ipu3/ipa_context.cpp +++ b/src/ipa/ipu3/ipa_context.cpp @@ -7,12 +7,18 @@ #include "ipa_context.h" +#include + /** * \file ipa_context.h * \brief Context and state information shared between the algorithms */ -namespace libcamera::ipa::ipu3 { +namespace libcamera { + +LOG_DECLARE_CATEGORY(IPAIPU3) + +namespace ipa::ipu3 { /** * \struct IPASessionConfiguration @@ -211,4 +217,51 @@ IPAFrameContext::IPAFrameContext(uint32_t id, const ControlList &reqControls) * \brief Analogue gain multiplier */ -} /* namespace libcamera::ipa::ipu3 */ +/** + * \class FCQueue + * \brief A FIFO circular queue holding IPAFrameContext(s) + * + * FCQueue holds all the IPAFrameContext(s) related to frames required + * to be processed by the IPA at a given point. + */ + +/** + * \brief FCQueue constructor + */ +FCQueue::FCQueue() +{ + clear(); +} + +/** + * \brief Retrieve the IPAFrameContext for the frame + * \param[in] frame Frame number for which the IPAFrameContext needs to + * retrieved + * + * \return Pointer to the IPAFrameContext + */ +IPAFrameContext *FCQueue::get(uint32_t frame) +{ + IPAFrameContext &frameContext = this->at(frame % kMaxFrameContexts); + + if (frame != frameContext.frame) { + LOG(IPAIPU3, Warning) + << "Got wrong frame context for frame" << frame + << " or frame context doesn't exist yet"; + } + + return &frameContext; +} + +/** + * \brief Clear the FCQueue by resetting all the entries in the ring-buffer + */ +void FCQueue::clear() +{ + IPAFrameContext initFrameContext; + this->fill(initFrameContext); +} + +} /* namespace ipa::ipu3 */ + +} /* namespace libcamera */ diff --git a/src/ipa/ipu3/ipa_context.h b/src/ipa/ipu3/ipa_context.h index 42e11141..56d281f6 100644 --- a/src/ipa/ipu3/ipa_context.h +++ b/src/ipa/ipu3/ipa_context.h @@ -89,11 +89,20 @@ struct IPAFrameContext { ControlList frameControls; }; +class FCQueue : public std::array +{ +public: + FCQueue(); + + void clear(); + IPAFrameContext *get(uint32_t frame); +}; + struct IPAContext { IPASessionConfiguration configuration; IPAActiveState activeState; - std::array frameContexts; + FCQueue frameContexts; }; } /* namespace ipa::ipu3 */ diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp index 2f6bb672..0843d882 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -456,8 +456,8 @@ int IPAIPU3::configure(const IPAConfigInfo &configInfo, /* Clean IPAActiveState at each reconfiguration. */ context_.activeState = {}; - IPAFrameContext initFrameContext; - context_.frameContexts.fill(initFrameContext); + context_.frameContexts.clear(); + if (!validateSensorControls()) { LOG(IPAIPU3, Error) << "Sensor control validation failed."; @@ -569,20 +569,20 @@ void IPAIPU3::processStatsBuffer(const uint32_t frame, const ipu3_uapi_stats_3a *stats = reinterpret_cast(mem.data()); - IPAFrameContext &frameContext = context_.frameContexts[frame % kMaxFrameContexts]; + IPAFrameContext *frameContext = context_.frameContexts.get(frame); - if (frameContext.frame != frame) + if (frameContext->frame != frame) LOG(IPAIPU3, Warning) << "Frame " << frame << " does not match its frame context"; - frameContext.sensor.exposure = sensorControls.get(V4L2_CID_EXPOSURE).get(); - frameContext.sensor.gain = camHelper_->gain(sensorControls.get(V4L2_CID_ANALOGUE_GAIN).get()); + frameContext->sensor.exposure = sensorControls.get(V4L2_CID_EXPOSURE).get(); + frameContext->sensor.gain = camHelper_->gain(sensorControls.get(V4L2_CID_ANALOGUE_GAIN).get()); double lineDuration = context_.configuration.sensor.lineDuration.get(); int32_t vBlank = context_.configuration.sensor.defVBlank; ControlList ctrls(controls::controls); for (auto const &algo : algorithms_) - algo->process(context_, &frameContext, stats); + algo->process(context_, frameContext, stats); setControls(frame); @@ -590,11 +590,11 @@ void IPAIPU3::processStatsBuffer(const uint32_t frame, int64_t frameDuration = (vBlank + sensorInfo_.outputSize.height) * lineDuration; ctrls.set(controls::FrameDuration, frameDuration); - ctrls.set(controls::AnalogueGain, frameContext.sensor.gain); + ctrls.set(controls::AnalogueGain, frameContext->sensor.gain); ctrls.set(controls::ColourTemperature, context_.activeState.awb.temperatureK); - ctrls.set(controls::ExposureTime, frameContext.sensor.exposure * lineDuration); + ctrls.set(controls::ExposureTime, frameContext->sensor.exposure * lineDuration); /* * \todo The Metadata provides a path to getting extended data From patchwork Fri Jun 3 13:22:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 16139 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id BC8FEC326D for ; Fri, 3 Jun 2022 13:23:09 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 8E05860105; Fri, 3 Jun 2022 15:23:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1654262588; bh=+VLfXU/12xLb9bTzefRzNmnud605OTY0ljKOxSSuNbE=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=EfET7njHoLNEipLZ/47AGQICu9Wi6QTh974sxt3enJ68K4DM+R5gKxUHALZ+N1VWa EW3A7/v+a8cq7kRhb4H91/RLOEWsKDfaXK/ZKNgZPa5Sog0esUgYC5ht8U9BNlYNmY aeFiBsdFTWy+G1AHFJgnh+fpOYUc9aQsKPW6Fu0kctiaoQbvHLMDDEE0I6oiT3tkWD avoc0TwSsnKCDlLqGRuTp1hKBQ+GErkWtNGZYx1aPiAPwjDoqCEhztKZ4UT2jD/sVz NKH14rjnCZr9ZzauS1Z8QZiq6ZsClYTlcgrBOJ3OQWl3mPeZUK0sTxV/oL9qPdpaNu aa2diHnn+2P4Q== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6FC8A6040E for ; Fri, 3 Jun 2022 15:23:06 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="ozbrhxRg"; dkim-atps=neutral Received: from perceval.ideasonboard.com (static-127-186-62-95.ipcom.comunitel.net [95.62.186.127]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 08FDD10DD; Fri, 3 Jun 2022 15:23:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1654262586; bh=+VLfXU/12xLb9bTzefRzNmnud605OTY0ljKOxSSuNbE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ozbrhxRgsnWfGRr0JDxUsuSXgj5u8afCxPAJQIcVNxRH0JWCXWUNA344UbVLsCvOv CG/2Dzz5P9KbeRwcK8JrAJbizhrH9VWroAEdIXsTMbihQuLAb3psSrzVDPCB3FBqrL 4YIRmM2SDKyoCapFlimyzq379asW4b2ZNc8ZCeqI= To: libcamera-devel@lists.libcamera.org Date: Fri, 3 Jun 2022 15:22:57 +0200 Message-Id: <20220603132259.188845-3-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220603132259.188845-1-umang.jain@ideasonboard.com> References: <20220603132259.188845-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1 2/4] ipa: ipu3: ipa_context: Extend FCQueue::get() X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Umang Jain via libcamera-devel From: Umang Jain Reply-To: Umang Jain Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Extend the FCQueue::get() to return a IPAFrameContext for a non-existent frame. The .get() should be able to figure out if a existent frame context is asked for, or to create a new frame context based on the next available position. To keep track of next available position in the queue, use of head and tail pointer are used. We specifically want to have access to the queue through the .get() function hence operator[] is deleted for FCQueue as part of this patch as well. Signed-off-by: Umang Jain --- src/ipa/ipu3/ipa_context.cpp | 95 +++++++++++++++++++++++++++++++++--- src/ipa/ipu3/ipa_context.h | 9 ++++ src/ipa/ipu3/ipu3.cpp | 4 +- 3 files changed, 100 insertions(+), 8 deletions(-) diff --git a/src/ipa/ipu3/ipa_context.cpp b/src/ipa/ipu3/ipa_context.cpp index 9f95a61c..2438d68d 100644 --- a/src/ipa/ipu3/ipa_context.cpp +++ b/src/ipa/ipu3/ipa_context.cpp @@ -222,13 +222,33 @@ IPAFrameContext::IPAFrameContext(uint32_t id, const ControlList &reqControls) * \brief A FIFO circular queue holding IPAFrameContext(s) * * FCQueue holds all the IPAFrameContext(s) related to frames required - * to be processed by the IPA at a given point. + * to be processed by the IPA at a given point. An IPAFrameContext is created + * on the first call FCQueue::get(frame) for that frame. Subsequent calls to + * FCQueue::get() with the same frame number shall return the IPAFrameContext + * previously created until the frame is marked as complete through + * FCQueue::completeFrame(frame). + */ + +/** + * \var FCQueue::head_ + * \brief A pointer to the a IPAFrameContext next expected to complete + */ + +/** + * \var FCQueue::tail_ + * \brief A pointer to the latest IPAFrameContext created + */ + +/** + * \var FCQueue::isFull_ + * \brief Flag set when the FCQueue is full */ /** * \brief FCQueue constructor */ FCQueue::FCQueue() + : head_(nullptr), tail_(nullptr), isFull_(false) { clear(); } @@ -238,21 +258,75 @@ FCQueue::FCQueue() * \param[in] frame Frame number for which the IPAFrameContext needs to * retrieved * - * \return Pointer to the IPAFrameContext + * This function returns the IPAFrameContext for the desired frame. If the + * frame context does not exist in the queue, the next available slot in the + * queue is returned. It is the responsibility of the caller to fill the correct + * IPAFrameContext parameters of newly returned IPAFrameContext. + * + * \return Pointer to the IPAFrameContext or nullptr if frame context couldn't + * be created */ IPAFrameContext *FCQueue::get(uint32_t frame) { - IPAFrameContext &frameContext = this->at(frame % kMaxFrameContexts); + if (frame <= tail_->frame) { + IPAFrameContext &frameContext = this->at(frame % kMaxFrameContexts); + if (frame != frameContext.frame) + LOG(IPAIPU3, Warning) + << "Got wrong frame context for frame " << frame; + + return &frameContext; + } else { + if (isFull_) { + LOG(IPAIPU3, Warning) + << "Cannot create frame context for frame " << frame + << " since FCQueue is full"; + + return nullptr; + } + + /* + * Frame context doesn't exist yet so get the next available + * position in the queue. + */ + tail_ = &this->at((tail_->frame + 1) % kMaxFrameContexts); + tail_->frame = frame; + + /* Check if the queue is full to avoid over-queueing later */ + if (tail_->frame - head_->frame >= kMaxFrameContexts - 1) + isFull_ = true; - if (frame != frameContext.frame) { + return tail_; + } +} + +/** + * \brief Notifies the FCQueue that a frame has been completed + * \param[in] frame The completed frame number + */ +void FCQueue::completeFrame(uint32_t frame) +{ + if (head_->frame != frame) LOG(IPAIPU3, Warning) - << "Got wrong frame context for frame" << frame - << " or frame context doesn't exist yet"; + << "Frame " << frame << " completed out-of-sync?"; + + if (frame > tail_->frame) { + LOG(IPAIPU3, Error) + << "Completing a frame " << frame + << " not present in the queue is disallowed"; + return; } - return &frameContext; + head_ = this->get(frame + 1); + + if (isFull_) + isFull_ = false; } +/** + * \fn FCQueue::isFull() + * \brief Checks whether the frame context queue is full + */ + /** * \brief Clear the FCQueue by resetting all the entries in the ring-buffer */ @@ -260,6 +334,13 @@ void FCQueue::clear() { IPAFrameContext initFrameContext; this->fill(initFrameContext); + + isFull_ = false; + + /* Intialise 0th index to frame 0 */ + this->at(0).frame = 0; + tail_ = &this->at(0); + head_ = tail_; } } /* namespace ipa::ipu3 */ diff --git a/src/ipa/ipu3/ipa_context.h b/src/ipa/ipu3/ipa_context.h index 56d281f6..475855da 100644 --- a/src/ipa/ipu3/ipa_context.h +++ b/src/ipa/ipu3/ipa_context.h @@ -93,9 +93,18 @@ class FCQueue : public std::array { public: FCQueue(); + FCQueue &operator[](const FCQueue &) = delete; void clear(); + void completeFrame(uint32_t frame); IPAFrameContext *get(uint32_t frame); + bool isFull() { return isFull_; } + +private: + IPAFrameContext *head_; + IPAFrameContext *tail_; + + bool isFull_; }; struct IPAContext { diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp index 0843d882..1d6ee515 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -605,6 +605,8 @@ void IPAIPU3::processStatsBuffer(const uint32_t frame, */ metadataReady.emit(frame, ctrls); + + context_.frameContexts.completeFrame(frame); } /** @@ -618,7 +620,7 @@ void IPAIPU3::processStatsBuffer(const uint32_t frame, void IPAIPU3::queueRequest(const uint32_t frame, const ControlList &controls) { /* \todo Start processing for 'frame' based on 'controls'. */ - context_.frameContexts[frame % kMaxFrameContexts] = { frame, controls }; + *context_.frameContexts.get(frame) = { frame, controls }; } /** From patchwork Fri Jun 3 13:22:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 16140 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id 66F08C326E for ; Fri, 3 Jun 2022 13:23:10 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0FDFB6563B; Fri, 3 Jun 2022 15:23:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1654262590; bh=rkzOhxHUJ/ogiiZQc37sw1q9ERNpAiHJGLINDSyqm78=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=cU/OgmlSeu1rsW/lrpFVhf3j27njZkiMd6hlxxnjg+npejv1uzA9kDGTteLVZD1TE 0jzqaA6lWB2qMoZlvKw8/33fGMKvyk0SdMTEEaCm9T2q0jEWL/FmkGIqxSHK+ybiWe RlE3ajln6WLMKuTe1K1OMPl5sEfBwVjYNH2A15P81lHdGT27dSP4usIHRJlSUjoXS0 aL5UiR9J+qP8vGfuHNXa46apaAmHHbZW/dODNU6XEKNupsGmQpJKRg6wDEU6T884Mg I1vsL0ida3LOoM6FHuYkbhYcwTAiOMCociZMPMUw7V3PFtbe6FcPnXks6UHvQ3ygLn GVzeSheQ0/MKA== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 7037D60105 for ; Fri, 3 Jun 2022 15:23:07 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="nY64hAan"; dkim-atps=neutral Received: from perceval.ideasonboard.com (static-127-186-62-95.ipcom.comunitel.net [95.62.186.127]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 01B5810DD; Fri, 3 Jun 2022 15:23:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1654262587; bh=rkzOhxHUJ/ogiiZQc37sw1q9ERNpAiHJGLINDSyqm78=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nY64hAankXJXeU0mBAhGo8WWt4nMOSoA1unPBc9Epl9JX+cxm0yQ2GShsXDYHWaoT xa32VVKKRrJTq1mHFziYSnEaWKBGWUX55mhsHrhIv7SqWBesUmqyW+2SHkAqgHXieB b/AZeHHyaDWONA/fAa37rR2Ba/EHN8B9+UAC3v34= To: libcamera-devel@lists.libcamera.org Date: Fri, 3 Jun 2022 15:22:58 +0200 Message-Id: <20220603132259.188845-4-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220603132259.188845-1-umang.jain@ideasonboard.com> References: <20220603132259.188845-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1 3/4] ipa: ipu3: Prevent over queuing of requests X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Umang Jain via libcamera-devel From: Umang Jain Reply-To: Umang Jain Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The IPAIPU3 processes each IPAFrameContext present in the FCQueue ring buffer. If the application queues the requests at a pace where IPAFrameContext(s) can get potentially over-written without getting processed by the IPA, it would lead to un-desirable effects. Hence, inspect the FCQueue if it is full and reject any further queuing of requests. This requires changes to the IPAIPU3 mojom interface. The IPAIPU3::queueRequest() cannot be [async] anymore since we need to return a success/failure value. The rejection by the IPA doesn't mean it cannot be queued later. The request is still preserved in IPU3CameraData::pendingRequests_. It shall be queued sequentially on subsequent calls to IPU3CameraData::queuePendingRequests(). Signed-off-by: Umang Jain --- I am not super-happy with changing the interface and dropping [async] but this is what I've for now. Would appreciate any other ideas... --- include/libcamera/ipa/ipu3.mojom | 2 +- src/ipa/ipu3/ipu3.cpp | 11 +++++++++-- src/libcamera/pipeline/ipu3/ipu3.cpp | 10 +++++++++- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/include/libcamera/ipa/ipu3.mojom b/include/libcamera/ipa/ipu3.mojom index d1b1c6b8..3faffd9c 100644 --- a/include/libcamera/ipa/ipu3.mojom +++ b/include/libcamera/ipa/ipu3.mojom @@ -30,7 +30,7 @@ interface IPAIPU3Interface { mapBuffers(array buffers); unmapBuffers(array ids); - [async] queueRequest(uint32 frame, libcamera.ControlList controls); + queueRequest(uint32 frame, libcamera.ControlList controls) => (int32 ret); [async] fillParamsBuffer(uint32 frame, uint32 bufferId); [async] processStatsBuffer(uint32 frame, int64 frameTimestamp, uint32 bufferId, libcamera.ControlList sensorControls); diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp index 1d6ee515..63aa9b56 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -145,7 +145,7 @@ public: void mapBuffers(const std::vector &buffers) override; void unmapBuffers(const std::vector &ids) override; - void queueRequest(const uint32_t frame, const ControlList &controls) override; + int queueRequest(const uint32_t frame, const ControlList &controls) override; void fillParamsBuffer(const uint32_t frame, const uint32_t bufferId) override; void processStatsBuffer(const uint32_t frame, const int64_t frameTimestamp, const uint32_t bufferId, @@ -616,11 +616,18 @@ void IPAIPU3::processStatsBuffer(const uint32_t frame, * * Parse the request to handle any IPA-managed controls that were set from the * application such as manual sensor settings. + * + * \return 0 if successful, -EPERM otherwise. */ -void IPAIPU3::queueRequest(const uint32_t frame, const ControlList &controls) +int IPAIPU3::queueRequest(const uint32_t frame, const ControlList &controls) { + if (context_.frameContexts.isFull()) + return -EPERM; + /* \todo Start processing for 'frame' based on 'controls'. */ *context_.frameContexts.get(frame) = { frame, controls }; + + return 0; } /** diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp index fd989e61..d69e28d4 100644 --- a/src/libcamera/pipeline/ipu3/ipu3.cpp +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp @@ -874,7 +874,15 @@ void IPU3CameraData::queuePendingRequests() info->rawBuffer = rawBuffer; - ipa_->queueRequest(info->id, request->controls()); + /* + * Queueing request to the IPA can fail in cases like over-flowing + * its queue. Hence, keep the request preserved in pendingRequests_ + * if a failure occurs. + */ + if (ipa_->queueRequest(info->id, request->controls()) != 0) { + frameInfos_.remove(info); + break; + } pendingRequests_.pop(); processingRequests_.push(request); From patchwork Fri Jun 3 13:22:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 16141 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id CA62FBD160 for ; Fri, 3 Jun 2022 13:23:11 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7C35465643; Fri, 3 Jun 2022 15:23:11 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1654262591; bh=puTHWg7/2ymLbpmeqoS7ZDesw3mfgzg4V9arUFG5dn4=; h=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=YaSqfbK9cHIVLzX7sTXgMdt0+yHNSOBsyqYiZsH5XxCOH50IJ+opzww/qHObuqcwG ldK+iaJ1H+dQgWm/nQYOLYTbt+VzaDvtYFfg3Ws/j+R+J9ReANsX62U3S+bkBceQAM Q5X/jvFDF77dd60MaWLRWvp3Q5kxnzOo3AaOPF7LHD5lOND+GdEuRzlKB6KLiJCxSb 88YvCi2Cq6etVN2ydu3w2QNDYFLIQOTahvAXuaNkzxwKoc7mwIybnVugh10MJFZeWg t4WXb8vyf7YRj3/5l2Oz0aP3Qo2CU5omyNY2icEcWUCPgSbIenygZgeLXKM7F08i8t OPZcl9h94XkSw== Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 011506040E for ; Fri, 3 Jun 2022 15:23:09 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Si+xXqDf"; dkim-atps=neutral Received: from perceval.ideasonboard.com (static-127-186-62-95.ipcom.comunitel.net [95.62.186.127]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 487EA10DD; Fri, 3 Jun 2022 15:23:08 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1654262588; bh=puTHWg7/2ymLbpmeqoS7ZDesw3mfgzg4V9arUFG5dn4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Si+xXqDfX1rSKTxSEMGSCpXocIgXES0fJ60z/AWzL82KWjWxui4i2S05knrfkLj7n Y9DXuKgz/vzY5Msabaejfl2YwWNVGcHELgHKYI8EUgqfbQt5ZsOuTI5so4nNp4c18y deevYSUH3xThv/VKo7D2xdJQ9khCeNHK5NVksTXY= To: libcamera-devel@lists.libcamera.org Date: Fri, 3 Jun 2022 15:22:59 +0200 Message-Id: <20220603132259.188845-5-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20220603132259.188845-1-umang.jain@ideasonboard.com> References: <20220603132259.188845-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1 4/4] ipa: algorithm: process() should take in frame number instead of context X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Umang Jain via libcamera-devel From: Umang Jain Reply-To: Umang Jain Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" This will enable algorithms to extract a frame context from the FCQueue using the frame number. This is required because algorithms can operate on different frames at different points in time (according to frame latency they need to respect). Signed-off-by: Umang Jain Reviewed-by: Paul Elder Reviewed-by: Jean-Michel Hautbois --- src/ipa/ipu3/algorithms/af.cpp | 4 ++-- src/ipa/ipu3/algorithms/af.h | 2 +- src/ipa/ipu3/algorithms/agc.cpp | 13 +++++++------ src/ipa/ipu3/algorithms/agc.h | 4 ++-- src/ipa/ipu3/algorithms/algorithm.h | 4 ++-- src/ipa/ipu3/algorithms/awb.cpp | 2 +- src/ipa/ipu3/algorithms/awb.h | 2 +- src/ipa/ipu3/algorithms/tone_mapping.cpp | 4 ++-- src/ipa/ipu3/algorithms/tone_mapping.h | 2 +- src/ipa/ipu3/ipu3.cpp | 2 +- src/ipa/libipa/algorithm.cpp | 2 +- src/ipa/libipa/algorithm.h | 6 +++--- src/ipa/rkisp1/algorithms/agc.cpp | 3 +-- src/ipa/rkisp1/algorithms/agc.h | 2 +- src/ipa/rkisp1/algorithms/algorithm.h | 5 ++--- src/ipa/rkisp1/algorithms/awb.cpp | 2 +- src/ipa/rkisp1/algorithms/awb.h | 2 +- src/ipa/rkisp1/rkisp1.cpp | 2 +- 18 files changed, 31 insertions(+), 32 deletions(-) diff --git a/src/ipa/ipu3/algorithms/af.cpp b/src/ipa/ipu3/algorithms/af.cpp index d07521a0..228c2e81 100644 --- a/src/ipa/ipu3/algorithms/af.cpp +++ b/src/ipa/ipu3/algorithms/af.cpp @@ -406,7 +406,7 @@ bool Af::afIsOutOfFocus(IPAContext context) /** * \brief Determine the max contrast image and lens position. * \param[in] context The IPA context. - * \param[in] frameContext The current frame context + * \param[in] frame The frame number in consideration * \param[in] stats The statistics buffer of IPU3. * * Ideally, a clear image also has a relatively higher contrast. So, every @@ -420,7 +420,7 @@ bool Af::afIsOutOfFocus(IPAContext context) * * [1] Hill Climbing Algorithm, https://en.wikipedia.org/wiki/Hill_climbing */ -void Af::process(IPAContext &context, [[maybe_unused]] IPAFrameContext *frameContext, +void Af::process(IPAContext &context, [[maybe_unused]] uint32_t frame, const ipu3_uapi_stats_3a *stats) { /* Evaluate the AF buffer length */ diff --git a/src/ipa/ipu3/algorithms/af.h b/src/ipa/ipu3/algorithms/af.h index ccf015f3..69aeb3e2 100644 --- a/src/ipa/ipu3/algorithms/af.h +++ b/src/ipa/ipu3/algorithms/af.h @@ -32,7 +32,7 @@ public: void prepare(IPAContext &context, ipu3_uapi_params *params) override; int configure(IPAContext &context, const IPAConfigInfo &configInfo) override; - void process(IPAContext &context, IPAFrameContext *frameContext, + void process(IPAContext &context, uint32_t frame, const ipu3_uapi_stats_3a *stats) override; private: diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp index f16be534..3dc11fe2 100644 --- a/src/ipa/ipu3/algorithms/agc.cpp +++ b/src/ipa/ipu3/algorithms/agc.cpp @@ -180,14 +180,16 @@ utils::Duration Agc::filterExposure(utils::Duration exposureValue) /** * \brief Estimate the new exposure and gain values * \param[inout] frameContext The shared IPA frame Context + * \param [in] frame The frame number in consideration * \param[in] yGain The gain calculated based on the relative luminance target * \param[in] iqMeanGain The gain calculated based on the relative luminance target */ -void Agc::computeExposure(IPAContext &context, IPAFrameContext *frameContext, - double yGain, double iqMeanGain) +void Agc::computeExposure(IPAContext &context, uint32_t frame, double yGain, + double iqMeanGain) { const IPASessionConfiguration &configuration = context.configuration; /* Get the effective exposure and gain applied on the sensor. */ + IPAFrameContext *frameContext = context.frameContexts.get(frame); uint32_t exposure = frameContext->sensor.exposure; double analogueGain = frameContext->sensor.gain; @@ -317,14 +319,13 @@ double Agc::estimateLuminance(IPAActiveState &activeState, /** * \brief Process IPU3 statistics, and run AGC operations * \param[in] context The shared IPA context - * \param[in] frameContext The current frame context + * \param[in] frame The frame number in consideration * \param[in] stats The IPU3 statistics and ISP results * * Identify the current image brightness, and use that to estimate the optimal * new exposure and gain for the scene. */ -void Agc::process(IPAContext &context, [[maybe_unused]] IPAFrameContext *frameContext, - const ipu3_uapi_stats_3a *stats) +void Agc::process(IPAContext &context, uint32_t frame, const ipu3_uapi_stats_3a *stats) { /* * Estimate the gain needed to have the proportion of pixels in a given @@ -359,7 +360,7 @@ void Agc::process(IPAContext &context, [[maybe_unused]] IPAFrameContext *frameCo break; } - computeExposure(context, frameContext, yGain, iqMeanGain); + computeExposure(context, frame, yGain, iqMeanGain); frameCount_++; } diff --git a/src/ipa/ipu3/algorithms/agc.h b/src/ipa/ipu3/algorithms/agc.h index 105ae0f2..8ef2a2d8 100644 --- a/src/ipa/ipu3/algorithms/agc.h +++ b/src/ipa/ipu3/algorithms/agc.h @@ -28,14 +28,14 @@ public: ~Agc() = default; int configure(IPAContext &context, const IPAConfigInfo &configInfo) override; - void process(IPAContext &context, IPAFrameContext *frameContext, + void process(IPAContext &context, uint32_t frame, const ipu3_uapi_stats_3a *stats) override; private: double measureBrightness(const ipu3_uapi_stats_3a *stats, const ipu3_uapi_grid_config &grid) const; utils::Duration filterExposure(utils::Duration currentExposure); - void computeExposure(IPAContext &context, IPAFrameContext *frameContext, + void computeExposure(IPAContext &context, uint32_t frame, double yGain, double iqMeanGain); double estimateLuminance(IPAActiveState &activeState, const ipu3_uapi_grid_config &grid, diff --git a/src/ipa/ipu3/algorithms/algorithm.h b/src/ipa/ipu3/algorithms/algorithm.h index 234b2bd7..3e0c60d3 100644 --- a/src/ipa/ipu3/algorithms/algorithm.h +++ b/src/ipa/ipu3/algorithms/algorithm.h @@ -17,8 +17,8 @@ namespace libcamera { namespace ipa::ipu3 { -using Algorithm = libcamera::ipa::Algorithm; } /* namespace ipa::ipu3 */ diff --git a/src/ipa/ipu3/algorithms/awb.cpp b/src/ipa/ipu3/algorithms/awb.cpp index 5c232d92..35f35ebe 100644 --- a/src/ipa/ipu3/algorithms/awb.cpp +++ b/src/ipa/ipu3/algorithms/awb.cpp @@ -387,7 +387,7 @@ void Awb::calculateWBGains(const ipu3_uapi_stats_3a *stats) /** * \copydoc libcamera::ipa::Algorithm::process */ -void Awb::process(IPAContext &context, [[maybe_unused]] IPAFrameContext *frameContext, +void Awb::process(IPAContext &context, [[maybe_unused]] uint32_t frame, const ipu3_uapi_stats_3a *stats) { calculateWBGains(stats); diff --git a/src/ipa/ipu3/algorithms/awb.h b/src/ipa/ipu3/algorithms/awb.h index 9a50a985..f263540c 100644 --- a/src/ipa/ipu3/algorithms/awb.h +++ b/src/ipa/ipu3/algorithms/awb.h @@ -40,7 +40,7 @@ public: int configure(IPAContext &context, const IPAConfigInfo &configInfo) override; void prepare(IPAContext &context, ipu3_uapi_params *params) override; - void process(IPAContext &context, IPAFrameContext *frameContext, + void process(IPAContext &context, uint32_t frame, const ipu3_uapi_stats_3a *stats) override; private: diff --git a/src/ipa/ipu3/algorithms/tone_mapping.cpp b/src/ipa/ipu3/algorithms/tone_mapping.cpp index f86e79b2..6e4024cd 100644 --- a/src/ipa/ipu3/algorithms/tone_mapping.cpp +++ b/src/ipa/ipu3/algorithms/tone_mapping.cpp @@ -72,13 +72,13 @@ void ToneMapping::prepare([[maybe_unused]] IPAContext &context, /** * \brief Calculate the tone mapping look up table * \param context The shared IPA context - * \param frameContext The current frame context + * \param frame The frame number in consideration * \param stats The IPU3 statistics and ISP results * * The tone mapping look up table is generated as an inverse power curve from * our gamma setting. */ -void ToneMapping::process(IPAContext &context, [[maybe_unused]] IPAFrameContext *frameContext, +void ToneMapping::process(IPAContext &context, [[maybe_unused]] uint32_t frame, [[maybe_unused]] const ipu3_uapi_stats_3a *stats) { /* diff --git a/src/ipa/ipu3/algorithms/tone_mapping.h b/src/ipa/ipu3/algorithms/tone_mapping.h index d7d48006..61474085 100644 --- a/src/ipa/ipu3/algorithms/tone_mapping.h +++ b/src/ipa/ipu3/algorithms/tone_mapping.h @@ -20,7 +20,7 @@ public: int configure(IPAContext &context, const IPAConfigInfo &configInfo) override; void prepare(IPAContext &context, ipu3_uapi_params *params) override; - void process(IPAContext &context, IPAFrameContext *frameContext, + void process(IPAContext &context, uint32_t frame, const ipu3_uapi_stats_3a *stats) override; private: diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp index 63aa9b56..2c811b84 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -582,7 +582,7 @@ void IPAIPU3::processStatsBuffer(const uint32_t frame, ControlList ctrls(controls::controls); for (auto const &algo : algorithms_) - algo->process(context_, frameContext, stats); + algo->process(context_, frame, stats); setControls(frame); diff --git a/src/ipa/libipa/algorithm.cpp b/src/ipa/libipa/algorithm.cpp index cce2ed62..1b318b5d 100644 --- a/src/ipa/libipa/algorithm.cpp +++ b/src/ipa/libipa/algorithm.cpp @@ -64,7 +64,7 @@ namespace ipa { * \fn Algorithm::process() * \brief Process ISP statistics, and run algorithm operations * \param[in] context The shared IPA context - * \param[in] frameContext The current frame's context + * \param[in] frame The frame number in consideration * \param[in] stats The IPA statistics and ISP results * * This function is called while camera is running for every frame processed by diff --git a/src/ipa/libipa/algorithm.h b/src/ipa/libipa/algorithm.h index 032a05b5..d1ca0883 100644 --- a/src/ipa/libipa/algorithm.h +++ b/src/ipa/libipa/algorithm.h @@ -10,8 +10,8 @@ namespace libcamera { namespace ipa { -template +template + class Algorithm { public: @@ -29,7 +29,7 @@ public: } virtual void process([[maybe_unused]] Context &context, - [[maybe_unused]] FrameContext *frameContext, + [[maybe_unused]] uint32_t frame, [[maybe_unused]] const Stats *stats) { } diff --git a/src/ipa/rkisp1/algorithms/agc.cpp b/src/ipa/rkisp1/algorithms/agc.cpp index b5a184d9..9418b533 100644 --- a/src/ipa/rkisp1/algorithms/agc.cpp +++ b/src/ipa/rkisp1/algorithms/agc.cpp @@ -280,8 +280,7 @@ double Agc::measureBrightness(const rkisp1_cif_isp_hist_stat *hist) const * Identify the current image brightness, and use that to estimate the optimal * new exposure and gain for the scene. */ -void Agc::process(IPAContext &context, - [[maybe_unused]] IPAFrameContext *frameContext, +void Agc::process(IPAContext &context, [[maybe_unused]] uint32_t frame, const rkisp1_stat_buffer *stats) { const rkisp1_cif_isp_stat *params = &stats->params; diff --git a/src/ipa/rkisp1/algorithms/agc.h b/src/ipa/rkisp1/algorithms/agc.h index 22c02779..a749f1c3 100644 --- a/src/ipa/rkisp1/algorithms/agc.h +++ b/src/ipa/rkisp1/algorithms/agc.h @@ -29,7 +29,7 @@ public: int configure(IPAContext &context, const IPACameraSensorInfo &configInfo) override; void prepare(IPAContext &context, rkisp1_params_cfg *params) override; - void process(IPAContext &context, IPAFrameContext *frameContext, + void process(IPAContext &context, uint32_t frame, const rkisp1_stat_buffer *stats) override; private: diff --git a/src/ipa/rkisp1/algorithms/algorithm.h b/src/ipa/rkisp1/algorithms/algorithm.h index 68e3a44e..069c744c 100644 --- a/src/ipa/rkisp1/algorithms/algorithm.h +++ b/src/ipa/rkisp1/algorithms/algorithm.h @@ -19,9 +19,8 @@ namespace libcamera { namespace ipa::rkisp1 { -using Algorithm = libcamera::ipa::Algorithm; +using Algorithm = libcamera::ipa::Algorithm; } /* namespace ipa::rkisp1 */ diff --git a/src/ipa/rkisp1/algorithms/awb.cpp b/src/ipa/rkisp1/algorithms/awb.cpp index 88441382..1e7fd11a 100644 --- a/src/ipa/rkisp1/algorithms/awb.cpp +++ b/src/ipa/rkisp1/algorithms/awb.cpp @@ -120,7 +120,7 @@ void Awb::prepare(IPAContext &context, rkisp1_params_cfg *params) * \copydoc libcamera::ipa::Algorithm::process */ void Awb::process([[maybe_unused]] IPAContext &context, - [[maybe_unused]] IPAFrameContext *frameCtx, + [[maybe_unused]] uint32_t frame, const rkisp1_stat_buffer *stats) { const rkisp1_cif_isp_stat *params = &stats->params; diff --git a/src/ipa/rkisp1/algorithms/awb.h b/src/ipa/rkisp1/algorithms/awb.h index 7647842f..82921f34 100644 --- a/src/ipa/rkisp1/algorithms/awb.h +++ b/src/ipa/rkisp1/algorithms/awb.h @@ -23,7 +23,7 @@ public: int configure(IPAContext &context, const IPACameraSensorInfo &configInfo) override; void prepare(IPAContext &context, rkisp1_params_cfg *params) override; - void process(IPAContext &context, IPAFrameContext *frameCtx, + void process(IPAContext &context, uint32_t frame, const rkisp1_stat_buffer *stats) override; private: diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index 7d6f0b39..33a10dab 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -272,7 +272,7 @@ void IPARkISP1::processStatsBuffer(const uint32_t frame, const uint32_t bufferId unsigned int aeState = 0; for (auto const &algo : algorithms_) - algo->process(context_, nullptr, stats); + algo->process(context_, frame, stats); setControls(frame);