@@ -65,6 +65,7 @@ pipeline_ipa_mojom_mapping = {
'ipu3': 'ipu3.mojom',
'rkisp1': 'rkisp1.mojom',
'rpi/vc4': 'raspberrypi.mojom',
+ 'simple/linaro': 'soft.mojom',
'vimc': 'vimc.mojom',
}
new file mode 100644
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+
+/*
+ * \todo Document the interface and remove the related EXCLUDE_PATTERNS entry.
+ * \todo Add a way to tell SoftIPA the list of params SoftISP accepts?
+ */
+
+module ipa.soft;
+
+import "include/libcamera/ipa/core.mojom";
+
+interface IPASoftInterface {
+ init(libcamera.IPASettings settings,
+ libcamera.SharedFD fdStats,
+ libcamera.ControlInfoMap sensorCtrlInfoMap)
+ => (int32 ret);
+ start() => (int32 ret);
+ stop();
+ configure(libcamera.ControlInfoMap sensorCtrlInfoMap)
+ => (int32 ret);
+
+ [async] processStats(libcamera.ControlList sensorControls);
+};
+
+interface IPASoftEventInterface {
+ setSensorControls(libcamera.ControlList sensorControls);
+};
new file mode 100644
@@ -0,0 +1,17 @@
+# SPDX-License-Identifier: CC0-1.0
+
+soft_ipa_common_sources = files([
+ 'soft_base.cpp',
+])
+
+soft_ipa_common_includes = [
+ include_directories('..'),
+]
+
+soft_ipa_common_deps = [
+ libcamera_private,
+]
+
+soft_ipa_common_lib = static_library('soft_ipa_common', soft_ipa_common_sources,
+ include_directories : soft_ipa_common_includes,
+ dependencies : soft_ipa_common_deps)
new file mode 100644
@@ -0,0 +1,66 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * Copyright (C) 2023, Linaro Ltd
+ *
+ * soft-base.cpp - Software IPA base class
+ */
+
+#include "soft_base.h"
+
+#include <sys/mman.h>
+
+#include <libcamera/base/file.h>
+#include <libcamera/base/log.h>
+
+#include <libcamera/control_ids.h>
+
+namespace libcamera {
+
+LOG_DEFINE_CATEGORY(IPASoft)
+
+namespace ipa::soft {
+
+IPASoftBase::IPASoftBase()
+{
+}
+
+IPASoftBase::~IPASoftBase()
+{
+}
+
+int IPASoftBase::init([[maybe_unused]] const IPASettings &settings,
+ const SharedFD &fdStats,
+ const ControlInfoMap &sensorInfoMap)
+{
+ fdStats_ = std::move(fdStats);
+ if (!fdStats_.isValid()) {
+ LOG(IPASoft, Error) << "Invalid Statistics handle";
+ return -ENODEV;
+ }
+
+ return platformInit(sensorInfoMap);
+}
+
+int IPASoftBase::configure(const ControlInfoMap &sensorInfoMap)
+{
+ return platformConfigure(sensorInfoMap);
+}
+
+int IPASoftBase::start()
+{
+ return platformStart();
+}
+
+void IPASoftBase::stop()
+{
+ return platformStop();
+}
+
+void IPASoftBase::processStats(const ControlList &sensorControls)
+{
+ return platformProcessStats(sensorControls);
+}
+
+} /* namespace ipa::soft */
+
+} /* namespace libcamera */
new file mode 100644
@@ -0,0 +1,47 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+/*
+ * Copyright (C) 2023, Linaro Ltd
+ *
+ * soft-base.h - Software IPA base class
+ */
+#pragma once
+
+#include <libcamera/base/shared_fd.h>
+#include <libcamera/controls.h>
+
+#include <libcamera/ipa/soft_ipa_interface.h>
+
+namespace libcamera {
+
+namespace ipa::soft {
+
+class IPASoftBase : public ipa::soft::IPASoftInterface
+{
+public:
+ IPASoftBase();
+ ~IPASoftBase();
+
+ int init(const IPASettings &settings,
+ const SharedFD &fdStats,
+ const ControlInfoMap &sensorInfoMap) override;
+ int configure(const ControlInfoMap &sensorInfoMap) override;
+
+ int start() override;
+ void stop() override;
+
+ void processStats(const ControlList &sensorControls) override;
+
+protected:
+ SharedFD fdStats_;
+
+private:
+ virtual int platformInit(const ControlInfoMap &sensorInfoMap) = 0;
+ virtual int platformConfigure(const ControlInfoMap &sensorInfoMap) = 0;
+ virtual int platformStart() = 0;
+ virtual void platformStop() = 0;
+ virtual void platformProcessStats(const ControlList &sensorControls) = 0;
+};
+
+} /* namespace ipa::soft */
+
+} /* namespace libcamera */
new file mode 100644
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: CC0-1.0
+
+subdir('common')
Define the Soft IPA main and event interfaces, add IPASoftBase class the Soft IPA implementation inherit from. Signed-off-by: Andrey Konovalov <andrey.konovalov@linaro.org> --- include/libcamera/ipa/meson.build | 1 + include/libcamera/ipa/soft.mojom | 27 ++++++++++++ src/ipa/simple/common/meson.build | 17 ++++++++ src/ipa/simple/common/soft_base.cpp | 66 +++++++++++++++++++++++++++++ src/ipa/simple/common/soft_base.h | 47 ++++++++++++++++++++ src/ipa/simple/meson.build | 3 ++ 6 files changed, 161 insertions(+) create mode 100644 include/libcamera/ipa/soft.mojom create mode 100644 src/ipa/simple/common/meson.build create mode 100644 src/ipa/simple/common/soft_base.cpp create mode 100644 src/ipa/simple/common/soft_base.h create mode 100644 src/ipa/simple/meson.build