[v1,02/35] libcamera: delayed_controls: Handle missed pushes
diff mbox series

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

Commit Message

Stefan Klug Oct. 24, 2025, 8:50 a.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>
---
 src/libcamera/delayed_controls.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Paul Elder Jan. 22, 2026, 9:14 a.m. UTC | #1
Quoting Stefan Klug (2025-10-24 17:50:26)
> 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>

> ---
>  src/libcamera/delayed_controls.cpp | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/src/libcamera/delayed_controls.cpp b/src/libcamera/delayed_controls.cpp
> index 246e7cefa4e5..e5bdc374fd0e 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_];
> -- 
> 2.48.1
>

Patch
diff mbox series

diff --git a/src/libcamera/delayed_controls.cpp b/src/libcamera/delayed_controls.cpp
index 246e7cefa4e5..e5bdc374fd0e 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_];