Message ID | 20220421072848.6752-4-hpa@redhat.com |
---|---|
State | Superseded |
Headers | show |
Series |
|
Related | show |
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@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 > > 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 >
Hi Jacopo, On Thu, Apr 21, 2022 at 6:16 PM Jacopo Mondi <jacopo@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@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 > > >
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(); 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);
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@redhat.com> --- src/libcamera/pipeline/ipu3/ipu3.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+)