From patchwork Fri Feb 3 09:17:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 18242 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 BDAC7BEFBE for ; Fri, 3 Feb 2023 09:17:45 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 348BE625E8; Fri, 3 Feb 2023 10:17:45 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1675415865; bh=P6j9Xio4hdEWygeIAu/eoLHX89q5TgOrG8h3SAAUOR4=; 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=N7hL6TsBPFJF47je1tRnMxQ3XdPaWR2Ee9Qx/kwzMRtlSi+ZZa48a+CwC1z7ZafXF 2XWOS/InPH8aMUudkiC7eCynZDhpnLm0Hh+LZx1gqM1za2VpsIOABPXvRVb36OaEVO 5LX2Z2Grij6kW6+ZonzTc+OhY5rafA2saKyevcipoFboY+qtXz9VWnpHLoB3JJrGRU wFq8KkiM7QId904jDT7wuug+L7sUbtMk0uQBVvqjVQr/5WE3THFWAmYt7vY1Gp0X5Y /zH8WVLEh4UWtGfDUmV1oOhL/CPtwDDknf+yTtnemGAddQJBruhWSsZjdUZFBno4yb L2v9ZakaOM4Og== Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 87CC6625EB for ; Fri, 3 Feb 2023 10:17:41 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="NH4CUexy"; dkim-atps=neutral Received: by mail-wm1-x32a.google.com with SMTP id m5-20020a05600c4f4500b003db03b2559eso3327973wmq.5 for ; Fri, 03 Feb 2023 01:17:41 -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=G/JQb0uBfrwIRQcYwTAsXOw+rV9FlpM8/tfxdtjycqg=; b=NH4CUexyNLwTVYcM5RtjFvaLs88lfFt4Y08W73mZ4tVj1AyPQ3IkEhJ9RX/Rkoc4+U SN6II599cc85CzBZnLEhl6RL/xyVX9nhSP7FtHb7EdPpZDktklYtAjhqnuagDo1h5LD8 0J6jc8EyFGs9R//eFlg5y621/mmLAr/yyv9ritJGb/4jBfTi5XcPFHcC15WEgbLfrHNH NzEKROo+riTNPaQnsrV/QFE3uX4zorU24SvFisilNUUhckPttaK9nkklwxfDC3FJ0Cz4 Z9OTOoMTf5B/vyKzWxSwpAq8ARK6ADS7uiNIx1OyHaHd11iBk8i8jBZTlES07FJxjGvp p0/A== 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=G/JQb0uBfrwIRQcYwTAsXOw+rV9FlpM8/tfxdtjycqg=; b=2oy6qiBvi3cjMHGqtfFzvD9KorOaxkppc7OSbizD/etwAkaTvLrnKWBC31WRePDqUa +MP3C7/d77wtCg3GiW/c06iAYxXYKUgHa3h0id6Gmb2YECx0HXCtyHc4VYUFAzrLtFSj 3g2DAwHRv8mjlu46bxIqLvoWG0ALWaU7Td8qvLUHCVd6uuERwBnXzYI/jg9qZwXRs7aI Gim3ln/IX76bvifNVdE7JB2vUeBc0pGzkcSaCXT60twoNw3IGQC833G+JKywkTdhuzZb eWtvalXPPds4lW1t+IObQWY0u44uG/AZASI0rJqwGaXvnkf35uUpm71Blbg1Igkp4Typ hJzw== X-Gm-Message-State: AO0yUKWLFpXymXfMs5FOv/iRpAJbM8RBeHXH2hW0S+LBfbHlMeSBhPN4 NY11EoPRLTig1IZ4jF81IEd7L0Z9jkq9QDkpcxV67w== X-Google-Smtp-Source: AK7set8edxXxc4tDtIOwvrFXaL/Bh3fdsLuNfji19diTGJXpSPUl8Mr12iIKMhEGYmPpsVvrCGJMDA== X-Received: by 2002:a05:600c:2b46:b0:3dc:4aa6:a8a9 with SMTP id e6-20020a05600c2b4600b003dc4aa6a8a9mr8517781wmf.7.1675415861068; Fri, 03 Feb 2023 01:17:41 -0800 (PST) Received: from localhost.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id az24-20020a05600c601800b003dc4baaedd3sm7468864wmb.37.2023.02.03.01.17.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Feb 2023 01:17:40 -0800 (PST) To: libcamera-devel@lists.libcamera.org Date: Fri, 3 Feb 2023 09:17:32 +0000 Message-Id: <20230203091734.22803-4-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230203091734.22803-1-naush@raspberrypi.com> References: <20230203091734.22803-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v4 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 Reviewed-by: Kieran Bingham --- 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 4f6af4ba98dc..04d1c8783654 100644 --- a/src/ipa/raspberrypi/controller/rpi/awb.cpp +++ b/src/ipa/raspberrypi/controller/rpi/awb.cpp @@ -427,11 +427,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. @@ -728,6 +723,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. */