From patchwork Wed May 22 21:02:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paul Elder X-Patchwork-Id: 1255 Return-Path: Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [213.167.242.64]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2D44F60C02 for ; Wed, 22 May 2019 23:02:39 +0200 (CEST) Received: from localhost.localdomain (unknown [96.44.9.117]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id D4C11443; Wed, 22 May 2019 23:02:36 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1558558957; bh=tC4O7pOJaBnl3i78633BJ54ZbyCVv3cRk3Hmk8GLuU4=; h=From:To:Cc:Subject:Date:From; b=XVsYbWkyqbjyRAcUDuPoEUiJDHhoz9q9y3wuzfRz1sm1snEQh+ZU+VPsFdeBLG4Ks mQ/89fcOdF0ZWbuDe+viAlRUxtJjXfjEOeKUpE5BqXYqFUwu8uoP39uP5WW46vi0Z3 SE7WmFA4fF+vMrHHwWI9lljzeJsoI5FVO5k+fGYI= From: Paul Elder To: libcamera-devel@lists.libcamera.org Date: Wed, 22 May 2019 17:02:15 -0400 Message-Id: <20190522210220.1631-1-paul.elder@ideasonboard.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH 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: Wed, 22 May 2019 21:02:39 -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. I do realize that some (a lot) of the documentation is unfinished, but I wanted to get some feedback on this direction before doing so. 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: add IPAManager include/libcamera/ipa/ipa_module_info.h | 8 +- src/libcamera/camera_manager.cpp | 8 +- src/libcamera/include/ipa_manager.h | 38 +++++++++ src/libcamera/include/ipa_module.h | 5 ++ src/libcamera/include/pipeline_handler.h | 3 +- src/libcamera/ipa_manager.cpp | 102 +++++++++++++++++++++++ src/libcamera/ipa_module.cpp | 21 ++++- src/libcamera/meson.build | 2 + src/libcamera/pipeline/ipu3/ipu3.cpp | 5 +- src/libcamera/pipeline/rkisp1/rkisp1.cpp | 5 +- src/libcamera/pipeline/uvcvideo.cpp | 18 +++- src/libcamera/pipeline/vimc.cpp | 4 +- test/ipa/ipa_manager_test.cpp | 43 ++++++++++ test/ipa/ipa_test.cpp | 37 +++++--- test/ipa/meson.build | 3 +- test/ipa/shared_test.c | 4 +- test/ipa/shared_test.cpp | 6 +- 17 files changed, 283 insertions(+), 29 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