[libcamera-devel,04/20] ipa: rpi: Add IpaBase::platformStart() member function
diff mbox series

Message ID 20231006132000.23504-5-naush@raspberrypi.com
State Superseded
Headers show
Series
  • Raspberry Pi: Preliminary PiSP support
Related show

Commit Message

Naushir Patuck Oct. 6, 2023, 1:19 p.m. UTC
Add a virtual IpaBase::platformStart() member function that is called
at the end of IpaBase::start(). For the IpaVc4 derived class, this
function does nothing, but will be used in the PiSP derived class to
reset internal state on startup.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
---
 src/ipa/rpi/common/ipa_base.cpp | 2 ++
 src/ipa/rpi/common/ipa_base.h   | 1 +
 src/ipa/rpi/vc4/vc4.cpp         | 7 +++++++
 3 files changed, 10 insertions(+)

Comments

Jacopo Mondi Oct. 12, 2023, 8:09 a.m. UTC | #1
Hi Naush

On Fri, Oct 06, 2023 at 02:19:44PM +0100, Naushir Patuck via libcamera-devel wrote:
> Add a virtual IpaBase::platformStart() member function that is called
> at the end of IpaBase::start(). For the IpaVc4 derived class, this
> function does nothing, but will be used in the PiSP derived class to
> reset internal state on startup.
>
> Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>

Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>

Thanks
  j

> ---
>  src/ipa/rpi/common/ipa_base.cpp | 2 ++
>  src/ipa/rpi/common/ipa_base.h   | 1 +
>  src/ipa/rpi/vc4/vc4.cpp         | 7 +++++++
>  3 files changed, 10 insertions(+)
>
> diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp
> index 5df1998c8113..5939fe57f040 100644
> --- a/src/ipa/rpi/common/ipa_base.cpp
> +++ b/src/ipa/rpi/common/ipa_base.cpp
> @@ -341,6 +341,8 @@ void IpaBase::start(const ControlList &controls, StartResult *result)
>
>  	firstStart_ = false;
>  	lastRunTimestamp_ = 0;
> +
> +	platformStart(controls, result);
>  }
>
>  void IpaBase::mapBuffers(const std::vector<IPABuffer> &buffers)
> diff --git a/src/ipa/rpi/common/ipa_base.h b/src/ipa/rpi/common/ipa_base.h
> index 097f436af93b..eaa9f71182ed 100644
> --- a/src/ipa/rpi/common/ipa_base.h
> +++ b/src/ipa/rpi/common/ipa_base.h
> @@ -67,6 +67,7 @@ private:
>  	static constexpr unsigned int numMetadataContexts = 16;
>
>  	virtual int32_t platformInit(const InitParams &params, InitResult *result) = 0;
> +	virtual int32_t platformStart(const ControlList &controls, StartResult *result) = 0;
>  	virtual int32_t platformConfigure(const ConfigParams &params, ConfigResult *result) = 0;
>
>  	virtual void platformPrepareIsp(const PrepareParams &params,
> diff --git a/src/ipa/rpi/vc4/vc4.cpp b/src/ipa/rpi/vc4/vc4.cpp
> index 1de0d3ccdc44..4a4d720ce7dd 100644
> --- a/src/ipa/rpi/vc4/vc4.cpp
> +++ b/src/ipa/rpi/vc4/vc4.cpp
> @@ -51,6 +51,7 @@ public:
>
>  private:
>  	int32_t platformInit(const InitParams &params, InitResult *result) override;
> +	int32_t platformStart(const ControlList &controls, StartResult *result) override;
>  	int32_t platformConfigure(const ConfigParams &params, ConfigResult *result) override;
>
>  	void platformPrepareIsp(const PrepareParams &params, RPiController::Metadata &rpiMetadata) override;
> @@ -94,6 +95,12 @@ int32_t IpaVc4::platformInit([[maybe_unused]] const InitParams &params, [[maybe_
>  	return 0;
>  }
>
> +int32_t IpaVc4::platformStart([[maybe_unused]] const ControlList &controls,
> +			      [[maybe_unused]] StartResult *result)
> +{
> +	return 0;
> +}
> +
>  int32_t IpaVc4::platformConfigure(const ConfigParams &params, [[maybe_unused]] ConfigResult *result)
>  {
>  	ispCtrls_ = params.ispControls;
> --
> 2.34.1
>

Patch
diff mbox series

diff --git a/src/ipa/rpi/common/ipa_base.cpp b/src/ipa/rpi/common/ipa_base.cpp
index 5df1998c8113..5939fe57f040 100644
--- a/src/ipa/rpi/common/ipa_base.cpp
+++ b/src/ipa/rpi/common/ipa_base.cpp
@@ -341,6 +341,8 @@  void IpaBase::start(const ControlList &controls, StartResult *result)
 
 	firstStart_ = false;
 	lastRunTimestamp_ = 0;
+
+	platformStart(controls, result);
 }
 
 void IpaBase::mapBuffers(const std::vector<IPABuffer> &buffers)
diff --git a/src/ipa/rpi/common/ipa_base.h b/src/ipa/rpi/common/ipa_base.h
index 097f436af93b..eaa9f71182ed 100644
--- a/src/ipa/rpi/common/ipa_base.h
+++ b/src/ipa/rpi/common/ipa_base.h
@@ -67,6 +67,7 @@  private:
 	static constexpr unsigned int numMetadataContexts = 16;
 
 	virtual int32_t platformInit(const InitParams &params, InitResult *result) = 0;
+	virtual int32_t platformStart(const ControlList &controls, StartResult *result) = 0;
 	virtual int32_t platformConfigure(const ConfigParams &params, ConfigResult *result) = 0;
 
 	virtual void platformPrepareIsp(const PrepareParams &params,
diff --git a/src/ipa/rpi/vc4/vc4.cpp b/src/ipa/rpi/vc4/vc4.cpp
index 1de0d3ccdc44..4a4d720ce7dd 100644
--- a/src/ipa/rpi/vc4/vc4.cpp
+++ b/src/ipa/rpi/vc4/vc4.cpp
@@ -51,6 +51,7 @@  public:
 
 private:
 	int32_t platformInit(const InitParams &params, InitResult *result) override;
+	int32_t platformStart(const ControlList &controls, StartResult *result) override;
 	int32_t platformConfigure(const ConfigParams &params, ConfigResult *result) override;
 
 	void platformPrepareIsp(const PrepareParams &params, RPiController::Metadata &rpiMetadata) override;
@@ -94,6 +95,12 @@  int32_t IpaVc4::platformInit([[maybe_unused]] const InitParams &params, [[maybe_
 	return 0;
 }
 
+int32_t IpaVc4::platformStart([[maybe_unused]] const ControlList &controls,
+			      [[maybe_unused]] StartResult *result)
+{
+	return 0;
+}
+
 int32_t IpaVc4::platformConfigure(const ConfigParams &params, [[maybe_unused]] ConfigResult *result)
 {
 	ispCtrls_ = params.ispControls;