summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo@jmondi.org>2021-06-29 17:17:42 +0200
committerJacopo Mondi <jacopo@jmondi.org>2021-10-15 09:32:30 +0200
commit2a938efc8c55a6b59e0e9a1722e85415fe39b9c3 (patch)
treec6ad06b675265da5e3521845571e3d7624ba4738 /src
parent2dab504a9be138d6a8c94fe498bc7917d313182e (diff)
libcamera: ipu3: Split controls init/update
In order to prepare for updating the Camera controls limits when a new camera configuration is applied, split the initControls() function in two: - updateControls() to actually compute controls values - initControls() to initialize the sensor configuration and call updateControls Update the functions documentation accordingly. No functional changes intended. Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r--src/libcamera/pipeline/ipu3/ipu3.cpp33
1 files changed, 29 insertions, 4 deletions
diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index 87ff9b7e..dd7d4cb6 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -148,6 +148,7 @@ private:
}
int initControls(IPU3CameraData *data);
+ int updateControls(IPU3CameraData *data);
int registerCameras();
int allocateBuffers(Camera *camera);
@@ -927,9 +928,11 @@ bool PipelineHandlerIPU3::match(DeviceEnumerator *enumerator)
* \brief Initialize the camera controls
* \param[in] data The camera data
*
- * Initialize the camera controls as the union of the static pipeline handler
- * controls (IPU3Controls) and controls created dynamically from the sensor
- * capabilities.
+ * Initialize the camera controls by calculating controls which the pipeline
+ * is reponsible for and merge them with the controls computed by the IPA.
+ *
+ * This function needs data->ipaControls_ to be initialized by the IPA init()
+ * function at camera creation time. Always call this function after IPA init().
*
* \return 0 on success or a negative error code otherwise
*/
@@ -950,8 +953,30 @@ int PipelineHandlerIPU3::initControls(IPU3CameraData *data)
if (ret)
return ret;
+ return updateControls(data);
+}
+
+/**
+ * \brief Update the camera controls
+ * \param[in] data The camera data
+ *
+ * Compute the camera controls by calculating controls which the pipeline
+ * is reponsible for and merge them with the controls computed by the IPA.
+ *
+ * This function needs data->ipaControls_ to be refreshed when a new
+ * configuration is applied to the camera by the IPA configure() function.
+ *
+ * Always call this function after IPA configure() to make sure to have a
+ * properly refreshed IPA controls list.
+ *
+ * \return 0 on success or a negative error code otherwise
+ */
+int PipelineHandlerIPU3::updateControls(IPU3CameraData *data)
+{
+ CameraSensor *sensor = data->cio2_.sensor();
IPACameraSensorInfo sensorInfo{};
- ret = sensor->sensorInfo(&sensorInfo);
+
+ int ret = sensor->sensorInfo(&sensorInfo);
if (ret)
return ret;