diff options
author | Naushir Patuck <naush@raspberrypi.com> | 2020-12-04 15:31:21 +0000 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2020-12-08 14:31:50 +0200 |
commit | 2795f333fce5f43a4239d8d40d34dde4e5caa6ca (patch) | |
tree | 0626319af99a7322f287545b11494e14b8931812 /src/libcamera | |
parent | 0238b9e080bcf765f4a3ea9c7be1681cd0c3bb1f (diff) |
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>
Diffstat (limited to 'src/libcamera')
-rw-r--r-- | src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp index 791ff199..2ec1f6e7 100644 --- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp +++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp @@ -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; |