From patchwork Tue Mar 22 02:41:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kate Hsuan X-Patchwork-Id: 15496 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 666B0C0F1B for ; Tue, 22 Mar 2022 02:42:29 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 14E84604D4; Tue, 22 Mar 2022 03:42:29 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org; s=mail; t=1647916949; bh=AKwXqEAqL5AIaqoYdO07ZPKDFy9dBeD9BuCB7UzkghY=; 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=yu/UkJumFmQdopedHZJoeVmZ5S72I94SDLrQ+FmNvG/fk05xWdu2cmErRHRIYNlnJ s1xopHQd3JlTFhNLrlToNu+Hg+oYy0OiIFbbdpbZ2X4rINXfTN/R4VNL1eq+VezgcZ fthHqKahNJvtzfV55YSZzEHE0SgtoNM/I3sXmJmjqDgbSJUTJMxv9xO+rappqDhJUT on7Z8lALdk1ae6wUZrkK7gCobzgyRfL79T2rqVA8dG9iSBVHonvaO1grronfzQ2S7p elMAu23nQC/4nBl6CDFCEoTyL8uyG0E1FAQ9Byy0C7ySQy1Ooh7yma90RzlGOpCn+f 0WzyzCaQpo+wg== Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3B8BE604C7 for ; Tue, 22 Mar 2022 03:42:27 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="EZvUDEJ7"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1647916946; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=uHTuIVd9uI1qjYZ8rDDAXJfmO4GBGoSuLckQojWTq48=; b=EZvUDEJ73M17cT1pWdEd6IXlNynSGYtNbAr+alkH0LVKuFVYDdwH84WbtEdFKYA9qXvjUg 74bwd0qmDNgiVYRZpgYlM0tXeNpw2f8pnmXTkDiG20xGvXp8Hb302XM9cXeEUxhX8sZE1+ zyMbJWHypYhrDGWOfmNH9Aomq6TPIEQ= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-127-cyZcmdKFM2Gmu6mBSs5Hxg-1; Mon, 21 Mar 2022 22:42:25 -0400 X-MC-Unique: cyZcmdKFM2Gmu6mBSs5Hxg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E7D033C153A2 for ; Tue, 22 Mar 2022 02:42:24 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.39.192.3]) by smtp.corp.redhat.com (Postfix) with ESMTP id 45CC7C26EA4; Tue, 22 Mar 2022 02:42:22 +0000 (UTC) To: libcamera devel Date: Tue, 22 Mar 2022 10:41:55 +0800 Message-Id: <20220322024155.6528-5-hpa@redhat.com> In-Reply-To: <20220322024155.6528-1-hpa@redhat.com> References: <20220322024155.6528-1-hpa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=hpa@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [libcamera-devel] [PATCH 4/4] ipa: ipu3: agc: AE lock for AF scanning 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: Kate Hsuan via libcamera-devel From: Kate Hsuan Reply-To: Kate Hsuan Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" When the AF starts to perform the scan, AWB will be suspended to maintain the AF scene variance and improve the AF performance. Any changes in the exposure value will lead to an incorrect focus value during scanning. Signed-off-by: Kate Hsuan --- src/ipa/ipu3/algorithms/agc.cpp | 14 ++++++++++++++ src/ipa/ipu3/algorithms/agc.h | 1 + 2 files changed, 15 insertions(+) diff --git a/src/ipa/ipu3/algorithms/agc.cpp b/src/ipa/ipu3/algorithms/agc.cpp index 7d4b3503..2f28747a 100644 --- a/src/ipa/ipu3/algorithms/agc.cpp +++ b/src/ipa/ipu3/algorithms/agc.cpp @@ -314,6 +314,17 @@ double Agc::estimateLuminance(IPAFrameContext &frameContext, return ySum / (grid.height * grid.width) / 255; } +/** + * \brief Test the AF requested lock is exist. + */ +bool Agc::isAfRequestedLock(IPAContext context) +{ + if (context.configuration.af.requireAeAwbLock) + return true; + else + return false; +} + /** * \brief Process IPU3 statistics, and run AGC operations * \param[in] context The shared IPA context @@ -343,6 +354,9 @@ void Agc::process(IPAContext &context, const ipu3_uapi_stats_3a *stats) double yGain = 1.0; double yTarget = kRelativeLuminanceTarget; + if (isAfRequestedLock(context)) + return; + for (unsigned int i = 0; i < 8; i++) { double yValue = estimateLuminance(context.frameContext, context.configuration.grid.bdsGrid, diff --git a/src/ipa/ipu3/algorithms/agc.h b/src/ipa/ipu3/algorithms/agc.h index ad705605..e00b28e5 100644 --- a/src/ipa/ipu3/algorithms/agc.h +++ b/src/ipa/ipu3/algorithms/agc.h @@ -40,6 +40,7 @@ private: const ipu3_uapi_grid_config &grid, const ipu3_uapi_stats_3a *stats, double gain); + bool isAfRequestedLock(IPAContext context); uint64_t frameCount_;