From patchwork Wed Dec 12 17:04:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 42 Return-Path: Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 34CAE60A71 for ; Wed, 12 Dec 2018 18:04:50 +0100 (CET) X-Originating-IP: 2.224.242.101 Received: from w540.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id A255E24000A; Wed, 12 Dec 2018 17:04:49 +0000 (UTC) From: Jacopo Mondi To: libcamera-devel@lists.libcamera.org Date: Wed, 12 Dec 2018 18:04:42 +0100 Message-Id: <1544634282-19854-1-git-send-email-jacopo@jmondi.org> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH] libcamera: Add pipeline manager file hierarchy X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Dec 2018 17:04:50 -0000 Add a pure virtual base class to define the PipelineManager interface and an empty IPU3 implementation of the hierarchy. This commit mostly validates the file hierarchy, build system and doxygen documentation. Signed-off-by: Jacopo Mondi --- Patch based on current master + Laurent's Doxygen series + mine std=c++11 patch The resulting file hierarchy in the 'src' dir is the following one: $ tree src/ src/ ├── libcamera │   ├── hw │   │   ├── ipu3 │   │   │   ├── ipu3_pipeline_manager.cpp │   │   │   └── meson.build │   │   └── meson.build │   ├── include │   │   ├── hw │   │   │   └── ipu3 │   │   │   └── ipu3_pipeline_manager.h │   │   ├── log.h │   │   ├── pipeline_manager.h │   │   └── utils.h │   ├── log.cpp │   ├── main.cpp │   └── meson.build └── meson.build 6 directories, 11 files --- src/libcamera/hw/ipu3/ipu3_pipeline_manager.cpp | 36 ++++++++++++++++++++++ src/libcamera/hw/ipu3/meson.build | 3 ++ src/libcamera/hw/meson.build | 1 + .../include/hw/ipu3/ipu3_pipeline_manager.h | 22 +++++++++++++ src/libcamera/include/pipeline_manager.h | 36 ++++++++++++++++++++++ src/libcamera/main.cpp | 7 +++++ src/libcamera/meson.build | 2 ++ 7 files changed, 107 insertions(+) create mode 100644 src/libcamera/hw/ipu3/ipu3_pipeline_manager.cpp create mode 100644 src/libcamera/hw/ipu3/meson.build create mode 100644 src/libcamera/hw/meson.build create mode 100644 src/libcamera/include/hw/ipu3/ipu3_pipeline_manager.h create mode 100644 src/libcamera/include/pipeline_manager.h -- 2.7.4 diff --git a/src/libcamera/hw/ipu3/ipu3_pipeline_manager.cpp b/src/libcamera/hw/ipu3/ipu3_pipeline_manager.cpp new file mode 100644 index 0000000..4593fb3 --- /dev/null +++ b/src/libcamera/hw/ipu3/ipu3_pipeline_manager.cpp @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2018, Google Inc. + * + * ipu3_pipeline_manager.cpp - Intel IPU3 pipeline manager + */ + +#include "hw/ipu3/ipu3_pipeline_manager.h" + +/** + * \file ipu3_pipeline_manager.h + * \brief Intel IPU3 pipeline manager + */ + +namespace libcamera { + +/** + * \class IPU3PipelineManager + * \brief Intel IPU3 pipeline manager + */ + +/** + * \fn int IPU3PipelineManager::init() + * \brief Initialize the IPU3 pipeline manager + * + * The Intel IPU3 ISP exposes two media controllers, one for the + * cio2 interface, and one for the imgU unit. + * + * Open and enumerate entities from both the media graphs. + */ +int IPU3PipelineManager::init() +{ + return 0; +} + +} /* namespace libcamera */ diff --git a/src/libcamera/hw/ipu3/meson.build b/src/libcamera/hw/ipu3/meson.build new file mode 100644 index 0000000..e5a74a9 --- /dev/null +++ b/src/libcamera/hw/ipu3/meson.build @@ -0,0 +1,3 @@ +libcamera_sources += files([ + 'ipu3_pipeline_manager.cpp', +]) diff --git a/src/libcamera/hw/meson.build b/src/libcamera/hw/meson.build new file mode 100644 index 0000000..f434c79 --- /dev/null +++ b/src/libcamera/hw/meson.build @@ -0,0 +1 @@ +subdir('ipu3') diff --git a/src/libcamera/include/hw/ipu3/ipu3_pipeline_manager.h b/src/libcamera/include/hw/ipu3/ipu3_pipeline_manager.h new file mode 100644 index 0000000..74d0a11 --- /dev/null +++ b/src/libcamera/include/hw/ipu3/ipu3_pipeline_manager.h @@ -0,0 +1,22 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2018, Google Inc. + * + * ipu3_pipeline_manager.h - Intel IPU3 pipeline manager + */ +#ifndef __LIBCAMERA_HW_IPU3_PIPELINE_MANAGER_H__ +#define __LIBCAMERA_HW_IPU3_PIPELINE_MANAGER_H__ + +#include "pipeline_manager.h" + +namespace libcamera { + +class IPU3PipelineManager : public PipelineManager +{ +public: + ~IPU3PipelineManager() { } + int init(void); +}; + +} /* namespace libcamera */ +#endif /* __LIBCAMERA_HW_IPU3_PIPELINE_MANAGER_H__ */ diff --git a/src/libcamera/include/pipeline_manager.h b/src/libcamera/include/pipeline_manager.h new file mode 100644 index 0000000..1722d77 --- /dev/null +++ b/src/libcamera/include/pipeline_manager.h @@ -0,0 +1,36 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* + * Copyright (C) 2018, Google Inc. + * + * pipeline_manager.h - Media pipeline managers interface definition + */ +#ifndef __LIBCAMERA_PIPELINE_MANAGER_H__ +#define __LIBCAMERA_PIPELINE_MANAGER_H__ + +/** + * \file pipeline_manager.h + */ + +namespace libcamera { + +/** + * \class PipelineManager + * \brief Pure virtual pipeline manager base class + * + * The PipelineManager abstract class defines the pipeline manager + * interface that HW-specific implementations have to realize. + */ +class PipelineManager +{ +public: + virtual ~PipelineManager() { }; + + /** + * \fn int PipelineManager::init() + * \brief Initialize the pipeline manager + */ + virtual int init(void) = 0; +}; + +} /* namespace libcamera */ +#endif /* __LIBCAMERA_PIPELINE_MANAGER_H__ */ diff --git a/src/libcamera/main.cpp b/src/libcamera/main.cpp index 7ed37df..ef327b0 100644 --- a/src/libcamera/main.cpp +++ b/src/libcamera/main.cpp @@ -8,11 +8,18 @@ #include #include "log.h" +#include "pipeline_manager.h" +#include "hw/ipu3/ipu3_pipeline_manager.h" namespace libcamera { void libcamera::init_lib(void) { + PipelineManager *pipeline = new IPU3PipelineManager; + int ret = pipeline->init(); + if (ret) + LOG(Error) << "Failed to initialize pipeline manager: " << ret; + LOG(Info) << "Lib Camera Init"; } diff --git a/src/libcamera/meson.build b/src/libcamera/meson.build index 0c44b5a..10a71a6 100644 --- a/src/libcamera/meson.build +++ b/src/libcamera/meson.build @@ -13,6 +13,8 @@ includes = [ include_directories('include'), ] +subdir('hw') + libcamera = shared_library('camera', libcamera_sources, install : true,