[v3,19/41] ipa: rkisp1: Allow processStats() to be called without stats buffer
diff mbox series

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

Commit Message

Stefan Klug Sept. 14, 2026, 2:02 p.m. UTC
When there are no stats available for a frame, it still makes sense to
call processStats() to fill in the metadata of that frame. This
mechanism is already used for the raw path. Allow it's use for non-raw
also.

The current code never produces buffers with id 0, but it is not
enforced. Add a assert to enforce that.

Signed-off-by: Stefan Klug <stefan.klug@ideasonboard.com>

---

Changes in v2:
- Added an assert to ensure there is no buffer with id 0
---
 src/ipa/rkisp1/rkisp1.cpp | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch
diff mbox series

diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp
index fe1a42af36a3..08b7dde6b2de 100644
--- a/src/ipa/rkisp1/rkisp1.cpp
+++ b/src/ipa/rkisp1/rkisp1.cpp
@@ -263,6 +263,9 @@  int IPARkISP1::configure(const IPAConfigInfo &ipaConfig,
 void IPARkISP1::mapBuffers(const std::vector<IPABuffer> &buffers)
 {
 	for (const IPABuffer &buffer : buffers) {
+		/* A buffer id of 0 is considered invalid */
+		ASSERT(buffer.id != 0);
+
 		auto elem = buffers_.emplace(std::piecewise_construct,
 					     std::forward_as_tuple(buffer.id),
 					     std::forward_as_tuple(buffer.planes));
@@ -338,7 +341,7 @@  void IPARkISP1::processStats(const uint32_t frame, const uint32_t bufferId,
 	 * provided.
 	 */
 	const rkisp1_stat_buffer *stats = nullptr;
-	if (!context_.configuration.raw)
+	if (bufferId != 0)
 		stats = reinterpret_cast<rkisp1_stat_buffer *>(
 			mappedBuffers_.at(bufferId).planes()[0].data());