From b97c6f2883ef3b60953e990538c2d84c6b9a2735 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 20 Oct 2025 19:03:17 +0300 Subject: [PATCH] test: ipa: ipa_interface: Use IPAManager::createIPA() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The goal of ipa_interface is to unit test the IPA interface. It currently creates the IPA proxy through the higher level PipelineHandler class. Use the IPAManager::createIPA() function instead to keep the focus on the components that were meant to be tested. Signed-off-by: Laurent Pinchart Reviewed-by: Barnabás Pőcze Reviewed-by: Isaac Scott --- test/ipa/ipa_interface_test.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/test/ipa/ipa_interface_test.cpp b/test/ipa/ipa_interface_test.cpp index ccff6ac1..41ef8172 100644 --- a/test/ipa/ipa_interface_test.cpp +++ b/test/ipa/ipa_interface_test.cpp @@ -22,6 +22,8 @@ #include "libcamera/internal/camera_manager.h" #include "libcamera/internal/device_enumerator.h" +#include "libcamera/internal/global_configuration.h" +#include "libcamera/internal/ipa_manager.h" #include "libcamera/internal/ipa_module.h" #include "libcamera/internal/pipeline_handler.h" @@ -43,6 +45,8 @@ public: { delete notifier_; ipa_.reset(); + ipaManager_.reset(); + config_.reset(); cameraManager_.reset(); } @@ -90,6 +94,10 @@ protected: notifier_ = new EventNotifier(fd_, EventNotifier::Read, this); notifier_->activated.connect(this, &IPAInterfaceTest::readTrace); + /* Create the IPA manager. */ + config_ = std::make_unique(); + ipaManager_ = std::make_unique(*config_); + return TestPass; } @@ -98,7 +106,7 @@ protected: EventDispatcher *dispatcher = thread()->eventDispatcher(); Timer timer; - ipa_ = pipe_->createIPA(0, 0); + ipa_ = ipaManager_->createIPA(pipe_.get(), 0, 0); if (!ipa_) { cerr << "Failed to create VIMC IPA interface" << endl; return TestFail; @@ -173,6 +181,8 @@ private: std::shared_ptr pipe_; std::unique_ptr ipa_; std::unique_ptr cameraManager_; + std::unique_ptr config_; + std::unique_ptr ipaManager_; enum ipa::vimc::IPAOperationCode trace_; EventNotifier *notifier_; int fd_;