[v2,02/32] libcamera: delayed_controls: Handle missed pushes
diff mbox series

Message ID 20260325151416.2114564-3-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
In unstable systems it can happen, that some sequence numbers are missed
in the IPA. Gracefully handle that situation by queuing no-ops.

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

---

Changes in v2:
- Collected tag
---
 src/libcamera/delayed_controls.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

Patch
diff mbox series

diff --git a/src/libcamera/delayed_controls.cpp b/src/libcamera/delayed_controls.cpp
index 36d1f20a3680..dc3850c0885d 100644
--- a/src/libcamera/delayed_controls.cpp
+++ b/src/libcamera/delayed_controls.cpp
@@ -178,6 +178,15 @@  bool DelayedControls::push(uint32_t sequence, const ControlList &controls)
 			<< " current queue index: " << queueCount_;
 	}
 
+	while (sequence > queueCount_) {
+		LOG(DelayedControls, Warning)
+			<< "Missed push for sequence " << queueCount_
+			<< " Auto queue no-op.";
+		push(queueCount_, {});
+	}
+
+	ASSERT(sequence == queueCount_);
+
 	/* Copy state from previous frame. */
 	for (auto &ctrl : values_) {
 		Info &info = ctrl.second[queueCount_];