@@ -7,6 +7,7 @@
#include <algorithm>
#include <math.h>
+#include <optional>
#include <queue>
#include <stdint.h>
#include <string.h>
@@ -70,6 +71,7 @@ private:
std::map<unsigned int, MappedFrameBuffer> mappedBuffers_;
ControlInfoMap sensorCtrls_;
+ std::optional<ControlInfoMap> lensCtrls_;
/* Camera sensor controls. */
bool autoExposure_;
@@ -206,6 +208,10 @@ int IPARkISP1::configure([[maybe_unused]] const IPACameraSensorInfo &info,
sensorCtrls_ = entityControls.at(0);
+ auto lensControls = entityControls.find(1);
+ if (lensControls != entityControls.end())
+ lensCtrls_ = lensControls->second;
+
const auto itExp = sensorCtrls_.find(V4L2_CID_EXPOSURE);
if (itExp == sensorCtrls_.end()) {
LOG(IPARkISP1, Error) << "Can't find exposure control";
@@ -28,6 +28,7 @@
#include <libcamera/stream.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"
@@ -694,6 +695,10 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)
std::map<uint32_t, ControlInfoMap> entityControls;
entityControls.emplace(0, data->sensor_->controls());
+ CameraLens *lens = data->sensor_->focusLens();
+ if (lens)
+ entityControls.emplace(1, lens->controls());
+
ret = data->ipa_->configure(sensorInfo, streamConfig, entityControls);
if (ret) {
LOG(RkISP1, Error) << "failed configuring IPA (" << ret << ")";