From patchwork Thu Feb 4 09:34:51 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 11131 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 EEB19BD162 for ; Thu, 4 Feb 2021 09:35:05 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 3CD0861402; Thu, 4 Feb 2021 10:35:04 +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="e6cAFuvy"; dkim-atps=neutral Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 84ED760107 for ; Thu, 4 Feb 2021 10:35:02 +0100 (CET) Received: by mail-wm1-x32e.google.com with SMTP id f16so2475453wmq.5 for ; Thu, 04 Feb 2021 01:35:02 -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=I7i7fBZpiVuIH5sFk+yyLknlBa9tcpZHROKD240TfvU=; b=e6cAFuvyHAK0LRHwNPMYqkiK3o6Shr8/6/j/1Go/bMTy0upWIcC3WsCSGEH63BBRhk yidwGnaSpqRS5+fBLwVxxLQtW/vFJmKZlq+w2rGVmLR0RxfanrOrgbNblEIDFZ1V/xgx e7GU0d+Ohp5PH0ESzADZ6hrwnLPaxDekMjabfK2IddzmJIuujHBePkzWFLyPB/VydX51 pPOf0R+lvMcc3nEdjc6kD/QsxsYanRiu04Ty2WJhbNVLUaFGwlgb3WrS4dDSjZQkUvUS QS3RQDjWFoD8novVtCKgkf13M/Vs+Zm/b3QsFAuMFSZbnetZcC3g3nvOk5HwZEYQnEry hG3A== 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=I7i7fBZpiVuIH5sFk+yyLknlBa9tcpZHROKD240TfvU=; b=t4aSm8g9kYo/NcgXb6F9HgwEtCXRFIOgrynBoa//YMFUkKhT9/Pej7Atth6fiu5/jR l/kIe+NiTGqr4TvwqccLlBgRhkEfivBIotyCDmP5H/nvKA29dsxoyBk/RKdR5gTUuID7 Ik9JgHqS4uvgDCkWZJ8Zqs5sCf+7XfAu501h8DOCLX5igle3gDbzdfW/bGtPubSGeEM7 oLVB6s9cErBR3yINiyGwp5qsOlbqhOQ4elWqzZ4FtTbnz+qNJotUZ7L5Nuo3pLPsnkcn EWRU6v9cPInYzae10X0EbxtQKOItLOiB/Wzp3RhMyqhXGyMGaV2nhc2abj18HOSdC+8y PiGA== X-Gm-Message-State: AOAM5315Brzq0I14riaGaKd7clh/z9P8s5KpqFLLwGSs9DvbrRbccV4q +CEVrejLD0i62rTMxt9F2Smo340tNADlxWrT X-Google-Smtp-Source: ABdhPJzM2fvNWcUF2McMbZO8DufnLBkRT1tAp3qNJpA+ApqaZ9354WuQjZ8dLfAcjCejUZWJumw9qw== X-Received: by 2002:a1c:2501:: with SMTP id l1mr6541055wml.41.1612431301911; Thu, 04 Feb 2021 01:35:01 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id g16sm5280580wmi.30.2021.02.04.01.35.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Feb 2021 01:35:01 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Thu, 4 Feb 2021 09:34:51 +0000 Message-Id: <20210204093457.6879-2-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210204093457.6879-1-david.plowman@raspberrypi.com> References: <20210204093457.6879-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 1/7] ipa: raspberrypi: AWB: Remove unnecessary locking for AWB settings 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" AWB settings get updated synchronously with the main thread, so the settings_mutex_ and associated locking can be removed. Signed-off-by: David Plowman Reviewed-by: Laurent Pinchart --- src/ipa/raspberrypi/controller/rpi/awb.cpp | 18 +++++------------- src/ipa/raspberrypi/controller/rpi/awb.hpp | 4 +--- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/src/ipa/raspberrypi/controller/rpi/awb.cpp b/src/ipa/raspberrypi/controller/rpi/awb.cpp index 62337b13..dabab726 100644 --- a/src/ipa/raspberrypi/controller/rpi/awb.cpp +++ b/src/ipa/raspberrypi/controller/rpi/awb.cpp @@ -185,13 +185,11 @@ unsigned int Awb::GetConvergenceFrames() const void Awb::SetMode(std::string const &mode_name) { - std::unique_lock lock(settings_mutex_); mode_name_ = mode_name; } void Awb::SetManualGains(double manual_r, double manual_b) { - std::unique_lock lock(settings_mutex_); // If any of these are 0.0, we swich back to auto. manual_r_ = manual_r; manual_b_ = manual_b; @@ -229,14 +227,13 @@ void Awb::fetchAsyncResults() sync_results_ = async_results_; } -void Awb::restartAsync(StatisticsPtr &stats, std::string const &mode_name, - double lux) +void Awb::restartAsync(StatisticsPtr &stats, double lux) { LOG(RPiAwb, Debug) << "Starting AWB calculation"; // this makes a new reference which belongs to the asynchronous thread statistics_ = stats; // store the mode as it could technically change - auto m = config_.modes.find(mode_name); + auto m = config_.modes.find(mode_name_); mode_ = m != config_.modes.end() ? &m->second : (mode_ == nullptr ? config_.default_mode : mode_); @@ -244,8 +241,8 @@ void Awb::restartAsync(StatisticsPtr &stats, std::string const &mode_name, frame_phase_ = 0; async_start_ = true; async_started_ = true; - size_t len = mode_name.copy(async_results_.mode, - sizeof(async_results_.mode) - 1); + size_t len = mode_name_.copy(async_results_.mode, + sizeof(async_results_.mode) - 1); async_results_.mode[len] = '\0'; async_signal_.notify_one(); } @@ -294,11 +291,6 @@ void Awb::Process(StatisticsPtr &stats, Metadata *image_metadata) if (frame_phase_ >= (int)config_.frame_period || frame_count2_ < (int)config_.startup_frames) { // Update any settings and any image metadata that we need. - std::string mode_name; - { - std::unique_lock lock(settings_mutex_); - mode_name = mode_name_; - } struct LuxStatus lux_status = {}; lux_status.lux = 400; // in case no metadata if (image_metadata->Get("lux.status", lux_status) != 0) @@ -307,7 +299,7 @@ void Awb::Process(StatisticsPtr &stats, Metadata *image_metadata) std::unique_lock lock(mutex_); if (async_started_ == false) - restartAsync(stats, mode_name, lux_status.lux); + restartAsync(stats, lux_status.lux); } } diff --git a/src/ipa/raspberrypi/controller/rpi/awb.hpp b/src/ipa/raspberrypi/controller/rpi/awb.hpp index 83b81498..1b39ab4b 100644 --- a/src/ipa/raspberrypi/controller/rpi/awb.hpp +++ b/src/ipa/raspberrypi/controller/rpi/awb.hpp @@ -134,11 +134,9 @@ private: AwbStatus sync_results_; AwbStatus prev_sync_results_; std::string mode_name_; - std::mutex settings_mutex_; // The following are for the asynchronous thread to use, though the main // thread can set/reset them if the async thread is known to be idle: - void restartAsync(StatisticsPtr &stats, std::string const &mode_name, - double lux); + void restartAsync(StatisticsPtr &stats, double lux); // copy out the results from the async thread so that it can be restarted void fetchAsyncResults(); StatisticsPtr statistics_; From patchwork Thu Feb 4 09:34:52 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 11132 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 31B7EBD162 for ; Thu, 4 Feb 2021 09:35:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 1582261418; Thu, 4 Feb 2021 10:35:06 +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="PiO+gqTT"; dkim-atps=neutral Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5A5D861402 for ; Thu, 4 Feb 2021 10:35:03 +0100 (CET) Received: by mail-wr1-x435.google.com with SMTP id d16so2608176wro.11 for ; Thu, 04 Feb 2021 01:35:03 -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=abXjeJ8fOOsHiqXb1xOtDpFUgjWFPczUiRCmefqAMUI=; b=PiO+gqTTLFmGgUibscrhewkUs73YtI9ZyQY5l2AMekf7OZ0q1qzlbgaNX6NqKmaPOA oQHQW9Ub2HoG0zZhiWAr2jQFg6/VRtq/ORwI9Yclb4C2xD23FIiVeZ/h9dCa2fntOX/3 XKm1sd4r5AarEYQUjKAMsQkfkJQ+MfkTdwIVHI9dUmSze1VovQzGrAdPAo5LxMM8a2ug C1wog48FNMrTPREu1HrXSOHVSjVzNRAGj0EPYrie3gJucwpuAKaqN6U+kQ01H+BcNrk2 bRAkmRCDqcaJeV6v9wndlUiHp+1hWF0L99qUvSAekVyodLBePo0BzUjcNOunwnFU7eO0 M8zg== 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=abXjeJ8fOOsHiqXb1xOtDpFUgjWFPczUiRCmefqAMUI=; b=icQzt6iBKoTSDsgilxW0RD5RERl9ySfLyawSZ5D39iGujL1deUz9euSNP6fDZKjKg8 eF4C/EaiYhETOaiziB6WI2o9aqC12oqu0tJmN2edTaqod+q8ZSPydChbu9EMnYwr3xAE 8nh4+cJPM61Pd/kBi2G52Ce02ivViLZnxIgjFnACecQgTr8EmhwOWS2BcbNOvkBd7Pbs vX1Z3tgfaloiXKKLhRAEjsbSU3Us/vH5fhciwg/dX6RHsWcSaduoHLM3eGc6yZNGmyT/ tQ7PiuNZFVUb+hw2qMj20N1TWTKXRgOk9e1kYIrfNGrXuBO0fo4d4//1W7AcCiZKjvP/ oJnA== X-Gm-Message-State: AOAM532xlK3hJvKyci1rK10npp3bjXDaXH6F05utl3zr9n2ZJGcGP/sg RQyBcAVpGIBc+wg+Us98kju0QNDjRQWutfQk X-Google-Smtp-Source: ABdhPJzoH5zl5rW6rHnNYJGnW2h60I0jgpS+TLruADGDiDeW06g6KJM3JAKPTCN7tel/p4ShyIA+Ww== X-Received: by 2002:a5d:47af:: with SMTP id 15mr8229570wrb.205.1612431302757; Thu, 04 Feb 2021 01:35:02 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id g16sm5280580wmi.30.2021.02.04.01.35.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Feb 2021 01:35:02 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Thu, 4 Feb 2021 09:34:52 +0000 Message-Id: <20210204093457.6879-3-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210204093457.6879-1-david.plowman@raspberrypi.com> References: <20210204093457.6879-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 2/7] ipa: raspberrypi: AWB: Improve locking. 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" Fix a couple of places where notify_one() was called with the lock held. Also restartAsync doesn't need the lock for its entire duration. This change exactly matches commit db552b where we do the same for ALSC (the asynchronous thread arrangement there is identical). Signed-off-by: David Plowman Reviewed-by: Laurent Pinchart --- src/ipa/raspberrypi/controller/rpi/awb.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/ipa/raspberrypi/controller/rpi/awb.cpp b/src/ipa/raspberrypi/controller/rpi/awb.cpp index dabab726..791b5108 100644 --- a/src/ipa/raspberrypi/controller/rpi/awb.cpp +++ b/src/ipa/raspberrypi/controller/rpi/awb.cpp @@ -136,8 +136,8 @@ Awb::~Awb() { std::lock_guard lock(mutex_); async_abort_ = true; - async_signal_.notify_one(); } + async_signal_.notify_one(); async_thread_.join(); } @@ -239,11 +239,14 @@ void Awb::restartAsync(StatisticsPtr &stats, double lux) : (mode_ == nullptr ? config_.default_mode : mode_); lux_ = lux; frame_phase_ = 0; - async_start_ = true; async_started_ = true; size_t len = mode_name_.copy(async_results_.mode, sizeof(async_results_.mode) - 1); async_results_.mode[len] = '\0'; + { + std::lock_guard lock(mutex_); + async_start_ = true; + } async_signal_.notify_one(); } @@ -297,7 +300,6 @@ void Awb::Process(StatisticsPtr &stats, Metadata *image_metadata) LOG(RPiAwb, Debug) << "No lux metadata found"; LOG(RPiAwb, Debug) << "Awb lux value is " << lux_status.lux; - std::unique_lock lock(mutex_); if (async_started_ == false) restartAsync(stats, lux_status.lux); } @@ -319,8 +321,8 @@ void Awb::asyncFunc() { std::lock_guard lock(mutex_); async_finished_ = true; - sync_signal_.notify_one(); } + sync_signal_.notify_one(); } } From patchwork Thu Feb 4 09:34:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 11133 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 E343BBD162 for ; Thu, 4 Feb 2021 09:35:07 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 742F761422; Thu, 4 Feb 2021 10:35:07 +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="lrIbvjC4"; dkim-atps=neutral Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 1017761404 for ; Thu, 4 Feb 2021 10:35:04 +0100 (CET) Received: by mail-wr1-x42f.google.com with SMTP id u14so2685975wri.3 for ; Thu, 04 Feb 2021 01:35:04 -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=gBTFzAW/1hF57reoTu/2os27+DX/gEecEzMfr1mtMnQ=; b=lrIbvjC4KuxkQ2hQqkq0+Q7YKz9zIPKKc2Jp9uF66udVFQ9itrfcHvfSf2a66mul8Q QciRi6CCEwBlC89BbOZb96oc5o03rbx3Q178xErBDB/flf2GVQTFlk9cTxuEdjSVQhpv p3k4wN887kMlg8naoun6VoCtqn0DxnfVw9JbSsZc4OmZ6V7yDI/6DilfEg8fIJ3Zdbzl 35xfsXEDxrbGXdFZCo679xuAUzoApnjvG9GSD2E/QXrjyx5P0jrCc7ZIS4GbAPoqbayS 7muriRJKVLfzY+wBv+AVgXp7mW6RQ7kvGQVMM8pGGLe4fypyWzXizkjxKZLE7vJIP42c QzcQ== 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=gBTFzAW/1hF57reoTu/2os27+DX/gEecEzMfr1mtMnQ=; b=Y1ShG7yWiZ8YJIQ1+adOEHvTyplo56gCPEL4S4aCMi39Ez7Dz0Bx1fsRssB3YFXFiB kW4DO1KxwuBRTOO3nCnrMtQyEsZhb//OjfHNMoOrxDdubK/ulkNPGYY8laSMcE4hff6V XM3hMfRZ4RaHDDrSKC+jLlduRiCOg9YnNVC+fvBJV8XPWbvavs4+1UfG+CtQzba42cmg +JYb6Z+mtudcIdKZm/s5MXhtwhBRgfL4EVp2Hc1vqtzM+bHZOuxdQU4o2ZrwDgChw1sR aaIRYlfavRFBM5Gw/WvrEOq9nhGhjyUQLXgElDkW5FXfSaHNIfBO+Y/fh5Vo6PzMNRUW x86Q== X-Gm-Message-State: AOAM530g5R4KXcq8t+vL8p4m9kG9maPMT7ackEM9h6zAUdmOjYbQ2vXY 4WKyoWXhVdh+nTI8zjQNW4oZgYhZTQ9R7zzj X-Google-Smtp-Source: ABdhPJxhvTDmLL+vB749bIbgn1m9T88kZf7Ju/ICoHOP+VC8Y4viZu0z+Xd2E8UeyUrvzdCTCFW+6A== X-Received: by 2002:a5d:4dd0:: with SMTP id f16mr8235254wru.304.1612431303647; Thu, 04 Feb 2021 01:35:03 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id g16sm5280580wmi.30.2021.02.04.01.35.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Feb 2021 01:35:03 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Thu, 4 Feb 2021 09:34:53 +0000 Message-Id: <20210204093457.6879-4-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210204093457.6879-1-david.plowman@raspberrypi.com> References: <20210204093457.6879-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 3/7] ipa: raspberrypi: ccm: Remove unnecessary atomic variable 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" SetSaturation() gets called synchronously so there is no need for saturation_ to be atomic. Signed-off-by: David Plowman Reviewed-by: Laurent Pinchart --- src/ipa/raspberrypi/controller/rpi/ccm.hpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/ipa/raspberrypi/controller/rpi/ccm.hpp b/src/ipa/raspberrypi/controller/rpi/ccm.hpp index fcf077e7..330ed51f 100644 --- a/src/ipa/raspberrypi/controller/rpi/ccm.hpp +++ b/src/ipa/raspberrypi/controller/rpi/ccm.hpp @@ -7,7 +7,6 @@ #pragma once #include -#include #include "../ccm_algorithm.hpp" #include "../pwl.hpp" @@ -70,7 +69,7 @@ public: private: CcmConfig config_; - std::atomic saturation_; + double saturation_; }; } // namespace RPiController From patchwork Thu Feb 4 09:34:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 11134 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 6FFB4BD162 for ; Thu, 4 Feb 2021 09:35:08 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id CFDA861425; Thu, 4 Feb 2021 10:35:07 +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="pWF4egGt"; dkim-atps=neutral Received: from mail-wr1-x433.google.com (mail-wr1-x433.google.com [IPv6:2a00:1450:4864:20::433]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 02EBA61413 for ; Thu, 4 Feb 2021 10:35:04 +0100 (CET) Received: by mail-wr1-x433.google.com with SMTP id z6so2619312wrq.10 for ; Thu, 04 Feb 2021 01:35:04 -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=qrlk1z5ecjKEw43jec01YanZO3wmUgfvHSyZL+t2pMg=; b=pWF4egGt+B5Dkxh71zypPw8zloFIs9LZeqDMtav+Lucp/37gvkqG1NpUGkadiBGkPt 2OlT7PDljdOcvy5m2m1m4oneqjnFfln7LidYoTARdRH5x/oZ+JaX45jUDaUijkAta2qZ evvbQezKXFUEsbrf6Bjb4eFFUQgmPxwPxDccBr3zQBtuG7eIWtWfHIfF40kJcMs2wdQR QGrtA3NHkYv50+UB5ljDSHa3hnFEIhxlv6Sl5sko3Xv5yGjLd79hQNzPQU/zQfkWVU+Z V2V4o5aLsGtBxc47g562yeJUf1aQk6J0BD+tWKl+Zkfc7a+c7SrANUchhC67SNabSOqw MqEw== 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=qrlk1z5ecjKEw43jec01YanZO3wmUgfvHSyZL+t2pMg=; b=rn4TwVyOcPg+Bl6kfX99UiO4drOFOltZMnsNqcaiQyp8Xi6cE8113VzXzB2O1SabaL zodbryWFzWSpHhoZ0qwfuzTBOqbxDM9vbAvko5bxQlYzoIzC/nlVEUmBg5JNv5iUgs0Q hPRR4Bw4eroZTSsAn68M/ZxbFz1xzIIDirE1lEcoW2kYFP2olCgsGluPf4MYEcvNijB0 M7R4WLw3W1IX0NAwiwWuuRtM8ykrqECtRkRLR8ilcbRtub2/nSt/Td+MQ6vI+XSYoMm7 q1Jifyo9VgA8uU00RbaGSc635AvVgy3pahJcUn3Zk7mJRrhWyQQqUBU9+ND7Q38dX0FV /bFA== X-Gm-Message-State: AOAM531zetTe0IESzK5yMpqVRIeU8g4nw5qvqykWcbDeAUFEgv0XHCyk Jg6luVIikvhy/vbYcOH1SE1JbwTFrUpzqF0n X-Google-Smtp-Source: ABdhPJx142e8s2wtlBp9MHBJ6tDsPtfn1X2XS72pbTD2hBjw+kqvFm8XGnRygS9fy6EB6wxC8gcEog== X-Received: by 2002:adf:d850:: with SMTP id k16mr8226194wrl.191.1612431304425; Thu, 04 Feb 2021 01:35:04 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id g16sm5280580wmi.30.2021.02.04.01.35.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Feb 2021 01:35:03 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Thu, 4 Feb 2021 09:34:54 +0000 Message-Id: <20210204093457.6879-5-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210204093457.6879-1-david.plowman@raspberrypi.com> References: <20210204093457.6879-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 4/7] ipa: rasberrypi: contrast: Remove unnecessary atomic variables 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" SetBrightness() and SetContrast() are only called synchronously so there is no need for brightness_ and contrast_ to be atomic. Signed-off-by: David Plowman Reviewed-by: Laurent Pinchart --- src/ipa/raspberrypi/controller/rpi/contrast.cpp | 9 ++++----- src/ipa/raspberrypi/controller/rpi/contrast.hpp | 5 ++--- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/ipa/raspberrypi/controller/rpi/contrast.cpp b/src/ipa/raspberrypi/controller/rpi/contrast.cpp index 05ed139f..2bc43027 100644 --- a/src/ipa/raspberrypi/controller/rpi/contrast.cpp +++ b/src/ipa/raspberrypi/controller/rpi/contrast.cpp @@ -150,7 +150,6 @@ Pwl apply_manual_contrast(Pwl const &gamma_curve, double brightness, void Contrast::Process(StatisticsPtr &stats, [[maybe_unused]] Metadata *image_metadata) { - double brightness = brightness_, contrast = contrast_; Histogram histogram(stats->hist[0].g_hist, NUM_HISTOGRAM_BINS); // We look at the histogram and adjust the gamma curve in the following // ways: 1. Adjust the gamma curve so as to pull the start of the @@ -165,13 +164,13 @@ void Contrast::Process(StatisticsPtr &stats, } // 2. Finally apply any manually selected brightness/contrast // adjustment. - if (brightness != 0 || contrast != 1.0) - gamma_curve = apply_manual_contrast(gamma_curve, brightness, - contrast); + if (brightness_ != 0 || contrast_ != 1.0) + gamma_curve = apply_manual_contrast(gamma_curve, brightness_, + contrast_); // And fill in the status for output. Use more points towards the bottom // of the curve. ContrastStatus status; - fill_in_status(status, brightness, contrast, gamma_curve); + fill_in_status(status, brightness_, contrast_, gamma_curve); { std::unique_lock lock(mutex_); status_ = status; diff --git a/src/ipa/raspberrypi/controller/rpi/contrast.hpp b/src/ipa/raspberrypi/controller/rpi/contrast.hpp index 6836f181..85624539 100644 --- a/src/ipa/raspberrypi/controller/rpi/contrast.hpp +++ b/src/ipa/raspberrypi/controller/rpi/contrast.hpp @@ -6,7 +6,6 @@ */ #pragma once -#include #include #include "../contrast_algorithm.hpp" @@ -42,8 +41,8 @@ public: private: ContrastConfig config_; - std::atomic brightness_; - std::atomic contrast_; + double brightness_; + double contrast_; ContrastStatus status_; std::mutex mutex_; }; From patchwork Thu Feb 4 09:34:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 11135 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 90604BD162 for ; Thu, 4 Feb 2021 09:35:09 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 5CE1961429; Thu, 4 Feb 2021 10:35:09 +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="tYGj8P8X"; dkim-atps=neutral Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id DF02961404 for ; Thu, 4 Feb 2021 10:35:05 +0100 (CET) Received: by mail-wr1-x429.google.com with SMTP id g10so2700777wrx.1 for ; Thu, 04 Feb 2021 01:35:05 -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=pP7sGJGC3/Dlj6wlhh7yuZ9LtQ3CKVVkcL3Zmsk3Bd0=; b=tYGj8P8XP8kSfiWuBJzozd0Fu6aM8rxqfuu9RAMQ3GVQil+6TDphOFy6RHBdBkMl0n IuLqGOu0XLtFZvHVqM3aGnVKs+Oe9lrJJOX2+rG3Nbb8xekp54i//K9XGxg6C5gdQ0Ju do5MKZ7fRwAD4f7YBmwVSqzwe8ItxxllzJVK/tNeo1Lj52zy+Y1vTZdzYKOnyZo9mUoo t1Bhdz6LB7KITeoARZQRLIKv/L+E3t0nJlMR7UB1LYPM5w6BlYUlRfeOFvZeJXorQSzu sV7fqWzmMQKOH2pQm07Jklv1XxIDMxb+MmaKo/JPYk9/eHHCXP+plsgC2wmmk40dyrgY d4rw== 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=pP7sGJGC3/Dlj6wlhh7yuZ9LtQ3CKVVkcL3Zmsk3Bd0=; b=Fj+vZs1ElWIXuUtRiL+meHQT2ygWQT7EU03+hZha+iBMeBRaKX1cV+rgbih37GxtwP 2osQDcwa6iwfye35DZRZVGWCEvvdyBpEeMpQ3jgm0qF+Aqdh6wPxTKoXVyGI7lnLaMUx GNRKQpwWgfjzFYQ9fJB2H895uPRiDPi7MNZBVP54BsxJ4o6MwdE3spNUxtBTcIRYwOZN DHBHLRZovVLOpzwo4x+y9v9Xd1PzQRWLYiaUI5uxDQrXJpMnHyblg6kWLKvU2Q8eopzr 0caKEzP9CijRZ5FVrHBjVt6Y6KtCLHn9OsSt1v0kbuZBtf8QeTLtS1CXB+8VKCUw2HdT aN3g== X-Gm-Message-State: AOAM532Cw5btRRlT7w9Q62OMigIVBHBfFXMsZ2MPWc19H1+TIuDKwVto c1pUC7NxAlPHyyVilQr2YV2RHe9fQBcwFEH6 X-Google-Smtp-Source: ABdhPJzAGf8vcD1OXOO+IfSnyKQzCJ3KeLeibnREJTLfh0256x7k84BrqSyEx13J00sbM5K1D6NEdA== X-Received: by 2002:adf:fc88:: with SMTP id g8mr8015694wrr.259.1612431305207; Thu, 04 Feb 2021 01:35:05 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id g16sm5280580wmi.30.2021.02.04.01.35.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Feb 2021 01:35:04 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Thu, 4 Feb 2021 09:34:55 +0000 Message-Id: <20210204093457.6879-6-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210204093457.6879-1-david.plowman@raspberrypi.com> References: <20210204093457.6879-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 5/7] ipa: raspberrypi: noise: Remove unnecessary atomic variable 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" mode_factor_ does not need to be atomic - it is set by SwitchMode() which runs synchronously. Signed-off-by: David Plowman Reviewed-by: Laurent Pinchart --- src/ipa/raspberrypi/controller/rpi/noise.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ipa/raspberrypi/controller/rpi/noise.hpp b/src/ipa/raspberrypi/controller/rpi/noise.hpp index 6f6e0be9..1c9de5c8 100644 --- a/src/ipa/raspberrypi/controller/rpi/noise.hpp +++ b/src/ipa/raspberrypi/controller/rpi/noise.hpp @@ -26,7 +26,7 @@ private: // the noise profile for analogue gain of 1.0 double reference_constant_; double reference_slope_; - std::atomic mode_factor_; + double mode_factor_; }; } // namespace RPiController From patchwork Thu Feb 4 09:34:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 11136 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 00C72BD162 for ; Thu, 4 Feb 2021 09:35:10 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id C066B6141D; Thu, 4 Feb 2021 10:35:09 +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="p4imPPgj"; dkim-atps=neutral Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 780E861414 for ; Thu, 4 Feb 2021 10:35:06 +0100 (CET) Received: by mail-wr1-x432.google.com with SMTP id m13so2616510wro.12 for ; Thu, 04 Feb 2021 01:35:06 -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=W0ndmTmLHTj+yjrjIbV9XFfDITNN9s+r1ID3eo4YSJY=; b=p4imPPgjZfCtEMbzauzuSbKgbpmYv6jlBy//gfQkxCxlWLbRFcfrr7FtnVrN4vGgot 63Vqw1TdIU+nwOSnsiFgh2dzayJBCmS07wInEdheY/FaO2DGyqXVUcogFmzWqxD6m2gu DOgfXOZiMEGQ0ouPVG0v2M4XUnyA2aJPdK5aA3NI7hnzsFoHAniXAODpBfX3+ZaIBNW7 xQxVCKuPz/YhtI1UrcpJoovNiCAzjt78muz0eHFGzmXrS5g7yQlC+go+Fi7zKGWzpnde by8fZRMVtPZGq1j6tAIkio3TQjkxmI+98Z2iBr1qPYnYbhS03oyqNFJYz+QIMansBKF5 iRaQ== 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=W0ndmTmLHTj+yjrjIbV9XFfDITNN9s+r1ID3eo4YSJY=; b=Pftn5ZOP2O8xOUGpN+PsT9rUOG5ItAOq4MWHM5MCyywF2RfX1IW4fyBzkGVc5WzE2b NpVV6qCWYR92S6Ggn/rwAzEX9j5y5V/Sz9lsSKkn19NbkNix9pT4Y9O5WIF/JjE6hyOE SlOcTWi8GKSnGLK0NBmh+nMJJ3Rgh3kdD5/qfWi0zt6ayAnUJNC5ctX6F0+Udclo2Ic0 4wFJ0d7bVoga/e7UWGPdeHs5ezTeeJeBgEdJdFkof8c23ckrfT3aDHdbf0v6BBlEQkoW JN4SMdbkEzbxV400ITN7eN7Qp9frgkbwtWDaYAk4d/6jfqQM59ZwXMmHrOYafbU3wDqs T20Q== X-Gm-Message-State: AOAM532YipSJY/zIaZyBaxIuKQe40SeoNbZLph2ENyaWhCoRgMSpWlrX dLFrVKdF5qPj5PzKj4e8nZRpusIZnrp6gmSK X-Google-Smtp-Source: ABdhPJzyi8XSi3yLTYPUAZMtM61Drzdxr6uyaoKx6HMmxB1nRsYeC0Meoa4On2W4Pt0sgEwbczz/Qw== X-Received: by 2002:a5d:640c:: with SMTP id z12mr8280944wru.342.1612431305970; Thu, 04 Feb 2021 01:35:05 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id g16sm5280580wmi.30.2021.02.04.01.35.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Feb 2021 01:35:05 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Thu, 4 Feb 2021 09:34:56 +0000 Message-Id: <20210204093457.6879-7-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210204093457.6879-1-david.plowman@raspberrypi.com> References: <20210204093457.6879-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 6/7] ipa: raspberrypi: lux: Supply missing method and remove atomic variable 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" Supply the missing SetCurrentAperture() method (even though no one is calling it). If we did call it, it would be called synchronously so the atomic variable is not required. Signed-off-by: David Plowman Reviewed-by: Laurent Pinchart --- src/ipa/raspberrypi/controller/rpi/lux.cpp | 5 +++++ src/ipa/raspberrypi/controller/rpi/lux.hpp | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/ipa/raspberrypi/controller/rpi/lux.cpp b/src/ipa/raspberrypi/controller/rpi/lux.cpp index aefd92d4..f74381ca 100644 --- a/src/ipa/raspberrypi/controller/rpi/lux.cpp +++ b/src/ipa/raspberrypi/controller/rpi/lux.cpp @@ -46,6 +46,11 @@ void Lux::Read(boost::property_tree::ptree const ¶ms) current_aperture_ = reference_aperture_; } +void Lux::SetCurrentAperture(double aperture) +{ + current_aperture_ = aperture; +} + void Lux::Prepare(Metadata *image_metadata) { std::unique_lock lock(mutex_); diff --git a/src/ipa/raspberrypi/controller/rpi/lux.hpp b/src/ipa/raspberrypi/controller/rpi/lux.hpp index 7b6c7258..f9090484 100644 --- a/src/ipa/raspberrypi/controller/rpi/lux.hpp +++ b/src/ipa/raspberrypi/controller/rpi/lux.hpp @@ -6,7 +6,6 @@ */ #pragma once -#include #include #include "../lux_status.h" @@ -34,7 +33,7 @@ private: double reference_aperture_; // units of 1/f double reference_Y_; // out of 65536 double reference_lux_; - std::atomic current_aperture_; + double current_aperture_; LuxStatus status_; std::mutex mutex_; }; From patchwork Thu Feb 4 09:34:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Plowman X-Patchwork-Id: 11137 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 57CA6BD163 for ; Thu, 4 Feb 2021 09:35:10 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 2222D6142E; Thu, 4 Feb 2021 10:35:10 +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="mtaYI8Lh"; dkim-atps=neutral Received: from mail-wm1-x32f.google.com (mail-wm1-x32f.google.com [IPv6:2a00:1450:4864:20::32f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 3189A6141D for ; Thu, 4 Feb 2021 10:35:07 +0100 (CET) Received: by mail-wm1-x32f.google.com with SMTP id j11so2492894wmi.3 for ; Thu, 04 Feb 2021 01:35:07 -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=kLdoAI0DrQKDp9rJnYmfItefNZa1u0XSjvvtceMdilg=; b=mtaYI8Lhw2J5yWBvlyOv7WNb1YMyhKfkcMa73xshr+RgMez1YkEPB47WzXE4yihst9 b3N3JadL5bpl0AoewMj/1ay5J8aijQMgvm9fDz0NjQC1Il5M/PuxM1q2JVTPB3QSjMCO ajLyglZ8WO2uMEMp4moT06mE3QvUgwYETOpajnvwjtlFsaiu798THxcY5jXtKZZn0zTy MR8EEQwOJEiilaa5ZkrcCdPBAoe7m4b1GxnR82DRk1SjCU4P49k8xNJaPTVecC3SBTYb gtseqZWcCzzwNldOaBKLQglV1Ps3gqX9ANTrD9biNd10qdYU+m+yFARqFMgf9a9dBIMS /VsA== 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=kLdoAI0DrQKDp9rJnYmfItefNZa1u0XSjvvtceMdilg=; b=e56CtfVZMr7rO+rvPdbOwCnhGCu9rJMkI+qRRK57JTK6eBIsKsTJwrzod93AVLUknp R7l8T4w/DorH3rP6fTCC28n1uBk919ejeXE/V8+GPm9Uji74ZLD4LFyxFgwwh+ijDlmO mWcfWPDGTbNkRWobQlaWErMcF5TjJa6sd8uyH8Ei2pwIijxRQz0H8c5ZndUoFJqXjC1S Rucktr7BQxKTR1yVmSZd8ahN70XdYKGykNA7jgXePqmJhMNeldJUR2SQlJ/ScZUV75m3 iWZgT3zxDlYii0HTTIjSU6d3yqtlCWC0YXKEhN0TKUEmWcbRdAsGrAGSu/PZakJwqOj4 +VlQ== X-Gm-Message-State: AOAM5327HlP7Eiw2eubKUuPBQejXq//5BKAIFlxYQ/7E3Y//D8AtiQI3 Teopg5SnOP09sRuOboht4UwYULJUo8rGT2x3 X-Google-Smtp-Source: ABdhPJxS++qU2lTHWIzBEYgK01KXgUc/QdN79xH0HQTjYuGaMq/yEFdOPuuBobzqjbY/Go9Wv7LiJA== X-Received: by 2002:a1c:99d1:: with SMTP id b200mr6610206wme.37.1612431306701; Thu, 04 Feb 2021 01:35:06 -0800 (PST) Received: from pi4-davidp.lan (plowpeople3.plus.com. [80.229.223.72]) by smtp.gmail.com with ESMTPSA id g16sm5280580wmi.30.2021.02.04.01.35.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Feb 2021 01:35:06 -0800 (PST) From: David Plowman To: libcamera-devel@lists.libcamera.org Date: Thu, 4 Feb 2021 09:34:57 +0000 Message-Id: <20210204093457.6879-8-david.plowman@raspberrypi.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210204093457.6879-1-david.plowman@raspberrypi.com> References: <20210204093457.6879-1-david.plowman@raspberrypi.com> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH 7/7] ipa: raspberrypi: Remove atomic variable from Algorithm class 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" Pause() and Resume() are only called synchronously so paused_ does not need to be atomic. With this commit, libatomic can finally be removed as a build dependency. Signed-off-by: David Plowman --- src/ipa/raspberrypi/controller/algorithm.hpp | 3 +-- src/ipa/raspberrypi/meson.build | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/ipa/raspberrypi/controller/algorithm.hpp b/src/ipa/raspberrypi/controller/algorithm.hpp index e9b040c7..5123c87b 100644 --- a/src/ipa/raspberrypi/controller/algorithm.hpp +++ b/src/ipa/raspberrypi/controller/algorithm.hpp @@ -12,7 +12,6 @@ #include #include #include -#include #include "controller.hpp" @@ -46,7 +45,7 @@ public: private: Controller *controller_; - std::atomic paused_; + bool paused_; }; // This code is for automatic registration of Front End algorithms with the diff --git a/src/ipa/raspberrypi/meson.build b/src/ipa/raspberrypi/meson.build index 9445cd09..4cdd0434 100644 --- a/src/ipa/raspberrypi/meson.build +++ b/src/ipa/raspberrypi/meson.build @@ -5,7 +5,6 @@ ipa_name = 'ipa_rpi' rpi_ipa_deps = [ libcamera_dep, dependency('boost'), - libatomic, ] rpi_ipa_includes = [