[libcamera-devel] libcamera: pipeline: ipu3: Report error when failing to configure
diff mbox series

Message ID 20210616095617.3593384-1-kieran.bingham@ideasonboard.com
State Accepted
Commit 3c9c2870e226950bd2a4ed98488aae0be6fea3b6
Headers show
Series
  • [libcamera-devel] libcamera: pipeline: ipu3: Report error when failing to configure
Related show

Commit Message

Kieran Bingham June 16, 2021, 9:56 a.m. UTC
If the IPA fails to configure, this can now be caught by the pipeline handler
but the cause may not be clear.

If the IPA is isolated, then reports from that IPA will not be visible
in the libcamera logs directly.

Print the return error value to help identify any issue that has arisen.

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

Comments

Hirokazu Honda June 16, 2021, 10:01 a.m. UTC | #1
Hi Kieran, thank you for the patch.

On Wed, Jun 16, 2021 at 6:56 PM Kieran Bingham <
kieran.bingham@ideasonboard.com> wrote:

> If the IPA fails to configure, this can now be caught by the pipeline
> handler
> but the cause may not be clear.
>
> If the IPA is isolated, then reports from that IPA will not be visible
> in the libcamera logs directly.
>
> Print the return error value to help identify any issue that has arisen.
>
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
>

Reviewed-by: Hirokazu Honda <hiroh@chromium.org>


> ---
>  src/libcamera/pipeline/ipu3/ipu3.cpp | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp
> b/src/libcamera/pipeline/ipu3/ipu3.cpp
> index 35f1e977ab19..113e70a5e692 100644
> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp
> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
> @@ -644,7 +644,8 @@ int PipelineHandlerIPU3::configure(Camera *camera,
> CameraConfiguration *c)
>
>         ret = data->ipa_->configure(configInfo);
>         if (ret) {
> -               LOG(IPU3, Error) << "Failed to configure IPA";
> +               LOG(IPU3, Error) << "Failed to configure IPA: "
> +                                << strerror(-ret);
>                 return ret;
>         }
>
> --
> 2.30.2
>
>
Paul Elder June 16, 2021, 10:03 a.m. UTC | #2
Hi Kieran,

On Wed, Jun 16, 2021 at 10:56:17AM +0100, Kieran Bingham wrote:
> If the IPA fails to configure, this can now be caught by the pipeline handler
> but the cause may not be clear.
> 
> If the IPA is isolated, then reports from that IPA will not be visible
> in the libcamera logs directly.
> 
> Print the return error value to help identify any issue that has arisen.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>

> ---
>  src/libcamera/pipeline/ipu3/ipu3.cpp | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
> index 35f1e977ab19..113e70a5e692 100644
> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp
> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
> @@ -644,7 +644,8 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)
>  
>  	ret = data->ipa_->configure(configInfo);
>  	if (ret) {
> -		LOG(IPU3, Error) << "Failed to configure IPA";
> +		LOG(IPU3, Error) << "Failed to configure IPA: "
> +				 << strerror(-ret);
>  		return ret;
>  	}
>  
> -- 
> 2.30.2
>
Umang Jain June 16, 2021, 11:10 a.m. UTC | #3
Hi Kieran,

On 6/16/21 3:26 PM, Kieran Bingham wrote:
> If the IPA fails to configure, this can now be caught by the pipeline handler
> but the cause may not be clear.
>
> If the IPA is isolated, then reports from that IPA will not be visible
> in the libcamera logs directly.
Drive by: We discussed file-logging for IPAs(isolated or otherwise). I 
wonder while at it,
would it be worth to let pipeline-handler know how IPA is loaded (in 
isolated context
or otherwise) by querying a flag in Proxy maybe and log that flag value 
in PH(s)?
>
> Print the return error value to help identify any issue that has arisen.
>
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
> ---
>   src/libcamera/pipeline/ipu3/ipu3.cpp | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
> index 35f1e977ab19..113e70a5e692 100644
> --- a/src/libcamera/pipeline/ipu3/ipu3.cpp
> +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
> @@ -644,7 +644,8 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)
>   
>   	ret = data->ipa_->configure(configInfo);
>   	if (ret) {
> -		LOG(IPU3, Error) << "Failed to configure IPA";
> +		LOG(IPU3, Error) << "Failed to configure IPA: "
> +				 << strerror(-ret);
>   		return ret;
>   	}
>
Laurent Pinchart June 16, 2021, 11:27 a.m. UTC | #4
Hi Umang,

On Wed, Jun 16, 2021 at 04:40:42PM +0530, Umang Jain wrote:
> On 6/16/21 3:26 PM, Kieran Bingham wrote:
> > If the IPA fails to configure, this can now be caught by the pipeline handler
> > but the cause may not be clear.
> >
> > If the IPA is isolated, then reports from that IPA will not be visible
> > in the libcamera logs directly.
>
> Drive by: We discussed file-logging for IPAs(isolated or otherwise). I 
> wonder while at it,
> would it be worth to let pipeline-handler know how IPA is loaded (in 
> isolated context
> or otherwise) by querying a flag in Proxy maybe and log that flag value 
> in PH(s)?

I'd really, really prefer not making it possible for pipeline handlers
to differenciate between IPAs. If we want to log this information, we
can do so in IPAManager::createIPA() for instance.

> > Print the return error value to help identify any issue that has arisen.
> >
> > Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
>
> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
>
> > ---
> >   src/libcamera/pipeline/ipu3/ipu3.cpp | 3 ++-
> >   1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
> > index 35f1e977ab19..113e70a5e692 100644
> > --- a/src/libcamera/pipeline/ipu3/ipu3.cpp
> > +++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
> > @@ -644,7 +644,8 @@ int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)
> >   
> >   	ret = data->ipa_->configure(configInfo);
> >   	if (ret) {
> > -		LOG(IPU3, Error) << "Failed to configure IPA";
> > +		LOG(IPU3, Error) << "Failed to configure IPA: "
> > +				 << strerror(-ret);
> >   		return ret;
> >   	}
> >

Patch
diff mbox series

diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index 35f1e977ab19..113e70a5e692 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -644,7 +644,8 @@  int PipelineHandlerIPU3::configure(Camera *camera, CameraConfiguration *c)
 
 	ret = data->ipa_->configure(configInfo);
 	if (ret) {
-		LOG(IPU3, Error) << "Failed to configure IPA";
+		LOG(IPU3, Error) << "Failed to configure IPA: "
+				 << strerror(-ret);
 		return ret;
 	}