From patchwork Tue Sep 27 02:36:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Pinchart X-Patchwork-Id: 17420 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 94909C327E for ; Tue, 27 Sep 2022 02:37:15 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 4558062280; Tue, 27 Sep 2022 04:37:15 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1664246235; bh=lWREngrB4gOteSDuh0Ey3KbllXbKoBisx8QRdnhiPA4=; 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=Lx9OIVXxwv7Y3IsPSQIocHXnaTGGqwKTCPXNnl8HYTTbDdGyjJeFGB/HPK1fOlt7m P64gAML4iFpLQ1FJs27SmAo57UfPjPzDWjMhdGhkt6imlRbBc8YNEReAEMb1z8cF8w eIXsX8XRt190eimuU4lacqCWrpXtAGq/msjxSLrtFQMXrJ4dGhCT96eLv9e7fnbH0v JBoBTheS32qaFyFJHzo/6YEhxCgHd+YGI01wFmUJqqk0tZKHR9pNQguTTNVHX68GeI 50BuYEWuga5i+I7C88TbImYybr3mJ+DfoZsQ7r9fTmMeIkJteuZAF+0DvVaB3agzo7 aHMKhJtDnsQ5w== 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 394A362289 for ; Tue, 27 Sep 2022 04:37:13 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=ideasonboard.com header.i=@ideasonboard.com header.b="Qrb4wp+x"; dkim-atps=neutral Received: from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi [62.78.145.57]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id B24CC47C for ; Tue, 27 Sep 2022 04:37:12 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1664246232; bh=lWREngrB4gOteSDuh0Ey3KbllXbKoBisx8QRdnhiPA4=; h=From:To:Subject:Date:In-Reply-To:References:From; b=Qrb4wp+xp+fVJoSJweU3RAnyNN646F/wx4Fl56+dGGfrRqq2M5aRGfvAqjY4oF8Ex 9gOIZXIhfbiVRG7VhU1bOTd07AmRdIGlhHmzyysx3NtF+s5cXKQ9dCQZYxioNwGalM WOdf9xwd+RT0u62xf7esFRopKXJwvGni9OBSeUzk= To: libcamera-devel@lists.libcamera.org Date: Tue, 27 Sep 2022 05:36:18 +0300 Message-Id: <20220927023642.12341-10-laurent.pinchart@ideasonboard.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220927023642.12341-1-laurent.pinchart@ideasonboard.com> References: <20220927023642.12341-1-laurent.pinchart@ideasonboard.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v5 09/33] ipa: ipu3: Use base FrameContext 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: Laurent Pinchart via libcamera-devel From: Laurent Pinchart Reply-To: Laurent Pinchart Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Inherit from the base FrameContext class in the IPU3 IPAFrameContext. This allows dropping the frame member, which is now stored in the base class. As the frame member of the base FrameContext class is private, the check that accesses it in IPAIPU3::processStatsBuffer() would fail to compile. As it won't be relevant anymore with the upcoming switch to the FCQueue class, drop it. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham Reviewed-by: Jacopo Mondi --- src/ipa/ipu3/ipa_context.cpp | 24 ++++-------------------- src/ipa/ipu3/ipa_context.h | 7 ++++--- src/ipa/ipu3/ipu3.cpp | 5 +---- 3 files changed, 9 insertions(+), 27 deletions(-) diff --git a/src/ipa/ipu3/ipa_context.cpp b/src/ipa/ipu3/ipa_context.cpp index 13cdb835ef7f..9cfca0db3a0d 100644 --- a/src/ipa/ipu3/ipa_context.cpp +++ b/src/ipa/ipu3/ipa_context.cpp @@ -35,22 +35,6 @@ namespace libcamera::ipa::ipu3 { * most recently computed by the IPA algorithms. */ -/** - * \struct IPAFrameContext - * \brief Context for a frame - * - * The frame context stores data specific to a single frame processed by the - * IPA. Each frame processed by the IPA has a context associated with it, - * accessible through the IPAContext structure. - * - * Fields in the frame context should reflect values and controls - * associated with the specific frame as requested by the application, and - * as configured by the hardware. Fields can be read by algorithms to - * determine if they should update any specific action for this frame, and - * finally to update the metadata control lists when the frame is fully - * completed. - */ - /** * \struct IPAContext * \brief Global IPA context data shared between all algorithms @@ -188,15 +172,15 @@ IPAFrameContext::IPAFrameContext() = default; /** * \brief Construct a IPAFrameContext instance */ -IPAFrameContext::IPAFrameContext(uint32_t id, const ControlList &reqControls) - : frame(id), frameControls(reqControls) +IPAFrameContext::IPAFrameContext(const ControlList &reqControls) + : frameControls(reqControls) { sensor = {}; } /** - * \var IPAFrameContext::frame - * \brief The frame number + * \struct IPAFrameContext + * \brief IPU3-specific FrameContext * * \var IPAFrameContext::frameControls * \brief Controls sent in by the application while queuing the request diff --git a/src/ipa/ipu3/ipa_context.h b/src/ipa/ipu3/ipa_context.h index 42e11141d3a1..e8fc42769075 100644 --- a/src/ipa/ipu3/ipa_context.h +++ b/src/ipa/ipu3/ipa_context.h @@ -17,6 +17,8 @@ #include #include +#include + namespace libcamera { namespace ipa::ipu3 { @@ -76,16 +78,15 @@ struct IPAActiveState { } toneMapping; }; -struct IPAFrameContext { +struct IPAFrameContext : public FrameContext { IPAFrameContext(); - IPAFrameContext(uint32_t id, const ControlList &reqControls); + IPAFrameContext(const ControlList &reqControls); struct { uint32_t exposure; double gain; } sensor; - uint32_t frame; ControlList frameControls; }; diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp index e5a763fd2b08..b1b23fd8f927 100644 --- a/src/ipa/ipu3/ipu3.cpp +++ b/src/ipa/ipu3/ipu3.cpp @@ -607,9 +607,6 @@ void IPAIPU3::processStatsBuffer(const uint32_t frame, IPAFrameContext &frameContext = context_.frameContexts[frame % kMaxFrameContexts]; - 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()); @@ -654,7 +651,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[frame % kMaxFrameContexts] = { controls }; } /**