From patchwork Mon Jul 21 07:47:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Naushir Patuck X-Patchwork-Id: 23866 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 F3BD9C3323 for ; Mon, 21 Jul 2025 07:49:12 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id DE24868FE1; Mon, 21 Jul 2025 09:49:11 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="RvU4LSMX"; 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 3F08868FD1 for ; Mon, 21 Jul 2025 09:49:00 +0200 (CEST) Received: by mail-wr1-x42c.google.com with SMTP id ffacd0b85a97d-3a4e749d7b2so660866f8f.0 for ; Mon, 21 Jul 2025 00:49:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1753084139; x=1753688939; 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=yCqWjxhzUe3uZSUifzeDiS7Du7OgdYFrmNRNGtduVSU=; b=RvU4LSMXHxQwp1YcW0K7d2gjQTCvuaDEEskQ8D5EkkxFOO93j0OtuxanIAoaFw0d21 +W8hQqUq3t8WEnExgW3CWaOQhWjORQk5UB8X5HUBoPT6cKy0RK+7y0Zu86uCckPesP6e 8kR9wcGIrFU+KKVqWBLvByXwqd75qv2tjO7+b8MiV9trCUehO9z8Gc1aohUdt9ObELaq Tml3ML88NbQ9gjQ5+FxJvxFKJXV6E27Ybkg609DWd5HrQD7yzUk1Xj8qvFecbNx+0BI4 SjTsrzT94gCTULC9XcCzN60WwKlQCdAaWn9PDpHp4CufvhyBnd7VpHyzXa00OG1zw+l5 wDLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1753084139; x=1753688939; 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=yCqWjxhzUe3uZSUifzeDiS7Du7OgdYFrmNRNGtduVSU=; b=iutCqxsxrgablf+25ALnsV51eloWAJVgXYHSBbNIY7iPiO/+ZRZUlyoGtdnUVVt+NV ixRMcVG3mdXipsuniad/A4BW2lPNkZxuBwSHas1goFKoFkJV2w+qBzOgr5GS/6NuIqeA J+cyDSW382qGzExXVvU//Suwi0VKKK/uIvXV8ElnC47+zT2yk5WT4E/KTQrP/Bf7NYgp HX0UegzqghGaLauCTVFN3UZtFAyk9WhAsvKJQKjlq1Awdtr1FOCsPuPES4Qbgmp/xu7Q hTBjb0MS06VBxEduT3FVWTzCJTLtu9o/T1BbZ0gJ4jwF/oj5qOYMwKOFcBI5/NxRWjDj UFoA== X-Gm-Message-State: AOJu0YxekZf4jHM5q7tAKiujcaAbuxNrx3ddRWDXpQZJjzo6T+lmKdrb yKvCni+3u5ItMr8XSteaiEQZ4xL8W4Pscek3gYlorWEW3zynWH2Yp/jBtNzBeKFFTSGD3HhQwxL edBhKK4U= X-Gm-Gg: ASbGncu04ppl+wVSWzXC7ThDHTNbwKeeh5QAHt5gPOKjwngQ3HVrxjvvwrrKvzx/Ay3 /Oh0c8gw4nM0Ptg5BVwxnPpYpsuKo06xaFKYz5aan6zE6/05saaUwrglHoAtsm5X+DrMJI82izR UUZy7hk0o2G8QhFVqnLxvpd506rGdMzZ8GdSJqIj1ytmkqMkouRpBh7LlMpHLmhQSrAng53zyfu Uj1JDjPK2TUQaAHtmfno4BICz2+pdGuJqmYOk0SnwmGy/hOYERtqqrUpQkmFpT14dNRwvXEsL8i mXI9L+nvICpLRWja4oVpMoFQ+mbCKJQyiw9xY7ANIqiaZk7ZaLQLGVbTDXEd5B4tCyDf1fP6Qxt m8eiteQqM8A+Kzwvcbl62eRV6uf3llKIJUo+NvEgSVw== X-Google-Smtp-Source: AGHT+IHFvQrr5G0b0Ek2oDufRoXndAb4rhnfIcSZTooXgba9jnsdFbTpa4uIcb/wX7rTa62IJt6wQA== X-Received: by 2002:a05:6000:40c7:b0:3b6:18c4:e5af with SMTP id ffacd0b85a97d-3b618c4e70bmr4213953f8f.10.1753084139480; Mon, 21 Jul 2025 00:48:59 -0700 (PDT) Received: from NAUSH-P-DELL.pitowers.org ([93.93.133.154]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4562e802afasm151101765e9.12.2025.07.21.00.48.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Jul 2025 00:48:59 -0700 (PDT) From: Naushir Patuck To: libcamera-devel@lists.libcamera.org Cc: David Plowman , Naushir Patuck Subject: [PATCH v2 7/7] ipa: rpi: agc: Remove digital gain from AgcPrepareStatus Date: Mon, 21 Jul 2025 08:47:27 +0100 Message-ID: <20250721074853.1463358-8-naush@raspberrypi.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250721074853.1463358-1-naush@raspberrypi.com> References: <20250721074853.1463358-1-naush@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" From: David Plowman 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 Signed-off-by: Naushir Patuck Reviewed-by: Naushir Patuck --- 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 956d6abf398c..1ae069f2ee8a 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 7da1c6dbbec7..cc944e6dd54e 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); }