[libcamera-devel] libcamera: ipa: Pass the sensor name and selected mode to the ipa

Message ID 20200217151746.30285-1-naush@raspberrypi.com
State Superseded
Headers show
Series
  • [libcamera-devel] libcamera: ipa: Pass the sensor name and selected mode to the ipa
Related show

Commit Message

Naushir Patuck Feb. 17, 2020, 3:17 p.m. UTC
The ipa needs to know the sensor name to choose the per-camera tuning
settings. It also needs the sensor mode which can be, and is usually
different to the user configured mode. This is required to set any table
based parameters which rely on the sensor programmed mode.

Signed-off-by: Naushir Patuck <naush@raspberrypi.org>
---
 include/ipa/ipa_interface.h              | 3 +++
 src/ipa/libipa/ipa_interface_wrapper.cpp | 8 ++++++++
 2 files changed, 11 insertions(+)

Patch

diff --git a/include/ipa/ipa_interface.h b/include/ipa/ipa_interface.h
index 229d112..6e4b3ef 100644
--- a/include/ipa/ipa_interface.h
+++ b/include/ipa/ipa_interface.h
@@ -95,12 +95,15 @@  struct ipa_context *ipaCreate();
 #include <libcamera/signal.h>
 
 #include "v4l2_controls.h"
+#include "v4l2_videodevice.h"
 
 namespace libcamera {
 
 struct IPAStream {
 	unsigned int pixelFormat;
 	Size size;
+	V4L2DeviceFormat deviceFormat;
+	const char *cameraName;
 };
 
 struct IPABuffer {
diff --git a/src/ipa/libipa/ipa_interface_wrapper.cpp b/src/ipa/libipa/ipa_interface_wrapper.cpp
index b93c1c1..58da86d 100644
--- a/src/ipa/libipa/ipa_interface_wrapper.cpp
+++ b/src/ipa/libipa/ipa_interface_wrapper.cpp
@@ -115,6 +115,14 @@  void IPAInterfaceWrapper::configure(struct ipa_context *_ctx,
 		ipaStreams[stream.id] = {
 			stream.pixel_format,
 			Size(stream.width, stream.height),
+			/*
+			 * The below two fields:
+			 *	V4L2DeviceFormat deviceFormat;
+			 *	const char *cameraName;
+			 * must be filled by the pipeline handlers.
+			 */
+			{},
+			""
 		};
 	}