summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRobert Mader <robert.mader@collabora.com>2024-10-13 19:57:19 +0200
committerKieran Bingham <kieran.bingham@ideasonboard.com>2024-10-18 23:02:08 +0100
commit41e3d61c745153779ed5a38634d7266bffd60d61 (patch)
tree2bc8d28c146fdf95cfaf0755244215687abe708d /src
parentae51d304685787041fdc862d1391d53c2df7d0da (diff)
libcamera: software_isp: Clear IPA context on configure and stop
Like the hardware pipelines do. Not clearing frameContexts otherwise can trigger asserts like "Frame context for ... has been overwritten by ..." when switching between cameras using the swISP, e.g. on phones. Clearing the configuration and active state will become more important with upcoming changes such as getting the black level from the camera helper. Fixes: 04d171e6b299 ("libcamera: software_isp: Call Algorithm::queueRequest") Signed-off-by: Robert Mader <robert.mader@collabora.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Milan Zamazal <mzamazal@redhat.com> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r--src/ipa/simple/soft_simple.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ipa/simple/soft_simple.cpp b/src/ipa/simple/soft_simple.cpp
index b28c7039..b45c41a6 100644
--- a/src/ipa/simple/soft_simple.cpp
+++ b/src/ipa/simple/soft_simple.cpp
@@ -184,6 +184,11 @@ int IPASoftSimple::configure(const IPAConfigInfo &configInfo)
const ControlInfo &exposureInfo = sensorInfoMap_.find(V4L2_CID_EXPOSURE)->second;
const ControlInfo &gainInfo = sensorInfoMap_.find(V4L2_CID_ANALOGUE_GAIN)->second;
+ /* Clear the IPA context before the streaming session. */
+ context_.configuration = {};
+ context_.activeState = {};
+ context_.frameContexts.clear();
+
context_.configuration.agc.exposureMin = exposureInfo.min().get<int32_t>();
context_.configuration.agc.exposureMax = exposureInfo.max().get<int32_t>();
if (!context_.configuration.agc.exposureMin) {
@@ -245,6 +250,7 @@ int IPASoftSimple::start()
void IPASoftSimple::stop()
{
+ context_.frameContexts.clear();
}
void IPASoftSimple::queueRequest(const uint32_t frame, const ControlList &controls)