pipeline: ipa: raspberrypi: Pass controls to IPA on start

Forward any controls passed into the pipeline handler to the IPA.
The IPA then sets up the Raspberry Pi controller with these settings
appropriately, and passes back any V4L2 sensor controls that need
to be applied.

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: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Naushir Patuck
2020-12-04 15:31:21 +00:00
committed by Laurent Pinchart
parent 0238b9e080
commit 2795f333fc
3 changed files with 47 additions and 20 deletions

View File

@@ -754,8 +754,10 @@ int PipelineHandlerRPi::start(Camera *camera, [[maybe_unused]] ControlList *cont
/* Start the IPA. */
IPAOperationData ipaData = {};
IPAOperationData result = {};
if (controls)
if (controls) {
ipaData.operation = RPi::IPA_CONFIG_STARTUP;
ipaData.controls.emplace_back(*controls);
}
ret = data->ipa_->start(ipaData, &result);
if (ret) {
LOG(RPI, Error)
@@ -764,6 +766,14 @@ int PipelineHandlerRPi::start(Camera *camera, [[maybe_unused]] ControlList *cont
return ret;
}
/* Apply any gain/exposure settings that the IPA may have passed back. */
ASSERT(data->staggeredCtrl_);
if (result.operation & RPi::IPA_CONFIG_SENSOR) {
const ControlList &ctrls = result.controls[0];
if (!data->staggeredCtrl_.set(ctrls))
LOG(RPI, Error) << "V4L2 staggered set failed";
}
/*
* IPA configure may have changed the sensor flips - hence the bayer
* order. Get the sensor format and set the ISP input now.
@@ -784,7 +794,6 @@ int PipelineHandlerRPi::start(Camera *camera, [[maybe_unused]] ControlList *cont
* starting. First check that the staggered ctrl has been initialised
* by configure().
*/
ASSERT(data->staggeredCtrl_);
data->staggeredCtrl_.reset();
data->staggeredCtrl_.write();
data->expectedSequence_ = 0;