<div dir="ltr"><div dir="ltr">Hi Naush<div><br></div><div>Thanks for submitting this one!</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, 28 May 2020 at 15:56, Naushir Patuck <<a href="mailto:naush@raspberrypi.com">naush@raspberrypi.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The reset function in staggered write was using the wrong index when<br>
looking for the last updated camera parameters. This would cause<br>
possibly stale exposure values to be written to the camera on a<br>
mode switch for captures.<br>
<br>
Signed-off-by: Naushir Patuck <<a href="mailto:naush@raspberrypi.com" target="_blank">naush@raspberrypi.com</a>><br>
Signed-off-by: David Plowman <<a href="mailto:david.plowman@raspberrypi.com" target="_blank">david.plowman@raspberrypi.com</a>><br>
---<br>
src/libcamera/pipeline/raspberrypi/staggered_ctrl.cpp | 2 +-<br>
1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/src/libcamera/pipeline/raspberrypi/staggered_ctrl.cpp b/src/libcamera/pipeline/raspberrypi/staggered_ctrl.cpp<br>
index 391e13f5..b26fa63d 100644<br>
--- a/src/libcamera/pipeline/raspberrypi/staggered_ctrl.cpp<br>
+++ b/src/libcamera/pipeline/raspberrypi/staggered_ctrl.cpp<br>
@@ -46,7 +46,7 @@ void StaggeredCtrl::reset()<br>
{<br>
std::lock_guard<std::mutex> lock(lock_);<br>
<br>
- int lastSetCount = std::max<int>(0, setCount_ - 1);<br>
+ int lastSetCount = std::max<int>(0, setCount_);<br></blockquote><div><br></div><div>Actually I wonder whether we shouldn't just go with</div><div><br></div><div> uint32_t lastSetCount = setCount_;</div><div><div></div></div><div><br></div><div>(the std::max seems a bit redundant now that we don't subtract 1).</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
std::unordered_map<uint32_t, int32_t> lastVal;<br>
<br>
/* Reset the counters. */<br>
-- <br>
2.25.1<br>
<br>
</blockquote></div></div>