From patchwork Tue Dec 13 11:48:34 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 17998 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 CE3B3C328D for ; Tue, 13 Dec 2022 11:48:53 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 81D326336A; Tue, 13 Dec 2022 12:48:53 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1670932133; bh=WGDI8twxcdHAKJzJ5im7ArFW9wvzj17s+nghLwrJXYo=; 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=UsViOkovCQg4tNZ1oC0vifu5XdE6H0N+vpsOEdb3nq4q1ZViKiBH8sF+fdNEhZiEu mgoHx1drvXHW6Dzcv9i4XPHobeTzzBJrbbDzb3kM+4zFuNY/CIrsW5OoQctYaY9ACx QkkOG+6ZRrvqXD6nnbutLfYyWdhik3eHmTuiihMrzWDZTpI1Yezp/rtuADcEp14PVY fjjnmgBh/zxqfhITnsldrSKDvACgBq1RZdlad/jONF6ZWUjiz/n3SuwNYXs+S4t1kC jyF4r6gA1Emkk5cziLw1SYp03MGDyNM3FoEy1bSUJHiR6ISQDjWdBuA8WI+X332Eee N51+5cDFChVRw== Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 85ADE63364 for ; Tue, 13 Dec 2022 12:48:50 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="folMdn4E"; dkim-atps=neutral Received: by mail-wr1-x431.google.com with SMTP id f18so15312831wrj.5 for ; Tue, 13 Dec 2022 03:48:50 -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=2xu9NvIf3FFVhTiDKKJMfUfn/nFLA9UTQHonQ3imTOM=; b=folMdn4E0rlqAYw4PoNyIB2dsKvyUxhU+q1XNE8Tid4IIY8/nwFtvVVgVis2IFoMll C+8ExS+KFT3IPqUFEC3BolN7LaHmOOaklJYG1Vkg5iTgjaBhswJ6UK8yJACzV7+2oZyS 3KqculpCWNlJub3LvxhEuoT5HzSm5NpXvj4IviRqwXGjRZLPtqhoF34J3rmyPPJ9V1J/ fFWg9SYwkGNMnGlfIpZFhxfFx5CQ4hPbGLM8OZoiIdTPiliuBhDsUK+y911cy3Jy3RQt GuvWdRUdI8I+EaZGRZCVZetA0N6B1D0HLxRZ6SRyB2Nbl8NpnmqzVr80ctEb+FbFEyBJ Qsyg== 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=2xu9NvIf3FFVhTiDKKJMfUfn/nFLA9UTQHonQ3imTOM=; b=SHK3O4m9zApSi4IA3OYinVIl3DdAGLYuw6ssIh2S9yNRGaYn74HNsxelnStT5SgVyw m9DcOuQM/uAfy25Sddm0o5uHzZOFU2+1y4WLeHsHIWPOxyaOSbFV5sRbZis2DeD8cXZ2 lZTFlrK9ob3Y7vyePz035FpZqMUtNlmedTS97EZ3pngYaW+0iwFZBsF8BP5wvvnkYhPp kVLLBo6H6Dq/nbGX28Zxn8LVIgimmQ7MkDezEfNNtHLWuiBEQL01iCS27OPXHVyKSYE4 NewnDrh0vmh0g+OIaxwNqcN45D18ek2TNUn6dXYpY9AsucfALNejdUE4MsVA4hLOkb7X D7rg== X-Gm-Message-State: ANoB5plukVHfBmCitt1Djd6owzfCUelybwL5QuWn+WsfmjCSrHpIDu4Z gnIKk/gmJYcjJpp6JWizxhCONGrLK13xN8kD X-Google-Smtp-Source: AA0mqf4NqdZGw3ZyMXJsvBQItsxB+ZtGNOTGSPmVa+iZy3DFd+dvZROsFbp/Pcxb0PsmlAFV1WLbiA== X-Received: by 2002:adf:f10f:0:b0:242:19b3:67 with SMTP id r15-20020adff10f000000b0024219b30067mr12059414wro.37.1670932129588; Tue, 13 Dec 2022 03:48:49 -0800 (PST) Received: from naush-laptop.localdomain ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id j8-20020a5d4528000000b0024287d9d4a8sm11574541wra.74.2022.12.13.03.48.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Dec 2022 03:48:48 -0800 (PST) To: libcamera-devel@lists.libcamera.org Date: Tue, 13 Dec 2022 11:48:34 +0000 Message-Id: <20221213114836.15473-4-naush@raspberrypi.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20221213114836.15473-1-naush@raspberrypi.com> References: <20221213114836.15473-1-naush@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v3 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. */