[libcamera-devel,06/11] libcamera: ipa_manager: Return an IPAProxy from createIPA()

Message ID 20200427031713.14013-7-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
In order to provide pipeline handlers with IPA-related helpers on top of
IPAInterface, return the IPAProxy instance from IPAManager::createIPA().
No change is required in the pipeline handlers as the IPAInterface that
was previously returned is implemented by an IPAProxy instance already.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 src/libcamera/include/ipa_manager.h      |  6 +++---
 src/libcamera/include/pipeline_handler.h |  5 +++--
 src/libcamera/ipa_manager.cpp            | 14 +++++++-------
 3 files changed, 13 insertions(+), 12 deletions(-)

Comments

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

On Mon, Apr 27, 2020 at 06:17:08AM +0300, Laurent Pinchart wrote:
> In order to provide pipeline handlers with IPA-related helpers on top of
> IPAInterface, return the IPAProxy instance from IPAManager::createIPA().
> No change is required in the pipeline handlers as the IPAInterface that
> was previously returned is implemented by an IPAProxy instance already.
>
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

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

Thanks
  j

> ---
>  src/libcamera/include/ipa_manager.h      |  6 +++---
>  src/libcamera/include/pipeline_handler.h |  5 +++--
>  src/libcamera/ipa_manager.cpp            | 14 +++++++-------
>  3 files changed, 13 insertions(+), 12 deletions(-)
>
> diff --git a/src/libcamera/include/ipa_manager.h b/src/libcamera/include/ipa_manager.h
> index 6165efb8b145..aa6b9adb1f87 100644
> --- a/src/libcamera/include/ipa_manager.h
> +++ b/src/libcamera/include/ipa_manager.h
> @@ -24,9 +24,9 @@ class IPAManager
>  public:
>  	static IPAManager *instance();
>
> -	std::unique_ptr<IPAInterface> createIPA(PipelineHandler *pipe,
> -						uint32_t maxVersion,
> -						uint32_t minVersion);
> +	std::unique_ptr<IPAProxy> createIPA(PipelineHandler *pipe,
> +					    uint32_t maxVersion,
> +					    uint32_t minVersion);
>
>  private:
>  	std::vector<IPAModule *> modules_;
> diff --git a/src/libcamera/include/pipeline_handler.h b/src/libcamera/include/pipeline_handler.h
> index 3fcfeda4bfee..706413fa6e9f 100644
> --- a/src/libcamera/include/pipeline_handler.h
> +++ b/src/libcamera/include/pipeline_handler.h
> @@ -15,11 +15,12 @@
>  #include <sys/types.h>
>  #include <vector>
>
> -#include <ipa/ipa_interface.h>
>  #include <libcamera/controls.h>
>  #include <libcamera/object.h>
>  #include <libcamera/stream.h>
>
> +#include "ipa_proxy.h"
> +
>  namespace libcamera {
>
>  class Camera;
> @@ -46,7 +47,7 @@ public:
>  	std::list<Request *> queuedRequests_;
>  	ControlInfoMap controlInfo_;
>  	ControlList properties_;
> -	std::unique_ptr<IPAInterface> ipa_;
> +	std::unique_ptr<IPAProxy> ipa_;
>
>  private:
>  	CameraData(const CameraData &) = delete;
> diff --git a/src/libcamera/ipa_manager.cpp b/src/libcamera/ipa_manager.cpp
> index 50b6792d6cce..df3786797010 100644
> --- a/src/libcamera/ipa_manager.cpp
> +++ b/src/libcamera/ipa_manager.cpp
> @@ -247,17 +247,17 @@ unsigned int IPAManager::addDir(const char *libDir, unsigned int maxDepth)
>  }
>
>  /**
> - * \brief Create an IPA interface that matches a given pipeline handler
> - * \param[in] pipe The pipeline handler that wants a matching IPA interface
> + * \brief Create an IPA proxy that matches a given pipeline handler
> + * \param[in] pipe The pipeline handler that wants a matching IPA proxy
>   * \param[in] minVersion Minimum acceptable version of IPA module
>   * \param[in] maxVersion Maximum acceptable version of IPA module
>   *
> - * \return A newly created IPA interface, or nullptr if no matching
> - * IPA module is found or if the IPA interface fails to initialize
> + * \return A newly created IPA proxy, or nullptr if no matching IPA module is
> + * found or if the IPA proxy fails to initialize
>   */
> -std::unique_ptr<IPAInterface> IPAManager::createIPA(PipelineHandler *pipe,
> -						    uint32_t maxVersion,
> -						    uint32_t minVersion)
> +std::unique_ptr<IPAProxy> IPAManager::createIPA(PipelineHandler *pipe,
> +						uint32_t maxVersion,
> +						uint32_t minVersion)
>  {
>  	IPAModule *m = nullptr;
>
> --
> Regards,
>
> Laurent Pinchart
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
Kieran Bingham April 27, 2020, 12:30 p.m. UTC | #2
Hi Laurent,

On 27/04/2020 04:17, Laurent Pinchart wrote:
> In order to provide pipeline handlers with IPA-related helpers on top of
> IPAInterface, return the IPAProxy instance from IPAManager::createIPA().
> No change is required in the pipeline handlers as the IPAInterface that
> was previously returned is implemented by an IPAProxy instance already.
> 
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

I guess we'll see how this gets used in the coming patches...

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

> ---
>  src/libcamera/include/ipa_manager.h      |  6 +++---
>  src/libcamera/include/pipeline_handler.h |  5 +++--
>  src/libcamera/ipa_manager.cpp            | 14 +++++++-------
>  3 files changed, 13 insertions(+), 12 deletions(-)
> 
> diff --git a/src/libcamera/include/ipa_manager.h b/src/libcamera/include/ipa_manager.h
> index 6165efb8b145..aa6b9adb1f87 100644
> --- a/src/libcamera/include/ipa_manager.h
> +++ b/src/libcamera/include/ipa_manager.h
> @@ -24,9 +24,9 @@ class IPAManager
>  public:
>  	static IPAManager *instance();
>  
> -	std::unique_ptr<IPAInterface> createIPA(PipelineHandler *pipe,
> -						uint32_t maxVersion,
> -						uint32_t minVersion);
> +	std::unique_ptr<IPAProxy> createIPA(PipelineHandler *pipe,
> +					    uint32_t maxVersion,
> +					    uint32_t minVersion);
>  
>  private:
>  	std::vector<IPAModule *> modules_;
> diff --git a/src/libcamera/include/pipeline_handler.h b/src/libcamera/include/pipeline_handler.h
> index 3fcfeda4bfee..706413fa6e9f 100644
> --- a/src/libcamera/include/pipeline_handler.h
> +++ b/src/libcamera/include/pipeline_handler.h
> @@ -15,11 +15,12 @@
>  #include <sys/types.h>
>  #include <vector>
>  
> -#include <ipa/ipa_interface.h>
>  #include <libcamera/controls.h>
>  #include <libcamera/object.h>
>  #include <libcamera/stream.h>
>  
> +#include "ipa_proxy.h"
> +
>  namespace libcamera {
>  
>  class Camera;
> @@ -46,7 +47,7 @@ public:
>  	std::list<Request *> queuedRequests_;
>  	ControlInfoMap controlInfo_;
>  	ControlList properties_;
> -	std::unique_ptr<IPAInterface> ipa_;
> +	std::unique_ptr<IPAProxy> ipa_;
>  
>  private:
>  	CameraData(const CameraData &) = delete;
> diff --git a/src/libcamera/ipa_manager.cpp b/src/libcamera/ipa_manager.cpp
> index 50b6792d6cce..df3786797010 100644
> --- a/src/libcamera/ipa_manager.cpp
> +++ b/src/libcamera/ipa_manager.cpp
> @@ -247,17 +247,17 @@ unsigned int IPAManager::addDir(const char *libDir, unsigned int maxDepth)
>  }
>  
>  /**
> - * \brief Create an IPA interface that matches a given pipeline handler
> - * \param[in] pipe The pipeline handler that wants a matching IPA interface
> + * \brief Create an IPA proxy that matches a given pipeline handler
> + * \param[in] pipe The pipeline handler that wants a matching IPA proxy
>   * \param[in] minVersion Minimum acceptable version of IPA module
>   * \param[in] maxVersion Maximum acceptable version of IPA module
>   *
> - * \return A newly created IPA interface, or nullptr if no matching
> - * IPA module is found or if the IPA interface fails to initialize
> + * \return A newly created IPA proxy, or nullptr if no matching IPA module is
> + * found or if the IPA proxy fails to initialize
>   */
> -std::unique_ptr<IPAInterface> IPAManager::createIPA(PipelineHandler *pipe,
> -						    uint32_t maxVersion,
> -						    uint32_t minVersion)
> +std::unique_ptr<IPAProxy> IPAManager::createIPA(PipelineHandler *pipe,
> +						uint32_t maxVersion,
> +						uint32_t minVersion)
>  {
>  	IPAModule *m = nullptr;
>  
>

Patch

diff --git a/src/libcamera/include/ipa_manager.h b/src/libcamera/include/ipa_manager.h
index 6165efb8b145..aa6b9adb1f87 100644
--- a/src/libcamera/include/ipa_manager.h
+++ b/src/libcamera/include/ipa_manager.h
@@ -24,9 +24,9 @@  class IPAManager
 public:
 	static IPAManager *instance();
 
-	std::unique_ptr<IPAInterface> createIPA(PipelineHandler *pipe,
-						uint32_t maxVersion,
-						uint32_t minVersion);
+	std::unique_ptr<IPAProxy> createIPA(PipelineHandler *pipe,
+					    uint32_t maxVersion,
+					    uint32_t minVersion);
 
 private:
 	std::vector<IPAModule *> modules_;
diff --git a/src/libcamera/include/pipeline_handler.h b/src/libcamera/include/pipeline_handler.h
index 3fcfeda4bfee..706413fa6e9f 100644
--- a/src/libcamera/include/pipeline_handler.h
+++ b/src/libcamera/include/pipeline_handler.h
@@ -15,11 +15,12 @@ 
 #include <sys/types.h>
 #include <vector>
 
-#include <ipa/ipa_interface.h>
 #include <libcamera/controls.h>
 #include <libcamera/object.h>
 #include <libcamera/stream.h>
 
+#include "ipa_proxy.h"
+
 namespace libcamera {
 
 class Camera;
@@ -46,7 +47,7 @@  public:
 	std::list<Request *> queuedRequests_;
 	ControlInfoMap controlInfo_;
 	ControlList properties_;
-	std::unique_ptr<IPAInterface> ipa_;
+	std::unique_ptr<IPAProxy> ipa_;
 
 private:
 	CameraData(const CameraData &) = delete;
diff --git a/src/libcamera/ipa_manager.cpp b/src/libcamera/ipa_manager.cpp
index 50b6792d6cce..df3786797010 100644
--- a/src/libcamera/ipa_manager.cpp
+++ b/src/libcamera/ipa_manager.cpp
@@ -247,17 +247,17 @@  unsigned int IPAManager::addDir(const char *libDir, unsigned int maxDepth)
 }
 
 /**
- * \brief Create an IPA interface that matches a given pipeline handler
- * \param[in] pipe The pipeline handler that wants a matching IPA interface
+ * \brief Create an IPA proxy that matches a given pipeline handler
+ * \param[in] pipe The pipeline handler that wants a matching IPA proxy
  * \param[in] minVersion Minimum acceptable version of IPA module
  * \param[in] maxVersion Maximum acceptable version of IPA module
  *
- * \return A newly created IPA interface, or nullptr if no matching
- * IPA module is found or if the IPA interface fails to initialize
+ * \return A newly created IPA proxy, or nullptr if no matching IPA module is
+ * found or if the IPA proxy fails to initialize
  */
-std::unique_ptr<IPAInterface> IPAManager::createIPA(PipelineHandler *pipe,
-						    uint32_t maxVersion,
-						    uint32_t minVersion)
+std::unique_ptr<IPAProxy> IPAManager::createIPA(PipelineHandler *pipe,
+						uint32_t maxVersion,
+						uint32_t minVersion)
 {
 	IPAModule *m = nullptr;