summaryrefslogtreecommitdiff
path: root/src/ipa/rpi/common
diff options
context:
space:
mode:
authorNaushir Patuck <naush@raspberrypi.com>2023-10-13 08:48:28 +0100
committerKieran Bingham <kieran.bingham@ideasonboard.com>2023-10-18 11:01:22 +0100
commit11c939a200dd501b074d3dd11111dac26dd8fb4d (patch)
tree41c34ffe642b1fb28685b617aad22bb6a9e22288 /src/ipa/rpi/common
parent05480795813118c5fd1e4550c2b91aa4436365ff (diff)
ipa: rpi: Add statsInline to the Controller hardware description
Add a new boolean field (statsInline) to Controller::HardwareConfigMap. This field indicates where the statistics are generated in the hardware ISP pipeline. For statsInline == true, statistics are generated before the frame is processed (e.g. the PiSP case), and statsInline == false indicates statistics are generated after the frame is processed (e.g. the VC4 case). Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src/ipa/rpi/common')
-rw-r--r--src/ipa/rpi/common/ipa_base.cpp19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp
index 97f647a9..f28eb36b 100644
--- a/src/ipa/rpi/common/ipa_base.cpp
+++ b/src/ipa/rpi/common/ipa_base.cpp
@@ -429,11 +429,10 @@ void IpaBase::prepareIsp(const PrepareParams &params)
}
/*
- * If a statistics buffer has been passed in, call processStats
- * directly now before prepare() since the statistics are available in-line
- * with the Bayer frame.
+ * If the statistics are inline (i.e. already available with the Bayer
+ * frame), call processStats() now before prepare().
*/
- if (params.buffers.stats)
+ if (controller_.getHardwareConfig().statsInline)
processStats({ params.buffers, params.ipaContext });
/* Do we need/want to call prepare? */
@@ -445,6 +444,10 @@ void IpaBase::prepareIsp(const PrepareParams &params)
frameCount_++;
+ /* If the statistics are inline the metadata can be returned early. */
+ if (controller_.getHardwareConfig().statsInline)
+ reportMetadata(ipaContext);
+
/* Ready to push the input buffer into the ISP. */
prepareIspComplete.emit(params.buffers, false);
}
@@ -479,7 +482,13 @@ void IpaBase::processStats(const ProcessParams &params)
}
}
- reportMetadata(ipaContext);
+ /*
+ * If the statistics are not inline the metadata must be returned now,
+ * before the processStatsComplete signal.
+ */
+ if (!controller_.getHardwareConfig().statsInline)
+ reportMetadata(ipaContext);
+
processStatsComplete.emit(params.buffers);
}