From patchwork Thu May 23 16:42:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 1276 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 5624E60E9A for ; Thu, 23 May 2019 18:42:24 +0200 (CEST) Received: from localhost.localdomain (unknown [96.44.9.117]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 8710E334; Thu, 23 May 2019 18:42:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1558629743; bh=MDetvA1r4J7U+kkvKENYB9a7EkV2cZ8hSTXajqci7ew=; h=From:To:Cc:Subject:Date:From; b=fqLK3bdWdfjYkaHQ217p4VpOhYsK5Y9tnYprTaNaBL1UaxQELx8JkVCyXLA5p0m6b NvnJUSSwC1+k0r78MxkyZWpZ5l4Ec6OH3N/ElflMsjjzfH19MsP28K/VeDzwmYiaRE 3IKdjSZvQfJEltwHg5Z0Ovu5NZsleWOnOkmioMaY= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Thu, 23 May 2019 12:42:05 -0400 Message-Id: <20190523164210.2105-1-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v2 0/5] Add IPAManager 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: Thu, 23 May 2019 16:42:24 -0000 Pipeline handlers need a way to acquire an IPA module. To achieve this, we use an IPA manager, that loads many IPA modules, after which a pipeline handler can ask the IPA manager for an IPA module that matches it. Each IPA can only be used with one pipeline, but a pipeline may work with many IPAs (not simultaneously). I took inspiration from the DeviceEnumerator, and went for one IPAManager, that scans a directory (or many) for IPA modules, and loads them into a list, after which a pipeline handler can aquire one. 5/5 "libcamera: pipelines: add IPAManager" shows how this might work. The pipeline handler fills in parameters into a struct IPAModuleInfo which the IPA manager uses to find a matching IPA module. Changes in v2: - added documentation - made IPAManager into a real singleton (not my misunderstood one) - removed IPAManager as a parameter to PipelineHandler::match() - IPAManager returns non-const IPAModule Paul Elder (5): libcamera: ipa_module_info: update struct to allow IPA matching libcamera: ipa_module: add aquired attribute libcamera: ipa_manager: implement class for managing IPA modules test: ipa_manager: add test for IPAManager libcamera: pipelines: uvcvideo: add IPAManager Documentation/Doxyfile.in | 7 +- include/libcamera/ipa/ipa_module_info.h | 8 +- src/libcamera/include/ipa_manager.h | 39 ++++++++ src/libcamera/include/ipa_module.h | 5 + src/libcamera/ipa_manager.cpp | 122 ++++++++++++++++++++++++ src/libcamera/ipa_module.cpp | 62 ++++++++++-- src/libcamera/meson.build | 2 + src/libcamera/pipeline/uvcvideo.cpp | 16 +++- test/ipa/ipa_manager_test.cpp | 45 +++++++++ test/ipa/ipa_test.cpp | 37 ++++--- test/ipa/meson.build | 3 +- test/ipa/shared_test.c | 4 +- test/ipa/shared_test.cpp | 6 +- 13 files changed, 328 insertions(+), 28 deletions(-) create mode 100644 src/libcamera/include/ipa_manager.h create mode 100644 src/libcamera/ipa_manager.cpp create mode 100644 test/ipa/ipa_manager_test.cpp