@@ -11,6 +11,7 @@ import "include/libcamera/ipa/core.mojom";
struct IPAConfigInfo {
libcamera.IPACameraSensorInfo sensorInfo;
libcamera.ControlInfoMap sensorControls;
+ libcamera.ControlInfoMap lensControls;
};
interface IPARkISP1Interface {
@@ -37,6 +38,7 @@ interface IPARkISP1Interface {
interface IPARkISP1EventInterface {
paramsBufferReady(uint32 frame);
- setSensorControls(uint32 frame, libcamera.ControlList sensorControls);
+ setSensorControls(uint32 frame, libcamera.ControlList sensorControls,
+ libcamera.ControlList lensControls);
metadataReady(uint32 frame, libcamera.ControlList metadata);
};
@@ -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"
@@ -112,7 +113,8 @@ public:
private:
void paramFilled(unsigned int frame);
void setSensorControls(unsigned int frame,
- const ControlList &sensorControls);
+ const ControlList &sensorControls,
+ const ControlList &lensControls);
void metadataReady(unsigned int frame, const ControlList &metadata);
};
@@ -395,9 +397,20 @@ void RkISP1CameraData::paramFilled(unsigned int frame)
}
void RkISP1CameraData::setSensorControls([[maybe_unused]] unsigned int frame,
- const ControlList &sensorControls)
+ const ControlList &sensorControls,
+ const ControlList &lensControls)
{
delayedCtrls_->push(sensorControls);
+
+ CameraLens *lens = sensor_->focusLens();
+ if (!lens)
+ return;
+
+ if (lensControls.contains(V4L2_CID_FOCUS_ABSOLUTE)) {
+ const ControlValue &focusValue = lensControls.get(V4L2_CID_FOCUS_ABSOLUTE);
+
+ lens->setFocusPosition(focusValue.get<int32_t>());
+ }
}
void RkISP1CameraData::metadataReady(unsigned int frame, const ControlList &metadata)
@@ -810,6 +823,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 << ")";
Adding basic support for lenses, as has been done similarly in other pipeline handlers. Parts of it will be changed later in the series, but the intended changes are more recognizable. Signed-off-by: Matthias Fend <matthias.fend@emfend.at> --- include/libcamera/ipa/rkisp1.mojom | 4 +++- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 21 +++++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-)