diff options
author | Naushir Patuck <naush@raspberrypi.com> | 2022-09-26 10:36:39 +0100 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2022-10-04 18:38:50 +0300 |
commit | e7308678738f0442f49e2e36c2a145d484075439 (patch) | |
tree | d710ac98b3ec7ef872c6ef835c7cf3ca94a6bddd /src | |
parent | d476f5e4e2c3d57822b0d1f26718e38361e4db41 (diff) |
ipa: raspberrypi: Limit minimum exposure time for the IMX296
Limit the minimum allowable exposure time to a single line in the IMX296
camera helper. This equates to approximately 30us.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/ipa/raspberrypi/cam_helper_imx296.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/ipa/raspberrypi/cam_helper_imx296.cpp b/src/ipa/raspberrypi/cam_helper_imx296.cpp index 09f828ea..66d21e36 100644 --- a/src/ipa/raspberrypi/cam_helper_imx296.cpp +++ b/src/ipa/raspberrypi/cam_helper_imx296.cpp @@ -26,6 +26,7 @@ public: void getDelays(int &exposureDelay, int &gainDelay, int &vblankDelay) const override; private: + static constexpr uint32_t minExposureLines = 1; static constexpr uint32_t maxGainCode = 239; static constexpr Duration timePerLine = 550.0 / 37.125e6 * 1.0s; @@ -54,12 +55,12 @@ double CamHelperImx296::gain(uint32_t gainCode) const uint32_t CamHelperImx296::exposureLines(Duration exposure) const { - return (exposure - 14.26us) / timePerLine; + return std::max<uint32_t>(minExposureLines, (exposure - 14.26us) / timePerLine); } Duration CamHelperImx296::exposure(uint32_t exposureLines) const { - return exposureLines * timePerLine + 14.26us; + return std::max<uint32_t>(minExposureLines, exposureLines) * timePerLine + 14.26us; } void CamHelperImx296::getDelays(int &exposureDelay, int &gainDelay, |