ipa: raspberrypi: Limit the calculated vblank based on the sensor mode

The existing framerate/vblank calculations did not account for the
sensor mode limits. This commit extracts vblank limits from the sensor
v4l2 controls, and stores it in the camera modes structure.

Exposure and vblank value calculations now use values clamped to the
sensor mode limits. The libcamera::controls::FrameDurations metadata
return values now reflect the minimum and maximum after clamping.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Naushir Patuck 2021-01-29 11:16:14 +00:00 committed by Laurent Pinchart
parent d7fd40ea2b
commit 362301b131
7 changed files with 48 additions and 39 deletions

View file

@ -56,15 +56,13 @@ private:
* in units of lines.
*/
static constexpr int frameIntegrationDiff = 4;
/* Largest possible frame length, in units of lines. */
static constexpr int maxFrameLength = 0xffff;
};
CamHelperImx219::CamHelperImx219()
#if ENABLE_EMBEDDED_DATA
: CamHelper(new MdParserImx219(), maxFrameLength, frameIntegrationDiff)
: CamHelper(new MdParserImx219(), frameIntegrationDiff)
#else
: CamHelper(new MdParserRPi(), maxFrameLength, frameIntegrationDiff)
: CamHelper(new MdParserRPi(), frameIntegrationDiff)
#endif
{
}