ipa: simple: Report exposure in metadata

Report exposure and gain in metadata.

This is more complicated than it could be expected because the exposure
value should be in microseconds but it's handled using V4L2_CID_EXPOSURE
control, which doesn't specify the unit, see
https://www.kernel.org/doc/html/latest/userspace-api/media/v4l/control.html.
So the unit conversion is done in the way rkisp1 IPA uses.

This requires getting and passing IPACameraSensorInfo around.  To avoid
naming confusion and to improve consistency with rkisp1 IPA,
sensorCtrlInfoMap parameter is renamed to sensorControls.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Milan Zamazal <mzamazal@redhat.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
Milan Zamazal
2025-03-27 19:59:44 +01:00
committed by Laurent Pinchart
parent 1375b07ede
commit 485a807dcb
5 changed files with 43 additions and 14 deletions

View File

@@ -133,12 +133,20 @@ SoftwareIsp::SoftwareIsp(PipelineHandler *pipe, const CameraSensor *sensor,
std::string ipaTuningFile =
ipa_->configurationFile(sensor->model() + ".yaml", "uncalibrated.yaml");
int ret = ipa_->init(IPASettings{ ipaTuningFile, sensor->model() },
debayer_->getStatsFD(),
sharedParams_.fd(),
sensor->controls(),
ipaControls,
&ccmEnabled_);
IPACameraSensorInfo sensorInfo{};
int ret = sensor->sensorInfo(&sensorInfo);
if (ret) {
LOG(SoftwareIsp, Error) << "Camera sensor information not available";
return;
}
ret = ipa_->init(IPASettings{ ipaTuningFile, sensor->model() },
debayer_->getStatsFD(),
sharedParams_.fd(),
sensorInfo,
sensor->controls(),
ipaControls,
&ccmEnabled_);
if (ret) {
LOG(SoftwareIsp, Error) << "IPA init failed";
debayer_.reset();