summaryrefslogtreecommitdiff
path: root/src/ipa/raspberrypi/controller/rpi/awb.hpp
diff options
context:
space:
mode:
authorDavid Plowman <david.plowman@raspberrypi.com>2021-02-10 17:58:30 +0000
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-02-11 19:14:39 +0200
commitdb55e09b42f87d9a7fde32afc4e0eee90b4c7690 (patch)
treeaaa92af273619220ec683a4a2bf546363ab85cac /src/ipa/raspberrypi/controller/rpi/awb.hpp
parente36a6f40433ce661610f34ed2db31e82e22c579d (diff)
ipa: raspberrypi: AWB: Fix race condition setting manual gains
Applying the manual_r_ and manual_b_ values is entirely removed from the asynchronous thread where their use constituted a race hazard. The main thread now deals with them entirely, involving the following changes. 1. SetManualGains() applies the new values directly to the "sync_results", meaning that Prepare() will jump to the new values immediately (which is a better behaviour). 2. Process() does not restart the asynchronous thread when manual gains are in force. 3. The asynchronous thread might be running when manual gains are set, so we ignore the results produced in this case. Signed-off-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Naushir Patuck <naush@raspberrypi.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/ipa/raspberrypi/controller/rpi/awb.hpp')
-rw-r--r--src/ipa/raspberrypi/controller/rpi/awb.hpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/ipa/raspberrypi/controller/rpi/awb.hpp b/src/ipa/raspberrypi/controller/rpi/awb.hpp
index f113c642..45ba9e25 100644
--- a/src/ipa/raspberrypi/controller/rpi/awb.hpp
+++ b/src/ipa/raspberrypi/controller/rpi/awb.hpp
@@ -108,6 +108,7 @@ public:
};
private:
+ bool isAutoEnabled() const;
// configuration is read-only, and available to both threads
AwbConfig config_;
std::thread async_thread_;