summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKieran Bingham <kieran.bingham@ideasonboard.com>2021-12-03 12:53:59 +0000
committerKieran Bingham <kieran.bingham@ideasonboard.com>2021-12-06 13:21:31 +0000
commit294663eece8c067d268442724b969c9dfa081b0a (patch)
tree63805551a352115189a02ce15a168c15c9f71868 /src
parentf8d2f17a3db5ac490d7b505253a98d6795c2b630 (diff)
libcamera: ipu3: Only process focus if we have a lens
If there is no lens detected by the system, then we will not be able to set the control, so we can skip processing of the list. Furthermore, if the IPA has not set a V4L2_CID_FOCUS_ABSOLUTE control, then a warning will be printed as the lensControls.get() will not succeed. Break out of the control parsing when there is no CameraLens device, or if there is no absolute focus control set by the IPA. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/pipeline/ipu3/ipu3.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index 1215bdb8..16380d20 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -1242,13 +1242,19 @@ void IPU3CameraData::queueFrameAction(unsigned int id,
const ControlList &sensorControls = action.sensorControls;
delayedCtrls_->push(sensorControls);
+ CameraLens *focusLens = cio2_.sensor()->focusLens();
+ if (!focusLens)
+ break;
+
const ControlList lensControls = action.lensControls;
+ if (!lensControls.contains(V4L2_CID_FOCUS_ABSOLUTE))
+ break;
+
const ControlValue &focusValue =
lensControls.get(V4L2_CID_FOCUS_ABSOLUTE);
- CameraLens *focusLens = cio2_.sensor()->focusLens();
- if (focusLens && !focusValue.isNone())
- focusLens->setFocusPostion(focusValue.get<int32_t>());
+ focusLens->setFocusPostion(focusValue.get<int32_t>());
+
break;
}
case ipa::ipu3::ActionParamFilled: {