[libcamera-devel,IPU3-IPA] ipu3: ipa: Update to latest IPACameraSensorInfo
diff mbox series

Message ID 20221018231313.2242268-1-kieran.bingham@ideasonboard.com
State Accepted
Headers show
Series
  • [libcamera-devel,IPU3-IPA] ipu3: ipa: Update to latest IPACameraSensorInfo
Related show

Commit Message

Kieran Bingham Oct. 18, 2022, 11:13 p.m. UTC
In libcamera commit e5fc0132f80d ("camera_sensor: Add minimum and
maximum line length to IPACameraSensorInfo"), the IPU3 IPA interface is
updated to provide both minimum and maximum line lengths, replacing the
existing lineLenght field.

Update the ipu3-ipa to use IPACameraSensorInfo::minLineLength instead of
IPACameraSensorInfo::lineLength, as logically we will always want to use
the fastest sensor readout by default.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 aiq/aiq_input_parameters.cpp | 2 +-
 ipu3.cpp                     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

Comments

Umang Jain Oct. 19, 2022, 8:41 a.m. UTC | #1
Hi Kieran,

Thanks for the patch

On 10/19/22 4:43 AM, Kieran Bingham via libcamera-devel wrote:
> In libcamera commit e5fc0132f80d ("camera_sensor: Add minimum and
> maximum line length to IPACameraSensorInfo"), the IPU3 IPA interface is
> updated to provide both minimum and maximum line lengths, replacing the
> existing lineLenght field.

s/lineLenght/lineLength
>
> Update the ipu3-ipa to use IPACameraSensorInfo::minLineLength instead of
> IPACameraSensorInfo::lineLength, as logically we will always want to use
> the fastest sensor readout by default.
>
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>

> ---
>   aiq/aiq_input_parameters.cpp | 2 +-
>   ipu3.cpp                     | 2 +-
>   2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/aiq/aiq_input_parameters.cpp b/aiq/aiq_input_parameters.cpp
> index 7a6a1fac8a37..1639b61b1831 100644
> --- a/aiq/aiq_input_parameters.cpp
> +++ b/aiq/aiq_input_parameters.cpp
> @@ -79,7 +79,7 @@ void AiqInputParameters::reset()
>   int AiqInputParameters::configure(const IPAConfigInfo &configInfo)
>   {
>   	sensorDescriptor.pixel_clock_freq_mhz = configInfo.sensorInfo.pixelRate / 1000000;
> -	sensorDescriptor.pixel_periods_per_line = configInfo.sensorInfo.lineLength;
> +	sensorDescriptor.pixel_periods_per_line = configInfo.sensorInfo.minLineLength;
>   	sensorDescriptor.line_periods_per_field = configInfo.sensorInfo.minFrameLength;
>   	sensorDescriptor.line_periods_vertical_blanking = 106; /* default */
>   	//INFO: fine integration is not supported by v4l2
> diff --git a/ipu3.cpp b/ipu3.cpp
> index 7ecd377346f0..f3c65c7c142d 100644
> --- a/ipu3.cpp
> +++ b/ipu3.cpp
> @@ -118,7 +118,7 @@ void IPAIPU3::updateControls(const IPACameraSensorInfo &sensorInfo,
>   	 * exposure min, max and default and convert it from lines to
>   	 * microseconds.
>   	 */
> -	double lineDuration = sensorInfo.lineLength / (sensorInfo.pixelRate / 1e6);
> +	double lineDuration = sensorInfo.minLineLength / (sensorInfo.pixelRate / 1e6);
>   	const ControlInfo &v4l2Exposure = sensorControls.find(V4L2_CID_EXPOSURE)->second;
>   	int32_t minExposure = v4l2Exposure.min().get<int32_t>() * lineDuration;
>   	int32_t maxExposure = v4l2Exposure.max().get<int32_t>() * lineDuration;
Laurent Pinchart Oct. 19, 2022, 9:51 a.m. UTC | #2
On Wed, Oct 19, 2022 at 02:11:46PM +0530, Umang Jain via libcamera-devel wrote:
> Hi Kieran,
> 
> Thanks for the patch
> 
> On 10/19/22 4:43 AM, Kieran Bingham via libcamera-devel wrote:
> > In libcamera commit e5fc0132f80d ("camera_sensor: Add minimum and
> > maximum line length to IPACameraSensorInfo"), the IPU3 IPA interface is
> > updated to provide both minimum and maximum line lengths, replacing the
> > existing lineLenght field.
> 
> s/lineLenght/lineLength
>
> > Update the ipu3-ipa to use IPACameraSensorInfo::minLineLength instead of
> > IPACameraSensorInfo::lineLength, as logically we will always want to use
> > the fastest sensor readout by default.
> >
> > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
> 
> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> > ---
> >   aiq/aiq_input_parameters.cpp | 2 +-
> >   ipu3.cpp                     | 2 +-
> >   2 files changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/aiq/aiq_input_parameters.cpp b/aiq/aiq_input_parameters.cpp
> > index 7a6a1fac8a37..1639b61b1831 100644
> > --- a/aiq/aiq_input_parameters.cpp
> > +++ b/aiq/aiq_input_parameters.cpp
> > @@ -79,7 +79,7 @@ void AiqInputParameters::reset()
> >   int AiqInputParameters::configure(const IPAConfigInfo &configInfo)
> >   {
> >   	sensorDescriptor.pixel_clock_freq_mhz = configInfo.sensorInfo.pixelRate / 1000000;
> > -	sensorDescriptor.pixel_periods_per_line = configInfo.sensorInfo.lineLength;
> > +	sensorDescriptor.pixel_periods_per_line = configInfo.sensorInfo.minLineLength;
> >   	sensorDescriptor.line_periods_per_field = configInfo.sensorInfo.minFrameLength;
> >   	sensorDescriptor.line_periods_vertical_blanking = 106; /* default */
> >   	//INFO: fine integration is not supported by v4l2
> > diff --git a/ipu3.cpp b/ipu3.cpp
> > index 7ecd377346f0..f3c65c7c142d 100644
> > --- a/ipu3.cpp
> > +++ b/ipu3.cpp
> > @@ -118,7 +118,7 @@ void IPAIPU3::updateControls(const IPACameraSensorInfo &sensorInfo,
> >   	 * exposure min, max and default and convert it from lines to
> >   	 * microseconds.
> >   	 */
> > -	double lineDuration = sensorInfo.lineLength / (sensorInfo.pixelRate / 1e6);
> > +	double lineDuration = sensorInfo.minLineLength / (sensorInfo.pixelRate / 1e6);
> >   	const ControlInfo &v4l2Exposure = sensorControls.find(V4L2_CID_EXPOSURE)->second;
> >   	int32_t minExposure = v4l2Exposure.min().get<int32_t>() * lineDuration;
> >   	int32_t maxExposure = v4l2Exposure.max().get<int32_t>() * lineDuration;

Patch
diff mbox series

diff --git a/aiq/aiq_input_parameters.cpp b/aiq/aiq_input_parameters.cpp
index 7a6a1fac8a37..1639b61b1831 100644
--- a/aiq/aiq_input_parameters.cpp
+++ b/aiq/aiq_input_parameters.cpp
@@ -79,7 +79,7 @@  void AiqInputParameters::reset()
 int AiqInputParameters::configure(const IPAConfigInfo &configInfo)
 {
 	sensorDescriptor.pixel_clock_freq_mhz = configInfo.sensorInfo.pixelRate / 1000000;
-	sensorDescriptor.pixel_periods_per_line = configInfo.sensorInfo.lineLength;
+	sensorDescriptor.pixel_periods_per_line = configInfo.sensorInfo.minLineLength;
 	sensorDescriptor.line_periods_per_field = configInfo.sensorInfo.minFrameLength;
 	sensorDescriptor.line_periods_vertical_blanking = 106; /* default */
 	//INFO: fine integration is not supported by v4l2
diff --git a/ipu3.cpp b/ipu3.cpp
index 7ecd377346f0..f3c65c7c142d 100644
--- a/ipu3.cpp
+++ b/ipu3.cpp
@@ -118,7 +118,7 @@  void IPAIPU3::updateControls(const IPACameraSensorInfo &sensorInfo,
 	 * exposure min, max and default and convert it from lines to
 	 * microseconds.
 	 */
-	double lineDuration = sensorInfo.lineLength / (sensorInfo.pixelRate / 1e6);
+	double lineDuration = sensorInfo.minLineLength / (sensorInfo.pixelRate / 1e6);
 	const ControlInfo &v4l2Exposure = sensorControls.find(V4L2_CID_EXPOSURE)->second;
 	int32_t minExposure = v4l2Exposure.min().get<int32_t>() * lineDuration;
 	int32_t maxExposure = v4l2Exposure.max().get<int32_t>() * lineDuration;