[libcamera-devel,RFC,v1,4/5] libcamera: pipeline: ipu3: Get VCM information
diff mbox series

Message ID 20220414074342.7455-5-hpa@redhat.com
State Superseded
Headers show
Series
  • Enabling AF algorithm to get the VCM attributes from the device driver
Related show

Commit Message

Kate Hsuan April 14, 2022, 7:43 a.m. UTC
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(+)

Comments

Kieran Bingham April 14, 2022, 8:59 a.m. UTC | #1
Quoting Kate Hsuan via libcamera-devel (2022-04-14 08:43:41)
> 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 9f113171..9cc12e4c 100644
> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp
> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
> @@ -85,6 +85,8 @@ public:
>  
>         ControlInfoMap ipaControls_;
>  
> +       int getSensorControls();
> +
>  private:
>         void metadataReady(unsigned int id, const ControlList &metadata);
>         void paramsBufferReady(unsigned int id);
> @@ -670,6 +672,7 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)
>         configInfo.sensorInfo = sensorInfo;
>         configInfo.bdsOutputSize = config->imguConfig().bds;
>         configInfo.iif = config->imguConfig().iif;
> +       configInfo.sensorInfo.maxVcmSteps = data->getSensorControls();

This doesn't sound right - 
    maxVcmSteps = getSensorControls?


>         ret = data->ipa_->configure(configInfo, &data->ipaControls_);
>         if (ret) {
> @@ -1271,6 +1274,18 @@ void IPU3CameraData::setSensorControls([[maybe_unused]] unsigned int id,
>         focusLens->setFocusPosition(focusValue.get<int32_t>());
>  }
>  
> +int IPU3CameraData::getSensorControls()
> +{
> +       int ret = 0;
> +
> +       CameraLens *focusLens = cio2_.sensor()->focusLens();
> +       if (!focusLens)
> +               return 0;
> +
> +       ret = focusLens->getFocusCapabilityies();

Capabilities

But ... I think all of this needs some rework.  This is getting lens
controls, not sensor controls. And lens controls should be a control
list - not returning 'all' controls as a single value which is actually
only one value of one control?

> +       return ret;
> +}
> +
>  void IPU3CameraData::paramsBufferReady(unsigned int id)
>  {
>         IPU3Frames::Info *info = frameInfos_.find(id);
> -- 
> 2.35.1
>
Kate Hsuan April 15, 2022, 6:46 a.m. UTC | #2
Hi Kieran,

On Thu, Apr 14, 2022 at 4:59 PM Kieran Bingham
<kieran.bingham@ideasonboard.com> wrote:
>
> Quoting Kate Hsuan via libcamera-devel (2022-04-14 08:43:41)
> > 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 9f113171..9cc12e4c 100644
> > --- a/src/libcamera/pipeline/ipu3/ipu3.cpp
> > +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
> > @@ -85,6 +85,8 @@ public:
> >
> >         ControlInfoMap ipaControls_;
> >
> > +       int getSensorControls();
> > +
> >  private:
> >         void metadataReady(unsigned int id, const ControlList &metadata);
> >         void paramsBufferReady(unsigned int id);
> > @@ -670,6 +672,7 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)
> >         configInfo.sensorInfo = sensorInfo;
> >         configInfo.bdsOutputSize = config->imguConfig().bds;
> >         configInfo.iif = config->imguConfig().iif;
> > +       configInfo.sensorInfo.maxVcmSteps = data->getSensorControls();
>
> This doesn't sound right -
>     maxVcmSteps = getSensorControls?
>
>
> >         ret = data->ipa_->configure(configInfo, &data->ipaControls_);
> >         if (ret) {
> > @@ -1271,6 +1274,18 @@ void IPU3CameraData::setSensorControls([[maybe_unused]] unsigned int id,
> >         focusLens->setFocusPosition(focusValue.get<int32_t>());
> >  }
> >
> > +int IPU3CameraData::getSensorControls()
> > +{
> > +       int ret = 0;
> > +
> > +       CameraLens *focusLens = cio2_.sensor()->focusLens();
> > +       if (!focusLens)
> > +               return 0;
> > +
> > +       ret = focusLens->getFocusCapabilityies();
>
> Capabilities
>
> But ... I think all of this needs some rework.  This is getting lens
> controls, not sensor controls. And lens controls should be a control
> list - not returning 'all' controls as a single value which is actually
> only one value of one control?

I could try to modify this part since I only would like to get the max
value of VCM. I'll update this in v2.

Thank you



>
> > +       return ret;
> > +}
> > +
> >  void IPU3CameraData::paramsBufferReady(unsigned int id)
> >  {
> >         IPU3Frames::Info *info = frameInfos_.find(id);
> > --
> > 2.35.1
> >
>


--
BR,
Kate

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index 9f113171..9cc12e4c 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -85,6 +85,8 @@  public:
 
 	ControlInfoMap ipaControls_;
 
+	int getSensorControls();
+
 private:
 	void metadataReady(unsigned int id, const ControlList &metadata);
 	void paramsBufferReady(unsigned int id);
@@ -670,6 +672,7 @@  int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)
 	configInfo.sensorInfo = sensorInfo;
 	configInfo.bdsOutputSize = config->imguConfig().bds;
 	configInfo.iif = config->imguConfig().iif;
+	configInfo.sensorInfo.maxVcmSteps = data->getSensorControls();
 
 	ret = data->ipa_->configure(configInfo, &data->ipaControls_);
 	if (ret) {
@@ -1271,6 +1274,18 @@  void IPU3CameraData::setSensorControls([[maybe_unused]] unsigned int id,
 	focusLens->setFocusPosition(focusValue.get<int32_t>());
 }
 
+int IPU3CameraData::getSensorControls()
+{
+	int ret = 0;
+
+	CameraLens *focusLens = cio2_.sensor()->focusLens();
+	if (!focusLens)
+		return 0;
+
+	ret = focusLens->getFocusCapabilityies();
+	return ret;
+}
+
 void IPU3CameraData::paramsBufferReady(unsigned int id)
 {
 	IPU3Frames::Info *info = frameInfos_.find(id);