[libcamera-devel] [PATCH 4/5] libcamera: delayed_controls: Remove spurious no-op queued controls

Naushir Patuck naush at raspberrypi.com
Fri Feb 12 12:33:11 CET 2021


In DelayedControls::applyControls(), the controls queue would be
extended via a no-op control push to fill the intermittent slots with
unchanged control values. This is needed so that we read back unchanged
control values correctly on every frame.

However, there was one additional no-op performed on every frame that is
not required, meaning that any controls queued by the pipeline handler
would have their write delayed by one further frame. The original
StaggeredCtrl did not do this, as it only had one index to manage,
whereas DelayedControls uses two.

Remove this last no-op push so that the pipeline_handler provided
controls would be written on the very next frame if possible.

Signed-off-by: Naushir Patuck <naush at raspberrypi.com>
Reported-by: David Plowman <david.plowman at raspberrypi.com>
Fixes: 3d4b7b005911 ("libcamera: delayed_controls: Add helper for controls that apply with a delay")
---
 src/libcamera/delayed_controls.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libcamera/delayed_controls.cpp b/src/libcamera/delayed_controls.cpp
index fe2606a0d9aa..f140b4b562e7 100644
--- a/src/libcamera/delayed_controls.cpp
+++ b/src/libcamera/delayed_controls.cpp
@@ -257,7 +257,7 @@ void DelayedControls::applyControls(uint32_t sequence)
 
 	writeCount_++;
 
-	while (writeCount_ >= queueCount_) {
+	while (writeCount_ > queueCount_) {
 		LOG(DelayedControls, Debug)
 			<< "Queue is empty, auto queue no-op.";
 		push({});
-- 
2.25.1



More information about the libcamera-devel mailing list