From patchwork Tue Jun 17 08:29:55 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 23590 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 1B7B4C3240 for ; Tue, 17 Jun 2025 08:30:20 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C762D68DDF; Tue, 17 Jun 2025 10:30:16 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="hNA+atFZ"; dkim-atps=neutral Received: from mail-wr1-x42c.google.com (mail-wr1-x42c.google.com [IPv6:2a00:1450:4864:20::42c]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 20DCB68DD9 for ; Tue, 17 Jun 2025 10:30:07 +0200 (CEST) Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3a507e88b0aso5246176f8f.1 for ; Tue, 17 Jun 2025 01:30:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1750149006; x=1750753806; darn=lists.libcamera.org; 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=RmFQZIIJ4r2zWdK/Ht3tViSq/HztBUjjfdDbZYNWKY8=; b=hNA+atFZo9dWRNLyayg0hRIP+BhyO0XN3fzcRQXcasJNpyKjDwWR66AiirZJP9odma QRK0RugdP1EckW5WLbd+UM93LVm0FbVL2H5nNCxDy0Tq7rYdkmjerD4W2aPacZvwqFsE IEW4PNSEHa3WHcdJi2dDLiZO/00Iliss5/PPBqpQR4xW1xZ15OBLn+YxSAbgm+WdJktx Y8R546PVsyTy3P1FHSen9JLtzvwrlOekERzo85BQ7D2dHAy0L0sm+G+txrbjZ8VAjmsy S+TmniTs6nttFvwcvl2FKBQoIxSNfanBm5o/RMFN9multZ9r3UKIwviTmZu+W3rYAFRu Uuwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750149006; x=1750753806; 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=RmFQZIIJ4r2zWdK/Ht3tViSq/HztBUjjfdDbZYNWKY8=; b=TkhF2BTjBehCbBCnbfuI9Z6xeVQuBP5GiYpqC5mV6fyy0GIflCBCbcRZ49GwbsWgH6 SXjpbitnexfa0qdNp5koVH2+/N10f+Yo6aYt1dVtMIgTpXtnwPaBVT8lPSM2vufNOIFm gP1KHIbJjgjwtbxZbm6H4PGyujsk88Fp9OH/FP/VeU4BWZHEiZiZ1GUpMNQvp2DABqYy X0eRwvYhQIuw9e3Czvejl4W6tYz4vLJ5loNjtGzSszBJ4QaGCuMN6ohIIECNkEJv2uR0 YaH/zJwTRu3nc2d+Vq3H/Z0Hlrn54ONfhnesjImsmPQuGB7v2LavxHwk6DjNz3xlsPtf wSnQ== X-Gm-Message-State: AOJu0YxqCkqy4h0a640GqTjfqdLLHFAjCM+8Ug5bwr091csF4a8BrcRG 2xFFjRTzoDNyr+oBZVDCgCKM2QpB/7lzZdyHt84cOaDKh797dd8JRij4h6t8YIM65wWFRUTSaRn l3Bac X-Gm-Gg: ASbGncvEkclLpRI+tuMPxdG6VSWWVsB0mIhceasoANj3qzXl20enO9qDjp9YTpltu4K mKwQ1SeCeeAEaAqUMWAzyCPkopjWeMUH/GJLC5ypXm1SbuyGsRpcn/0oz7QYohLSo8kW1/YeUGZ lzHwqIVeVNyeryEWzjcEBiZTm4/1htrZ0H1IGTzxkFj/DmOPDr/bYO+cYK+nvEnZvsQJfJFnveK 4F/wNgZEFF54ERmeKgakS++Hs7hmC4c1kJ9ZMSsF+qCZ6B8bt/JbDfBYI7QqKnfHCTTVj26wvRc aMPeNefHlKaM84Dv2gJXut6h/Fav3jHLAvKbYylNupS4k7TyPmauOhATPN84BhMerh7IT+v7Ig4 yGe+OuV/oj0v0I3KJUr9zs4Km1+L6 X-Google-Smtp-Source: AGHT+IFrO5mBRrM1IUOseMLdFE6KIW3wUVI7DRxTXvrlPXfHi+s0M0q75G51enhu2vF5Qr4d/RvPfg== X-Received: by 2002:a05:6000:250c:b0:399:6dd9:9f40 with SMTP id ffacd0b85a97d-3a5723678b8mr11869437f8f.9.1750149006242; Tue, 17 Jun 2025 01:30:06 -0700 (PDT) Received: from raspberrypi.pitowers.org ([2a00:1098:3142:1f:ffc9:aff6:7f7f:893b]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4532e259108sm166062955e9.32.2025.06.17.01.30.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jun 2025 01:30:05 -0700 (PDT) From: David Plowman To: libcamera-devel@lists.libcamera.org Cc: David Plowman Subject: [PATCH 7/7] ipa: rpi: agc: Remove digital gain from AgcPrepareStatus Date: Tue, 17 Jun 2025 09:29:55 +0100 Message-Id: <20250617082956.5699-8-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.39.5 In-Reply-To: <20250617082956.5699-1-david.plowman@raspberrypi.com> References: <20250617082956.5699-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" All platforms are now using the digital gain from the AgcStatus, so the AgcPrepareStatus and prepare() methods can be tidied up. Signed-off-by: David Plowman --- src/ipa/rpi/controller/agc_status.h | 1 - src/ipa/rpi/controller/rpi/agc_channel.cpp | 18 +----------------- 2 files changed, 1 insertion(+), 18 deletions(-) diff --git a/src/ipa/rpi/controller/agc_status.h b/src/ipa/rpi/controller/agc_status.h index 956d6abf..1ae069f2 100644 --- a/src/ipa/rpi/controller/agc_status.h +++ b/src/ipa/rpi/controller/agc_status.h @@ -44,6 +44,5 @@ struct AgcStatus { }; struct AgcPrepareStatus { - double digitalGain; int locked; }; diff --git a/src/ipa/rpi/controller/rpi/agc_channel.cpp b/src/ipa/rpi/controller/rpi/agc_channel.cpp index 3829534c..acc67b71 100644 --- a/src/ipa/rpi/controller/rpi/agc_channel.cpp +++ b/src/ipa/rpi/controller/rpi/agc_channel.cpp @@ -480,26 +480,10 @@ void AgcChannel::prepare(Metadata *imageMetadata) AgcPrepareStatus prepareStatus; prepareStatus.locked = false; - prepareStatus.digitalGain = 1.0; - if (!imageMetadata->get("device.status", deviceStatus)) { + if (!imageMetadata->get("device.status", deviceStatus)) prepareStatus.locked = updateLockStatus(deviceStatus); - /* - * For now, the IPA code is still expecting the digital gain to come back in - * the prepare_status. To keep things happy, we'll just fill in the value that - * we calculated previously and put in the AgcStatus (which comes back as the - * "delayed" status). Once the rest of the IPA code is updated, we'll be able - * to remove this, and indeed remove the digitalGain from the AgcPrepareStatus. - */ - AgcStatus delayedStatus; - if (!imageMetadata->get("agc.delayed_status", delayedStatus)) - prepareStatus.digitalGain = delayedStatus.digitalGain; - else - /* After a mode switch, this must be correct until new values come through. */ - prepareStatus.digitalGain = status_.digitalGain; - } - imageMetadata->set("agc.prepare_status", prepareStatus); }