From patchwork Mon Nov 16 16:49:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 10437 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 3810DBE082 for ; Mon, 16 Nov 2020 16:49:38 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 0080E632DB; Mon, 16 Nov 2020 17:49:38 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=raspberrypi.com header.i=@raspberrypi.com header.b="eBYKjrbk"; dkim-atps=neutral Received: from mail-wm1-x331.google.com (mail-wm1-x331.google.com [IPv6:2a00:1450:4864:20::331]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 8025C632D4 for ; Mon, 16 Nov 2020 17:49:32 +0100 (CET) Received: by mail-wm1-x331.google.com with SMTP id a3so24196581wmb.5 for ; Mon, 16 Nov 2020 08:49:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zzxO+7DUtU4wEkTcoTYpn2fnio2NuM0p+0OqFUa+9G0=; b=eBYKjrbkEFAWUpGYGtQ0Y92mVUtanvq4Hbog9icNuX1RK5S6LzphO12ThC8xqADi3n t3fZfque1QX4aXor6cc8n3pnUT0V51MUywiN7x9d0+iystD2jrHyj1uf0DEv/YFSATiR caypXhgvBUMM1Rpb8/LfSMDdUV91uEM/MSdpmsbnJeREk5OgEvlgFDc3X4lsxinoab1O K84A50AO3DBDUCnsnjJILLD/XeSIzbGHu9vDiQnufhXoPP+FQK9zOQMw6v5RLlvbhZ8R KJGTOFkim9XPTo5aFn3ppnlF6Wugsp6eMEorloFHzf2XN3GASNxrI5n+QY8e2eiEAZfO VoDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zzxO+7DUtU4wEkTcoTYpn2fnio2NuM0p+0OqFUa+9G0=; b=HlbjWK0EKe5GVMrqo9XgB/0r337L830Q/BLADtEBYJBMIJESmXytML12J721XLDYYf Wkysgc26Wg4ABzOX4dIAKxeWTH1fs7xkqtNKVtpGI5DWZgsy0Q+mDJrMKZSEi/FLWDze wtNUg8ZD9X+FJOGtgRZrn11qiYfxXd8LUDE8TR2L/mPcS3EuzxlT5/2N9f7RGcJIioka TPflYNRvr5DwAywgf6jXMiuKps0Foi1ecH486ffHtf5qa8xX2Xy9+dOcOXqyTPj3+7hv 1xUSnPw2Btq7asv4eZoh6b7zR2ewFkh4GIC6g5weIEBlHKWMIJ+WJ9vZFK5uVI1MQq9z VLSg== X-Gm-Message-State: AOAM5315oKNQlsUeSGsOMgdwCgq3aBpEn83Ary9kqZov8uh45HGVXs5e N/F0Fi2AAbT8lherTYbdskOOVPUqNznxgQ== X-Google-Smtp-Source: ABdhPJz/aeIHZrcy4YCzqoZQMkX+gKRmpc77fkV4geVK0kHPYer4uqy0pG9pRZFSk/pMPrQVdz4A/A== X-Received: by 2002:a1c:df89:: with SMTP id w131mr15777113wmg.164.1605545371965; Mon, 16 Nov 2020 08:49:31 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id q16sm23716973wrn.13.2020.11.16.08.49.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Nov 2020 08:49:31 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Mon, 16 Nov 2020 16:49:16 +0000 Message-Id: <20201116164918.2055-9-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201116164918.2055-1-david.plowman@raspberrypi.com> References: <20201116164918.2055-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 08/10] libcamera: src: ipa: raspberrypi: agc: Fix uninitialised members in status_ 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" Use memset in the constructor, it is tidier and initialises everything. Signed-off-by: David Plowman Reviewed-by: Naushir Patuck --- src/ipa/raspberrypi/controller/rpi/agc.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/ipa/raspberrypi/controller/rpi/agc.cpp b/src/ipa/raspberrypi/controller/rpi/agc.cpp index 7c7944e8..1037f968 100644 --- a/src/ipa/raspberrypi/controller/rpi/agc.cpp +++ b/src/ipa/raspberrypi/controller/rpi/agc.cpp @@ -157,14 +157,13 @@ Agc::Agc(Controller *controller) exposure_mode_(nullptr), constraint_mode_(nullptr), frame_count_(0), lock_count_(0) { + // Setting status_.total_exposure_value_ to zero initially tells us + // it's not been calculated yet (i.e. Process hasn't yet run). + memset(&status_, 0, sizeof(status_)); ev_ = status_.ev = 1.0; - flicker_period_ = status_.flicker_period = 0.0; - fixed_shutter_ = status_.fixed_shutter = 0; - fixed_analogue_gain_ = status_.fixed_analogue_gain = 0.0; - // set to zero initially, so we can tell it's not been calculated - status_.total_exposure_value = 0.0; - status_.target_exposure_value = 0.0; - status_.locked = false; + flicker_period_ = 0.0; + fixed_shutter_ = 0; + fixed_analogue_gain_ = 0.0; } char const *Agc::Name() const