[libcamera-devel,v4,21/37] libcamera: IPAManager: Fetch IPAProxy corresponding to pipeline
diff mbox series

Message ID 20201106103707.49660-22-paul.elder@ideasonboard.com
State Superseded
Headers show
Series
  • IPA isolation implementation
Related show

Commit Message

Paul Elder Nov. 6, 2020, 10:36 a.m. UTC
Now that each pipeline handler has its own IPAProxy implementation, make
the IPAManager fetch the IPAProxy based on the pipeline handler name.
Also, since the IPAProxy is used regardless of isolation or no
isolation, remove the isolation check from the proxy selection.

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

---
No change in v4

No change in v3

No change in v2
---
 src/libcamera/ipa_manager.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Niklas Söderlund Nov. 12, 2020, 11:09 a.m. UTC | #1
Hi Paul,

Thanks for your work.

On 2020-11-06 19:36:51 +0900, Paul Elder wrote:
> Now that each pipeline handler has its own IPAProxy implementation, make
> the IPAManager fetch the IPAProxy based on the pipeline handler name.
> Also, since the IPAProxy is used regardless of isolation or no
> isolation, remove the isolation check from the proxy selection.
> 
> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>

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

> 
> ---
> No change in v4
> 
> No change in v3
> 
> No change in v2
> ---
>  src/libcamera/ipa_manager.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/libcamera/ipa_manager.cpp b/src/libcamera/ipa_manager.cpp
> index ad05b9c9..12cf3b0d 100644
> --- a/src/libcamera/ipa_manager.cpp
> +++ b/src/libcamera/ipa_manager.cpp
> @@ -275,8 +275,8 @@ std::unique_ptr<IPAProxy> IPAManager::createIPA(PipelineHandler *pipe,
>  	 *
>  	 * \todo Implement a better proxy selection
>  	 */
> -	const char *proxyName = self_->isSignatureValid(m)
> -			      ? "IPAProxyThread" : "IPAProxyLinux";
> +	std::string pipeName(pipe->name());
> +	const char *proxyName = pipeName.replace(0, 15, "IPAProxy").c_str();
>  	IPAProxyFactory *pf = nullptr;
>  
>  	for (IPAProxyFactory *factory : IPAProxyFactory::factories()) {
> -- 
> 2.27.0
> 
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
Jacopo Mondi Nov. 17, 2020, 4:49 p.m. UTC | #2
Hi Paul,

On Fri, Nov 06, 2020 at 07:36:51PM +0900, Paul Elder wrote:
> Now that each pipeline handler has its own IPAProxy implementation, make
> the IPAManager fetch the IPAProxy based on the pipeline handler name.
> Also, since the IPAProxy is used regardless of isolation or no
> isolation, remove the isolation check from the proxy selection.
>
> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
>

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

Thanks
  j

> ---
> No change in v4
>
> No change in v3
>
> No change in v2
> ---
>  src/libcamera/ipa_manager.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/libcamera/ipa_manager.cpp b/src/libcamera/ipa_manager.cpp
> index ad05b9c9..12cf3b0d 100644
> --- a/src/libcamera/ipa_manager.cpp
> +++ b/src/libcamera/ipa_manager.cpp
> @@ -275,8 +275,8 @@ std::unique_ptr<IPAProxy> IPAManager::createIPA(PipelineHandler *pipe,
>  	 *
>  	 * \todo Implement a better proxy selection
>  	 */
> -	const char *proxyName = self_->isSignatureValid(m)
> -			      ? "IPAProxyThread" : "IPAProxyLinux";
> +	std::string pipeName(pipe->name());
> +	const char *proxyName = pipeName.replace(0, 15, "IPAProxy").c_str();
>  	IPAProxyFactory *pf = nullptr;
>
>  	for (IPAProxyFactory *factory : IPAProxyFactory::factories()) {
> --
> 2.27.0
>
> _______________________________________________
> libcamera-devel mailing list
> libcamera-devel@lists.libcamera.org
> https://lists.libcamera.org/listinfo/libcamera-devel
Laurent Pinchart Nov. 25, 2020, 7:34 p.m. UTC | #3
Hi Paul,

Thank you for the patch.

On Fri, Nov 06, 2020 at 07:36:51PM +0900, Paul Elder wrote:
> Now that each pipeline handler has its own IPAProxy implementation, make
> the IPAManager fetch the IPAProxy based on the pipeline handler name.
> Also, since the IPAProxy is used regardless of isolation or no
> isolation, remove the isolation check from the proxy selection.
> 
> Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
> 
> ---
> No change in v4
> 
> No change in v3
> 
> No change in v2
> ---
>  src/libcamera/ipa_manager.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/libcamera/ipa_manager.cpp b/src/libcamera/ipa_manager.cpp
> index ad05b9c9..12cf3b0d 100644
> --- a/src/libcamera/ipa_manager.cpp
> +++ b/src/libcamera/ipa_manager.cpp
> @@ -275,8 +275,8 @@ std::unique_ptr<IPAProxy> IPAManager::createIPA(PipelineHandler *pipe,
>  	 *
>  	 * \todo Implement a better proxy selection
>  	 */
> -	const char *proxyName = self_->isSignatureValid(m)
> -			      ? "IPAProxyThread" : "IPAProxyLinux";
> +	std::string pipeName(pipe->name());
> +	const char *proxyName = pipeName.replace(0, 15, "IPAProxy").c_str();

pipeName.replace() is a temporary object, .c_str() will return a pointer
to memory that is then freed.

>  	IPAProxyFactory *pf = nullptr;
>  
>  	for (IPAProxyFactory *factory : IPAProxyFactory::factories()) {

Patch
diff mbox series

diff --git a/src/libcamera/ipa_manager.cpp b/src/libcamera/ipa_manager.cpp
index ad05b9c9..12cf3b0d 100644
--- a/src/libcamera/ipa_manager.cpp
+++ b/src/libcamera/ipa_manager.cpp
@@ -275,8 +275,8 @@  std::unique_ptr<IPAProxy> IPAManager::createIPA(PipelineHandler *pipe,
 	 *
 	 * \todo Implement a better proxy selection
 	 */
-	const char *proxyName = self_->isSignatureValid(m)
-			      ? "IPAProxyThread" : "IPAProxyLinux";
+	std::string pipeName(pipe->name());
+	const char *proxyName = pipeName.replace(0, 15, "IPAProxy").c_str();
 	IPAProxyFactory *pf = nullptr;
 
 	for (IPAProxyFactory *factory : IPAProxyFactory::factories()) {