libcamera: raspberrypi: Add control of sensor vblanking

Add support for setting V4L2_CID_VBLANK appropriately when setting
V4L2_CID_EXPOSURE. This will allow adaptive framerates during
viewfinder use cases (e.g. when the exposure time goes above 33ms, we
can reduce the framerate to lower than 30fps).

The minimum and maximum frame durations are provided via libcamera
controls, and will prioritise exposure time limits over any AGC request.

V4L2_CID_VBLANK is controlled through the staggered writer, just like
the exposure and gain controls.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Tested-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-19 15:30:46 +00:00 committed by Laurent Pinchart
parent 6232ec3c16
commit 92b8ccc42a
8 changed files with 130 additions and 15 deletions

View file

@ -49,13 +49,22 @@ public:
double Gain(uint32_t gain_code) const override;
unsigned int MistrustFramesModeSwitch() const override;
bool SensorEmbeddedDataPresent() const override;
private:
/*
* Smallest difference between the frame length and integration time,
* 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())
: CamHelper(new MdParserImx219(), maxFrameLength, frameIntegrationDiff)
#else
: CamHelper(new MdParserRPi())
: CamHelper(new MdParserRPi(), maxFrameLength, frameIntegrationDiff)
#endif
{
}