From patchwork Fri Jul 28 13:36:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 18899 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 12B78C324E for ; Fri, 28 Jul 2023 13:37:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6FD13627F2; Fri, 28 Jul 2023 15:37:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1690551425; bh=jf0XneDQIHxvSGeB7vZhsr5MqzxjdQTmkwsv3mfzPcA=; 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=pOqyNjHR3kFqRXBnL544mclW749szywdFaiz/sVCY88inxAHviSwQiYTLqIlIn+jl +oQ21exYRs+H4At9t5OxoyEYKxzzSA3+pr0NM3WAbP2fn7xP7wKQ77okySaW7HkOc4 lsqxDyIYAxzB3GTmBUyNz98+fnTgQk1x9LRKdQOCl2rKt1tX5uWwy0LExOLum7hSC9 bJgRn4e39DgAAoe0gAlhHwegbHl8TFSC1FyQZxrb+RI7zfYW1EiXBYZkY80APGUETw Hx5vtOGf3HuNg4PFnKLeOZq4FFeJ4iCSKDJN3g+K2qdJefIW9kcneIdpAJU+GMGAfT 0vz8UzMWJ04FQ== Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 6E3BC627E7 for ; Fri, 28 Jul 2023 15:37:03 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="kv8I9Gsq"; dkim-atps=neutral Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-31758eb5db8so2142231f8f.2 for ; Fri, 28 Jul 2023 06:37:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1690551423; x=1691156223; 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=Tj69fHEclvNZTLPcEmYzqTGANaDAaLoaGmsi0RnW56I=; b=kv8I9GsqZY5bN/wFieQB/fdNwdJwfuqSrLoAg8Dc5PBsFwQVCV9+QBtNCfKIbWDGSm wF920YQZDA4tRLO5TXXrkL/g1aiVFrFQrKohVqDPTKTRpfkHcdU7lXw37M4JYk5Huwx6 P1ZwyBR6DOITE/SjXPoCHMQlB/FOnufNcpj7PppEAUrXQ0ssKhK3OJLKfSXVpTRsAT2C B4XUqTL+68tvWcAx9FbeuMgEjAl5zqoVMmvFh+yqLDBSy5tNIH5q5u1NQ8JZdJEXp5/O OtKlpKlIrW00D6Gy8DLig35mR8FLaHSSvnW2Mihpj/c+QSnRzQikX0228gLHAJf3o+Mp HBPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690551423; x=1691156223; 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=Tj69fHEclvNZTLPcEmYzqTGANaDAaLoaGmsi0RnW56I=; b=i9Iy4vpdWDOKC25xGwJB+mFynvtvB2VqFQIUuxuodc1PRfBnu7tDCT1978Pr7zTOyS gA8DkAsz9hIXY1ZRDFOvcuowp7jwwYd5oA5xEXhk3UdWEB1ySS4BHWskUKBpnd8JOnj4 dM3rRfxgGz3O0ooXmqug4Vd/o3t2HC6MGQZAwxsR8iY8NzOW77d/r82pJ6oeC2sK6YXx 91fncZ9iM+l87RRcUJpCUu99bnsNIR2xu1P48/FeeakLkyesOqRnAfKD8d+pfP/i0DSS YwgOkulUgDEr8RbuorZOKolS1YbzcupQgcbAs5lduCLt8Im8oIFFQJ1WWNA3LksIOtuF aQdQ== X-Gm-Message-State: ABy/qLaV83DTs79WTU9bRWcUXshwgrU1KcvDiFcHza+Ehe48o/mrvN0q qBlLy/jchH8+kTf0k/z7zSjlt4umsBUfU94S+hk= X-Google-Smtp-Source: APBJJlFZ09uYyRpUzs6+kvEJxCoKTGCTaG5mdmtqtL2bmECSN//MNvhZ49fcZe9AJuGCtODnlOYEtQ== X-Received: by 2002:a5d:60cb:0:b0:313:fbd0:9813 with SMTP id x11-20020a5d60cb000000b00313fbd09813mr1560792wrt.28.1690551422903; Fri, 28 Jul 2023 06:37:02 -0700 (PDT) Received: from pi4-davidp.pitowers.org ([2a00:1098:3142:14:2bce:64d6:1a5c:49a2]) by smtp.gmail.com with ESMTPSA id i15-20020adffdcf000000b003145559a691sm4847758wrs.41.2023.07.28.06.37.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 06:37:02 -0700 (PDT) To: libcamera-devel@lists.libcamera.org Date: Fri, 28 Jul 2023 14:36:58 +0100 Message-Id: <20230728133700.3713-2-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230728133700.3713-1-david.plowman@raspberrypi.com> References: <20230728133700.3713-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/3] ipa: rpi: agc: Fetch AWB status in process method, not prepare 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: David Plowman via libcamera-devel From: David Plowman Reply-To: David Plowman Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" prepare() doesn't use the AWB status, so fetching it in process() is probably better. This change is preparatory to other changes, where we may find ourselves calling process() without having called prepare() previously. Signed-off-by: David Plowman Reviewed-by: Naushir Patuck Reviewed-by: Jacopo Mondi --- src/ipa/rpi/controller/rpi/agc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ipa/rpi/controller/rpi/agc.cpp b/src/ipa/rpi/controller/rpi/agc.cpp index ae9ff219..e8526355 100644 --- a/src/ipa/rpi/controller/rpi/agc.cpp +++ b/src/ipa/rpi/controller/rpi/agc.cpp @@ -424,7 +424,6 @@ void Agc::prepare(Metadata *imageMetadata) totalExposureValue = delayedStatus.totalExposureValue; status_.digitalGain = 1.0; - fetchAwbStatus(imageMetadata); /* always fetch it so that Process knows it's been done */ if (status_.totalExposureValue) { /* Process has run, so we have meaningful values. */ @@ -461,6 +460,8 @@ void Agc::process(StatisticsPtr &stats, Metadata *imageMetadata) * configuration, that kind of thing. */ housekeepConfig(); + /* Fetch the AWB status immediately, so that we can assume it's there. */ + fetchAwbStatus(imageMetadata); /* Get the current exposure values for the frame that's just arrived. */ fetchCurrentExposure(imageMetadata); /* Compute the total gain we require relative to the current exposure. */