[libcamera-devel] libcamera: pipeline: ipu3: Check for failures when loading IPA
diff mbox series

Message ID 20210416160320.68125-1-kieran.bingham@ideasonboard.com
State Accepted
Commit 9b5478e7259a403f847083ec4af239fa70428768
Headers show
Series
  • [libcamera-devel] libcamera: pipeline: ipu3: Check for failures when loading IPA
Related show

Commit Message

Kieran Bingham April 16, 2021, 4:03 p.m. UTC
The ipa_->init() method can fail if the IPA can't load correctly.
This should be caught by the pipeline handler to prevent continuing
with an invalid IPA.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 src/libcamera/pipeline/ipu3/ipu3.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Jean-Michel Hautbois April 16, 2021, 7:37 p.m. UTC | #1
Hi Kieran,

Thanks for the patch !

On 16/04/2021 18:03, Kieran Bingham wrote:
> The ipa_->init() method can fail if the IPA can't load correctly.
> This should be caught by the pipeline handler to prevent continuing
> with an invalid IPA.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
> ---
>  src/libcamera/pipeline/ipu3/ipu3.cpp | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
> index 519cad4f8148..51446fcf5bc1 100644
> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp
> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
> @@ -1145,7 +1145,11 @@ int IPU3CameraData::loadIPA()
>  	ipa_->queueFrameAction.connect(this, &IPU3CameraData::queueFrameAction);
>  
>  	CameraSensor *sensor = cio2_.sensor();
> -	ipa_->init(IPASettings{ "", sensor->model() });
> +	int ret = ipa_->init(IPASettings{ "", sensor->model() });
> +	if (ret) {
> +		LOG(IPU3, Error) << "Failed to initialise the IPU3 IPA";
> +		return ret;
> +	}
>  
>  	return 0;
>  }
>
Niklas Söderlund April 16, 2021, 8:42 p.m. UTC | #2
Hi Kieran,

On 2021-04-16 17:03:20 +0100, Kieran Bingham wrote:
> The ipa_->init() method can fail if the IPA can't load correctly.
> This should be caught by the pipeline handler to prevent continuing
> with an invalid IPA.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>

> ---
>  src/libcamera/pipeline/ipu3/ipu3.cpp | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
> index 519cad4f8148..51446fcf5bc1 100644
> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp
> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
> @@ -1145,7 +1145,11 @@ int IPU3CameraData::loadIPA()
>  	ipa_->queueFrameAction.connect(this, &IPU3CameraData::queueFrameAction);
>  
>  	CameraSensor *sensor = cio2_.sensor();
> -	ipa_->init(IPASettings{ "", sensor->model() });
> +	int ret = ipa_->init(IPASettings{ "", sensor->model() });
> +	if (ret) {
> +		LOG(IPU3, Error) << "Failed to initialise the IPU3 IPA";
> +		return ret;
> +	}
>  
>  	return 0;
>  }
> -- 
> 2.25.1
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
Laurent Pinchart April 16, 2021, 10:11 p.m. UTC | #3
Hi Kieran,

Thank you for the patch.

On Fri, Apr 16, 2021 at 05:03:20PM +0100, Kieran Bingham wrote:
> The ipa_->init() method can fail if the IPA can't load correctly.
> This should be caught by the pipeline handler to prevent continuing
> with an invalid IPA.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

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

> ---
>  src/libcamera/pipeline/ipu3/ipu3.cpp | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
> index 519cad4f8148..51446fcf5bc1 100644
> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp
> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
> @@ -1145,7 +1145,11 @@ int IPU3CameraData::loadIPA()
>  	ipa_->queueFrameAction.connect(this, &IPU3CameraData::queueFrameAction);
>  
>  	CameraSensor *sensor = cio2_.sensor();
> -	ipa_->init(IPASettings{ "", sensor->model() });
> +	int ret = ipa_->init(IPASettings{ "", sensor->model() });
> +	if (ret) {
> +		LOG(IPU3, Error) << "Failed to initialise the IPU3 IPA";
> +		return ret;
> +	}
>  
>  	return 0;
>  }
Hirokazu Honda April 19, 2021, 4:36 a.m. UTC | #4
Hi Kieran, thanks for the patch.

On Sat, Apr 17, 2021 at 7:12 AM Laurent Pinchart
<laurent.pinchart@ideasonboard.com> wrote:
>
> Hi Kieran,
>
> Thank you for the patch.
>
> On Fri, Apr 16, 2021 at 05:03:20PM +0100, Kieran Bingham wrote:
> > The ipa_->init() method can fail if the IPA can't load correctly.
> > This should be caught by the pipeline handler to prevent continuing
> > with an invalid IPA.
> >
> > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
>
> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
> > ---
> >  src/libcamera/pipeline/ipu3/ipu3.cpp | 6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
> > index 519cad4f8148..51446fcf5bc1 100644
> > --- a/src/libcamera/pipeline/ipu3/ipu3.cpp
> > +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
> > @@ -1145,7 +1145,11 @@ int IPU3CameraData::loadIPA()
> >       ipa_->queueFrameAction.connect(this, &IPU3CameraData::queueFrameAction);
> >
> >       CameraSensor *sensor = cio2_.sensor();
> > -     ipa_->init(IPASettings{ "", sensor->model() });
> > +     int ret = ipa_->init(IPASettings{ "", sensor->model() });
> > +     if (ret) {
> > +             LOG(IPU3, Error) << "Failed to initialise the IPU3 IPA";
> > +             return ret;
> > +     }
> >
> >       return 0;
> >  }
>
> --
> Regards,
>
> Laurent Pinchart
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index 519cad4f8148..51446fcf5bc1 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -1145,7 +1145,11 @@  int IPU3CameraData::loadIPA()
 	ipa_->queueFrameAction.connect(this, &IPU3CameraData::queueFrameAction);
 
 	CameraSensor *sensor = cio2_.sensor();
-	ipa_->init(IPASettings{ "", sensor->model() });
+	int ret = ipa_->init(IPASettings{ "", sensor->model() });
+	if (ret) {
+		LOG(IPU3, Error) << "Failed to initialise the IPU3 IPA";
+		return ret;
+	}
 
 	return 0;
 }