[v2,19/32] libcamera: delayed_controls: Ignore double pushes for the same frame number
diff mbox series

Message ID 20260325151416.2114564-20-stefan.klug@ideasonboard.com
State New
Headers show
Series
  • rkisp1: pipeline rework for PFC
Related show

Commit Message

Stefan Klug March 25, 2026, 3:13 p.m. UTC
For successful PFC a single sequence must only be pushed once to delayed
controls. Such a situation can occur if no-ops were pushed in delayed
controls due to a buffer underrun.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>

---

Changes in v2:
- Collated double log message
- Collected tag
---
 src/libcamera/delayed_controls.cpp | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

Patch
diff mbox series

diff --git a/src/libcamera/delayed_controls.cpp b/src/libcamera/delayed_controls.cpp
index 4efe3b39c3f6..bcbce4413456 100644
--- a/src/libcamera/delayed_controls.cpp
+++ b/src/libcamera/delayed_controls.cpp
@@ -173,8 +173,9 @@  bool DelayedControls::push(uint32_t sequence, const ControlList &controls)
 {
 	if (sequence < queueCount_) {
 		LOG(DelayedControls, Warning)
-			<< "Double push for sequence " << sequence
-			<< " current queue index: " << queueCount_;
+			<< "Ignored double push for sequence " << sequence
+			<< ". Current queue index: " << queueCount_;
+		return true;
 	}
 
 	while (sequence > queueCount_) {
@@ -277,7 +278,10 @@  ControlList DelayedControls::get(uint32_t sequence)
  */
 void DelayedControls::applyControls(uint32_t sequence)
 {
-	LOG(DelayedControls, Debug) << "frame " << sequence << " started";
+	LOG(DelayedControls, Debug)
+		<< "Apply controls for: " << sequence
+		<< " (instant controls for frame "
+		<< (sequence - maxDelay_) << ")";
 
 	while (queueCount_ - 1 < sequence) {
 		LOG(DelayedControls, Warning)