[libcamera-devel] [RFC PATCH v2 3/4] libcamera: pipeline: ipu3: Get and set VCM information
Kate Hsuan
hpa at redhat.com
Mon Apr 25 03:21:09 CEST 2022
Hi Jacopo,
On Thu, Apr 21, 2022 at 6:16 PM Jacopo Mondi <jacopo at jmondi.org> wrote:
>
> Hi Kate
>
> On Thu, Apr 21, 2022 at 03:28:47PM +0800, Kate Hsuan via libcamera-devel wrote:
> > It is an interface of CameraData to get the VCM steps. Also, the VCM step
> > value is stored in ConfigInfo.
> >
> > Signed-off-by: Kate Hsuan<hpa at redhat.com>
> > ---
> > src/libcamera/pipeline/ipu3/ipu3.cpp | 15 +++++++++++++++
> > 1 file changed, 15 insertions(+)
> >
> > diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
> > index fd989e61..d1a1d21c 100644
> > --- a/src/libcamera/pipeline/ipu3/ipu3.cpp
> > +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
> > @@ -86,6 +86,8 @@ public:
> >
> > ControlInfoMap ipaControls_;
> >
> > + int getMaxLensSteps();
> > +
> > private:
> > void metadataReady(unsigned int id, const ControlList &metadata);
> > void paramsBufferReady(unsigned int id);
> > @@ -667,6 +669,7 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)
> > CameraLens *lens = data->cio2_.sensor()->focusLens();
> > if (lens)
> > configInfo.lensControls = lens->controls();
> > + sensorInfo.maxVcmSteps = data->getMaxLensSteps();
>
> Is a dedicated function necessary ?
>
> Can't it just be
>
> if (lens) {
> configInfo.lensControls = lens->controls();
> sensorInfo.maxVcmSteps = lens->getMaxFocusStep();
> }
>
> Thanks
> j
>
Thank you for addressing this.
It should be under "if". I will modify this in my v3.
> >
> > configInfo.sensorInfo = sensorInfo;
> > configInfo.bdsOutputSize = config->imguConfig().bds;
> > @@ -1272,6 +1275,18 @@ void IPU3CameraData::setSensorControls([[maybe_unused]] unsigned int id,
> > focusLens->setFocusPosition(focusValue.get<int32_t>());
> > }
> >
> > +int IPU3CameraData::getMaxLensSteps()
> > +{
> > + int ret = 0;
> > +
> > + CameraLens *focusLens = cio2_.sensor()->focusLens();
> > + if (!focusLens)
> > + return 0;
> > +
> > + ret = focusLens->getMaxFocusStep();
> > + return ret;
> > +}
> > +
> > void IPU3CameraData::paramsBufferReady(unsigned int id)
> > {
> > IPU3Frames::Info *info = frameInfos_.find(id);
> > --
> > 2.35.1
> >
>
--
BR,
Kate
More information about the libcamera-devel
mailing list