[libcamera-devel,v2,2/2] libcamera: ipu3: Pass the BDS rectangle at IPA configure call
diff mbox series

Message ID 20210316101842.18674-4-jeanmichel.hautbois@ideasonboard.com
State Accepted
Headers show
Series
  • Prepare IPU3 pipeline to pass BDS to IPA
Related show

Commit Message

Jean-Michel Hautbois March 16, 2021, 10:18 a.m. UTC
The IPU3 IPA will need the BDS configuration when the AWB/AGC algorithm
will be integrated.
In order to do that, the configure() interface needs to be modified.

Signed-off-by: Jean-Michel Hautbois <jeanmichel.hautbois@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

---
v2:
- rename bds => bdsOutputSize
- use a libcamera::Size instead of libcamera::Rectangle
---
 include/libcamera/ipa/ipu3.mojom     | 2 +-
 src/ipa/ipu3/ipu3.cpp                | 7 +++++--
 src/libcamera/pipeline/ipu3/ipu3.cpp | 1 +
 3 files changed, 7 insertions(+), 3 deletions(-)

Patch
diff mbox series

diff --git a/include/libcamera/ipa/ipu3.mojom b/include/libcamera/ipa/ipu3.mojom
index 6ee11333..5d13e7ea 100644
--- a/include/libcamera/ipa/ipu3.mojom
+++ b/include/libcamera/ipa/ipu3.mojom
@@ -30,7 +30,7 @@  interface IPAIPU3Interface {
 	start() => (int32 ret);
 	stop();
 
-	configure(map<uint32, ControlInfoMap> entityControls) => ();
+	configure(map<uint32, ControlInfoMap> entityControls, Size bdsOutputSize) => ();
 
 	mapBuffers(array<IPABuffer> buffers);
 	unmapBuffers(array<uint32> ids);
diff --git a/src/ipa/ipu3/ipu3.cpp b/src/ipa/ipu3/ipu3.cpp
index b63e58be..be73a225 100644
--- a/src/ipa/ipu3/ipu3.cpp
+++ b/src/ipa/ipu3/ipu3.cpp
@@ -35,7 +35,9 @@  public:
 	int start() override { return 0; }
 	void stop() override {}
 
-	void configure(const std::map<uint32_t, ControlInfoMap> &entityControls) override;
+	void configure(
+		const std::map<uint32_t, ControlInfoMap> &entityControls,
+		const Size &bdsOutputSize) override;
 
 	void mapBuffers(const std::vector<IPABuffer> &buffers) override;
 	void unmapBuffers(const std::vector<unsigned int> &ids) override;
@@ -62,7 +64,8 @@  private:
 	uint32_t maxGain_;
 };
 
-void IPAIPU3::configure(const std::map<uint32_t, ControlInfoMap> &entityControls)
+void IPAIPU3::configure(const std::map<uint32_t, ControlInfoMap> &entityControls,
+			[[maybe_unused]] const Size &bdsOutputSize)
 {
 	if (entityControls.empty())
 		return;
diff --git a/src/libcamera/pipeline/ipu3/ipu3.cpp b/src/libcamera/pipeline/ipu3/ipu3.cpp
index 3f49ded3..022a2e0d 100644
--- a/src/libcamera/pipeline/ipu3/ipu3.cpp
+++ b/src/libcamera/pipeline/ipu3/ipu3.cpp
@@ -719,6 +719,7 @@  int PipelineHandlerIPU3::start(Camera *camera, [[maybe_unused]] const ControlLis
 	IPU3CameraData *data = cameraData(camera);
 	CIO2Device *cio2 = &data->cio2_;
 	ImgUDevice *imgu = data->imgu_;
+	Rectangle bds{ 0, 0, data->pipeConfig_.bds };
 	int ret;
 
 	/* Allocate buffers for internal pipeline usage. */