[libcamera-devel,10/11] test: ipa: ipa_interface: Pass configuration file to IPA init()

Message ID 20200427031713.14013-11-laurent.pinchart@ideasonboard.com
State Accepted
Headers show
Series
  • libcamera: Add support for IPA configuration
Related show

Commit Message

Laurent Pinchart April 27, 2020, 3:17 a.m. UTC
Pass the vimc IPA dummy configuration file to the IPA init() function.
This will be used by the IPA to validate the init() call.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 test/ipa/ipa_interface_test.cpp | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

Comments

Jacopo Mondi April 27, 2020, 9:16 a.m. UTC | #1
Hi Laurent,

On Mon, Apr 27, 2020 at 06:17:12AM +0300, Laurent Pinchart wrote:
> Pass the vimc IPA dummy configuration file to the IPA init() function.
> This will be used by the IPA to validate the init() call.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>

Thanks
  j

> ---
>  test/ipa/ipa_interface_test.cpp | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/test/ipa/ipa_interface_test.cpp b/test/ipa/ipa_interface_test.cpp
> index 2e2dfb8d1ebd..7fa88efee089 100644
> --- a/test/ipa/ipa_interface_test.cpp
> +++ b/test/ipa/ipa_interface_test.cpp
> @@ -98,8 +98,13 @@ protected:
>  		}
>
>  		/* Test initialization of IPA module. */
> -		IPASettings settings;
> -		ipa_->init(settings);
> +		std::string conf = ipa_->configurationFile("vimc.conf");
> +		int ret = ipa_->init(IPASettings{ conf });
> +		if (ret < 0) {
> +			cerr << "IPA interface init() failed" << endl;
> +			return TestFail;
> +		}
> +
>  		timer.start(1000);
>  		while (timer.isRunning() && trace_ != IPAOperationInit)
>  			dispatcher->processEvents();
> @@ -155,7 +160,7 @@ private:
>  	}
>
>  	std::shared_ptr<PipelineHandler> pipe_;
> -	std::unique_ptr<IPAInterface> ipa_;
> +	std::unique_ptr<IPAProxy> ipa_;
>  	enum IPAOperationCode trace_;
>  	EventNotifier *notifier_;
>  	int fd_;
> --
> Regards,
>
> Laurent Pinchart
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
Kieran Bingham April 27, 2020, 2:16 p.m. UTC | #2
Hi Laurent,

On 27/04/2020 04:17, Laurent Pinchart wrote:
> Pass the vimc IPA dummy configuration file to the IPA init() function.
> This will be used by the IPA to validate the init() call.

Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>  test/ipa/ipa_interface_test.cpp | 11 ++++++++---
>  1 file changed, 8 insertions(+), 3 deletions(-)
> 
> diff --git a/test/ipa/ipa_interface_test.cpp b/test/ipa/ipa_interface_test.cpp
> index 2e2dfb8d1ebd..7fa88efee089 100644
> --- a/test/ipa/ipa_interface_test.cpp
> +++ b/test/ipa/ipa_interface_test.cpp
> @@ -98,8 +98,13 @@ protected:
>  		}
>  
>  		/* Test initialization of IPA module. */
> -		IPASettings settings;
> -		ipa_->init(settings);
> +		std::string conf = ipa_->configurationFile("vimc.conf");
> +		int ret = ipa_->init(IPASettings{ conf });
> +		if (ret < 0) {
> +			cerr << "IPA interface init() failed" << endl;
> +			return TestFail;
> +		}
> +
>  		timer.start(1000);
>  		while (timer.isRunning() && trace_ != IPAOperationInit)
>  			dispatcher->processEvents();
> @@ -155,7 +160,7 @@ private:
>  	}
>  
>  	std::shared_ptr<PipelineHandler> pipe_;
> -	std::unique_ptr<IPAInterface> ipa_;
> +	std::unique_ptr<IPAProxy> ipa_;
>  	enum IPAOperationCode trace_;
>  	EventNotifier *notifier_;
>  	int fd_;
>

Patch

diff --git a/test/ipa/ipa_interface_test.cpp b/test/ipa/ipa_interface_test.cpp
index 2e2dfb8d1ebd..7fa88efee089 100644
--- a/test/ipa/ipa_interface_test.cpp
+++ b/test/ipa/ipa_interface_test.cpp
@@ -98,8 +98,13 @@  protected:
 		}
 
 		/* Test initialization of IPA module. */
-		IPASettings settings;
-		ipa_->init(settings);
+		std::string conf = ipa_->configurationFile("vimc.conf");
+		int ret = ipa_->init(IPASettings{ conf });
+		if (ret < 0) {
+			cerr << "IPA interface init() failed" << endl;
+			return TestFail;
+		}
+
 		timer.start(1000);
 		while (timer.isRunning() && trace_ != IPAOperationInit)
 			dispatcher->processEvents();
@@ -155,7 +160,7 @@  private:
 	}
 
 	std::shared_ptr<PipelineHandler> pipe_;
-	std::unique_ptr<IPAInterface> ipa_;
+	std::unique_ptr<IPAProxy> ipa_;
 	enum IPAOperationCode trace_;
 	EventNotifier *notifier_;
 	int fd_;