From patchwork Tue Nov 22 11:22:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 17832 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 7577DBE08B for ; Tue, 22 Nov 2022 11:22:32 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0535063319; Tue, 22 Nov 2022 12:22:32 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1669116152; bh=ITa9tEwEKy2zHLDsWR78Jt6uw0jVRF4OguWTlKQnrZU=; 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=jRb/K13yap7DpPELnTVpZ0rJL3X1XLhil4GquMLZ7lLnBdpJUNaprnboLxH+ELhp6 62JDXAXtcbiHkeLlfwcm0sdCRKN9g2cpKq40n3kDeRmKUnfXmpfSXeKjQYmNOQYKrE enSoBF6Y37ie70Cc+VFSDo0LquakAIx2Ikn2z5y9o4dSfSWrTpE04h7kRdgSL+9fq9 stap7QvRmLNfkYtx/iRv/g6elvjkDKZZQn08ZaEMk62JA94W3z2I2JU/DrLw/IbKka j2YgQGxTFsKFMEeos9yMIDN0cKUkA7Kpky9jxwo6RFTKQFzukdizgXTpTDtXio4G26 5dNK5va9l/ZCQ== Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 823526331D for ; Tue, 22 Nov 2022 12:22:29 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="rOiaQKp0"; dkim-atps=neutral Received: by mail-wm1-x32f.google.com with SMTP id p13-20020a05600c468d00b003cf8859ed1bso11059905wmo.1 for ; Tue, 22 Nov 2022 03:22:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=iiHzRQDeANfYrEuD7IDZlbSTxQgE8EZsA8eKtigFok4=; b=rOiaQKp05GdVNO7PWtguf25TO8J+sryTDtB1b2F/SLZ0KTo4ltNzI9kDa9VMibZkj8 zB7AhqX0KECmW1GqM9GdG1QErY1wGOar4Vqpl2bxLsgJw/4F2EcTcwHoFE/pKqBJRPGc cNeFJSI78nekpcmLa+N33InuMg5eHX8ubysGEbq+0fho4BRgihk8jwTBMRza6Sba6XmN REl/IURH5cW0anwS+mdWOlqxADBBtxZUv+Jd0bJXhS4XECHWLhz8MIzQSifgZzU9qmy+ 1Gq2p4PGHB8xvj58aiOh/gvfMJNEamaRT2vsmtcaM6O7bku0Vn5/ba4eVz3HF3jumrqR ZG4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=iiHzRQDeANfYrEuD7IDZlbSTxQgE8EZsA8eKtigFok4=; b=r4tWLouZKiXxY9cZ0A7VlN+OzUQKoGXuMsEVkckKxX8QqAb50ANQBs6T66DAwMaqeb qxFe215N0UHZK9J7+Kl1Wc8+JJorrDBO/VhNGNwTiDTqRapIV7jRihqw14icvewPX/xX +vC3RKINTiUt9xKCsC+nH8edJznAIHVRbOnLqwnxZXscJ19ChIgMakhoscO0dzJmgfgV AM1J26KAyY9pbOfrGEjzeh7Pcske45NOivghQT1spc+CFWpuvBRix1TxOidnGHk4Q0Mw tcVB1dqwVJ9iElWzqu4x9CvdaHKNcJtthyn8Qu/C1JTOTXDbl42dibi2XBaynQK6CtFZ UFuQ== X-Gm-Message-State: ANoB5pnNe+ZBrIy7tUOUrJrcY8WruvCdnywlJKbt7xAb6vW7R0o1brkm Nwb6kOychriB/i1HY/H8JhtkHyrp3R4z1w== X-Google-Smtp-Source: AA0mqf7gE9xIW4GdnDrQKu5R2fNHDvAxLXMd8Lb3lNWTbnvJ3IFyisR1DOovlp8CEVzbJvg+ut6fIA== X-Received: by 2002:a05:600c:1f1b:b0:3cf:35c8:289f with SMTP id bd27-20020a05600c1f1b00b003cf35c8289fmr7112407wmb.153.1669116148965; Tue, 22 Nov 2022 03:22:28 -0800 (PST) Received: from naush-laptop.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id q125-20020a1c4383000000b003c6cd82596esm21400388wma.43.2022.11.22.03.22.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Nov 2022 03:22:28 -0800 (PST) To: libcamera-devel@lists.libcamera.org Date: Tue, 22 Nov 2022 11:22:22 +0000 Message-Id: <20221122112224.31691-4-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221122112224.31691-1-naush@raspberrypi.com> References: <20221122112224.31691-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v1 3/5] ipa: raspberrypi: awb: Delay release of the statistics buffer 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: Naushir Patuck via libcamera-devel From: Naushir Patuck Reply-To: Naushir Patuck Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" Release the statistics buffer after running the through the AWB calculations. Only the "counted" statistics are copied out to a local structure, so keeping the statistics buffer allows the algorithm to see the "uncounted" statistics as well. This is currently handled by hard-coding the total number of statistics regions regions based on the structure definition in the bcm2835_isp_stats structure. Signed-off-by: Naushir Patuck Reviewed-by: David Plowman --- src/ipa/raspberrypi/controller/rpi/awb.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ipa/raspberrypi/controller/rpi/awb.cpp b/src/ipa/raspberrypi/controller/rpi/awb.cpp index 8d8ddf0913f7..861022014896 100644 --- a/src/ipa/raspberrypi/controller/rpi/awb.cpp +++ b/src/ipa/raspberrypi/controller/rpi/awb.cpp @@ -432,11 +432,6 @@ void Awb::prepareStats() */ generateStats(zones_, statistics_->awb_stats, config_.minPixels, config_.minG); - /* - * we're done with these; we may as well relinquish our hold on the - * pointer. - */ - statistics_.reset(); /* * apply sensitivities, so values appear to come from our "canonical" * sensor. @@ -733,6 +728,11 @@ void Awb::doAwb() << " with gains r " << asyncResults_.gainR << " and b " << asyncResults_.gainB; } + /* + * we're done with these; we may as well relinquish our hold on the + * pointer. + */ + statistics_.reset(); } /* Register algorithm with the system. */