@@ -11,6 +11,7 @@ import "include/libcamera/ipa/core.mojom";
struct IPAConfigInfo {
libcamera.IPACameraSensorInfo sensorInfo;
libcamera.ControlInfoMap sensorControls;
+ libcamera.ControlInfoMap lensControls;
};
interface IPARkISP1Interface {
@@ -7,6 +7,7 @@
#include <algorithm>
#include <math.h>
+#include <optional>
#include <queue>
#include <stdint.h>
#include <string.h>
@@ -80,6 +81,7 @@ private:
std::map<unsigned int, MappedFrameBuffer> mappedBuffers_;
ControlInfoMap sensorControls_;
+ std::optional<ControlInfoMap> lensControls_;
/* revision-specific data */
rkisp1_cif_isp_version hwRevision_;
@@ -265,6 +267,9 @@ int IPARkISP1::configure(const IPAConfigInfo &ipaConfig,
return format.colourEncoding == PixelFormatInfo::ColourEncodingRAW;
});
+ if (!ipaConfig.lensControls.empty())
+ lensControls_ = ipaConfig.lensControls;
+
for (auto const &a : algorithms()) {
Algorithm *algo = static_cast<Algorithm *>(a.get());
@@ -32,6 +32,7 @@
#include <libcamera/ipa/rkisp1_ipa_proxy.h>
#include "libcamera/internal/camera.h"
+#include "libcamera/internal/camera_lens.h"
#include "libcamera/internal/camera_sensor.h"
#include "libcamera/internal/delayed_controls.h"
#include "libcamera/internal/device_enumerator.h"
@@ -812,6 +813,10 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)
ipaConfig.sensorControls = data->sensor_->controls();
+ CameraLens *lens = data->sensor_->focusLens();
+ if (lens)
+ ipaConfig.lensControls = lens->controls();
+
ret = data->ipa_->configure(ipaConfig, streamConfig, &data->controlInfo_);
if (ret) {
LOG(RkISP1, Error) << "failed configuring IPA (" << ret << ")";