[libcamera-devel,RFC,5/7] libcamera: software_isp: introduce getStatsFD()
diff mbox series

Message ID 20231204001013.404720-6-andrey.konovalov@linaro.org
State Superseded
Headers show
Series
  • libcamera: introduce Software ISP and Software IPA
Related show

Commit Message

Andrey Konovalov Dec. 4, 2023, 12:10 a.m. UTC
The shared memory for passing the statistics to the Soft IPA is
allocated inside the Soft ISP. The FD of this memory needs to
be passed to the IPA.

Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org>
---
 include/libcamera/internal/software_isp.h              | 4 ++++
 include/libcamera/internal/software_isp/swisp_linaro.h | 2 ++
 2 files changed, 6 insertions(+)

Patch
diff mbox series

diff --git a/include/libcamera/internal/software_isp.h b/include/libcamera/internal/software_isp.h
index 556203d9..2ce3c68a 100644
--- a/include/libcamera/internal/software_isp.h
+++ b/include/libcamera/internal/software_isp.h
@@ -16,6 +16,7 @@ 
 #include <vector>
 
 #include <libcamera/base/class.h>
+#include <libcamera/base/shared_fd.h>
 #include <libcamera/base/signal.h>
 
 #include <libcamera/geometry.h>
@@ -53,6 +54,9 @@  public:
 	virtual int queueBuffers(FrameBuffer *input,
 				 const std::map<unsigned int, FrameBuffer *> &outputs) = 0;
 
+	/* A hack to pass the FD from Soft ISP to Soft IPA */
+	virtual const SharedFD &getStatsFD() = 0;
+
 	Signal<FrameBuffer *> inputBufferReady;
 	Signal<FrameBuffer *> outputBufferReady;
 
diff --git a/include/libcamera/internal/software_isp/swisp_linaro.h b/include/libcamera/internal/software_isp/swisp_linaro.h
index 0d8a31a6..157898a8 100644
--- a/include/libcamera/internal/software_isp/swisp_linaro.h
+++ b/include/libcamera/internal/software_isp/swisp_linaro.h
@@ -44,6 +44,8 @@  public:
 	int queueBuffers(FrameBuffer *input,
 			 const std::map<unsigned int, FrameBuffer *> &outputs);
 
+	const SharedFD &getStatsFD() { return sharedStats_.fd(); }
+
 	void process(FrameBuffer *input, FrameBuffer *output);
 
 private: