Patch Detail
Show a patch.
GET /api/1.1/patches/1890/?format=api
{ "id": 1890, "url": "https://patchwork.libcamera.org/api/1.1/patches/1890/?format=api", "web_url": "https://patchwork.libcamera.org/patch/1890/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api", "name": "libcamera", "link_name": "libcamera", "list_id": "libcamera_core", "list_email": "libcamera-devel@lists.libcamera.org", "web_url": "", "scm_url": "", "webscm_url": "" }, "msgid": "<20190829232653.13214-4-niklas.soderlund@ragnatech.se>", "date": "2019-08-29T23:26:42", "name": "[libcamera-devel,v2,03/14] libcamera: pipeline: Move IPA from pipeline to camera data", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "3fdb735102d64d3be74a5917ab970019d2ad5d79", "submitter": { "id": 5, "url": "https://patchwork.libcamera.org/api/1.1/people/5/?format=api", "name": "Niklas Söderlund", "email": "niklas.soderlund@ragnatech.se" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/1890/mbox/", "series": [ { "id": 475, "url": "https://patchwork.libcamera.org/api/1.1/series/475/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=475", "date": "2019-08-29T23:26:40", "name": "libcamera: ipa: Add basic IPA support", "version": 2, "mbox": "https://patchwork.libcamera.org/series/475/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/1890/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/1890/checks/", "tags": {}, "headers": { "Return-Path": "<niklas.soderlund@ragnatech.se>", "Received": [ "from bin-mail-out-06.binero.net (bin-mail-out-06.binero.net\n\t[195.74.38.229])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A5C0F61924\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 30 Aug 2019 01:27:31 +0200 (CEST)", "from bismarck.berto.se (unknown [79.202.45.17])\n\tby bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA\n\tid 8f068823-cab4-11e9-837a-0050569116f7;\n\tFri, 30 Aug 2019 01:27:25 +0200 (CEST)" ], "X-Halon-ID": "8f068823-cab4-11e9-837a-0050569116f7", "Authorized-sender": "niklas@soderlund.pp.se", "From": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Fri, 30 Aug 2019 01:26:42 +0200", "Message-Id": "<20190829232653.13214-4-niklas.soderlund@ragnatech.se>", "X-Mailer": "git-send-email 2.22.1", "In-Reply-To": "<20190829232653.13214-1-niklas.soderlund@ragnatech.se>", "References": "<20190829232653.13214-1-niklas.soderlund@ragnatech.se>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v2 03/14] libcamera: pipeline: Move IPA\n\tfrom pipeline to camera data", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.23", "Precedence": "list", "List-Id": "<libcamera-devel.lists.libcamera.org>", "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>", "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>", "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>", "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>", "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>", "X-List-Received-Date": "Thu, 29 Aug 2019 23:27:32 -0000" }, "content": "The IPA acts on a camera and not on a pipeline which can expose more\nthen one camera. Move the IPA reference to the CameraData and move the\nloading of an IPA from the specific pipeline handler implementation to\nbase PipelineHandler.\n\nIt's still possible to expose a camera without an IPA but if an IPA is\nrequest the camera is not valid and will not be registered in the system\nif a suiting IPA module can't be found.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\nReviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n src/libcamera/include/pipeline_handler.h | 12 +++++--\n src/libcamera/pipeline/vimc.cpp | 8 +----\n src/libcamera/pipeline_handler.cpp | 40 +++++++++++++++++++++++-\n 3 files changed, 50 insertions(+), 10 deletions(-)", "diff": "diff --git a/src/libcamera/include/pipeline_handler.h b/src/libcamera/include/pipeline_handler.h\nindex 1fdef9cea40f1f0a..ffc7adb802215313 100644\n--- a/src/libcamera/include/pipeline_handler.h\n+++ b/src/libcamera/include/pipeline_handler.h\n@@ -15,6 +15,7 @@\n #include <vector>\n \n #include <libcamera/controls.h>\n+#include <libcamera/ipa/ipa_interface.h>\n #include <libcamera/stream.h>\n \n namespace libcamera {\n@@ -33,8 +34,11 @@ class Request;\n class CameraData\n {\n public:\n-\texplicit CameraData(PipelineHandler *pipe)\n-\t\t: pipe_(pipe)\n+\texplicit CameraData(PipelineHandler *pipe,\n+\t\t\t uint32_t minIPAVersion = 0,\n+\t\t\t uint32_t maxIPAVersion = 0)\n+\t\t: pipe_(pipe), ipa_(nullptr), minIPAVersion_(minIPAVersion),\n+\t\t maxIPAVersion_(maxIPAVersion)\n \t{\n \t}\n \tvirtual ~CameraData() {}\n@@ -44,6 +48,10 @@ public:\n \tstd::list<Request *> queuedRequests_;\n \tControlInfoMap controlInfo_;\n \n+\tstd::unique_ptr<IPAInterface> ipa_;\n+\tconst uint32_t minIPAVersion_;\n+\tconst uint32_t maxIPAVersion_;\n+\n private:\n \tCameraData(const CameraData &) = delete;\n \tCameraData &operator=(const CameraData &) = delete;\ndiff --git a/src/libcamera/pipeline/vimc.cpp b/src/libcamera/pipeline/vimc.cpp\nindex 86aefc08a9563d44..be6507cd4bc0d1b9 100644\n--- a/src/libcamera/pipeline/vimc.cpp\n+++ b/src/libcamera/pipeline/vimc.cpp\n@@ -38,7 +38,7 @@ class VimcCameraData : public CameraData\n {\n public:\n \tVimcCameraData(PipelineHandler *pipe)\n-\t\t: CameraData(pipe), sensor_(nullptr), debayer_(nullptr),\n+\t\t: CameraData(pipe, 1, 1), sensor_(nullptr), debayer_(nullptr),\n \t\t scaler_(nullptr), video_(nullptr), raw_(nullptr)\n \t{\n \t}\n@@ -100,8 +100,6 @@ private:\n \t\treturn static_cast<VimcCameraData *>(\n \t\t\tPipelineHandler::cameraData(camera));\n \t}\n-\n-\tstd::unique_ptr<IPAInterface> ipa_;\n };\n \n VimcCameraConfiguration::VimcCameraConfiguration()\n@@ -361,10 +359,6 @@ bool PipelineHandlerVimc::match(DeviceEnumerator *enumerator)\n \tif (!media)\n \t\treturn false;\n \n-\tipa_ = IPAManager::instance()->createIPA(this, 1, 1);\n-\tif (ipa_ == nullptr)\n-\t\tLOG(VIMC, Warning) << \"no matching IPA found\";\n-\n \tstd::unique_ptr<VimcCameraData> data = utils::make_unique<VimcCameraData>(this);\n \n \t/* Locate and open the capture video node. */\ndiff --git a/src/libcamera/pipeline_handler.cpp b/src/libcamera/pipeline_handler.cpp\nindex 3e54aa23d92b9a36..558b4b254d111e31 100644\n--- a/src/libcamera/pipeline_handler.cpp\n+++ b/src/libcamera/pipeline_handler.cpp\n@@ -12,6 +12,7 @@\n #include <libcamera/camera_manager.h>\n \n #include \"device_enumerator.h\"\n+#include \"ipa_manager.h\"\n #include \"log.h\"\n #include \"media_device.h\"\n #include \"utils.h\"\n@@ -49,13 +50,20 @@ LOG_DEFINE_CATEGORY(Pipeline)\n */\n \n /**\n- * \\fn CameraData::CameraData(PipelineHandler *pipe)\n+ * \\fn CameraData::CameraData(PipelineHandler *pipe, uint32_t minIPAVersion,\n+ * uint32_t maxIPAVersion)\n * \\brief Construct a CameraData instance for the given pipeline handler\n * \\param[in] pipe The pipeline handler\n+ * \\param[in] minIPAVersion Minimum acceptable version of IPA module\n+ * \\param[in] maxIPAVersion Maximum acceptable version of IPA module\n *\n * The reference to the pipeline handler is stored internally, the caller shall\n * guarantee that the pointer remains valid as long as the CameraData instance\n * exists.\n+ *\n+ * The IPA maximum and minimum version numbers are used to match with an IPA\n+ * interface that would be compatible with the Camera. If no IPA interface\n+ * is needed for the camera both parameters should be set to 0.\n */\n \n /**\n@@ -96,6 +104,24 @@ LOG_DEFINE_CATEGORY(Pipeline)\n * creating the camera, and shall not be modified afterwards.\n */\n \n+/**\n+ * \\var CameraData::ipa_\n+ * \\brief The IPA module used by the camera\n+ *\n+ * Reference to the Image Processing Algorithms (IPA) operating on the camera's\n+ * stream(s). If no IPAs are in operation this should be set to nullptr.\n+ */\n+\n+/**\n+ * \\var CameraData::minIPAVersion_\n+ * \\brief Minimum acceptable version of IPA module\n+ */\n+\n+/**\n+ * \\var CameraData::maxIPAVersion_\n+ * \\brief Maximum acceptable version of IPA module\n+ */\n+\n /**\n * \\class PipelineHandler\n * \\brief Create and manage cameras based on a set of media devices\n@@ -425,6 +451,18 @@ void PipelineHandler::registerCamera(std::shared_ptr<Camera> camera,\n \t\t\t\t std::unique_ptr<CameraData> data)\n {\n \tdata->camera_ = camera.get();\n+\n+\tif (data->minIPAVersion_ || data->maxIPAVersion_) {\n+\t\tdata->ipa_ = IPAManager::instance()->createIPA(this,\n+\t\t\t\t\t\t\t data->minIPAVersion_,\n+\t\t\t\t\t\t\t data->maxIPAVersion_);\n+\t\tif (!data->ipa_) {\n+\t\t\tLOG(Pipeline, Warning) << \"Skipping \" << camera->name()\n+\t\t\t\t\t << \" no IPA found\";\n+\t\t\treturn;\n+\t\t}\n+\t}\n+\n \tcameraData_[camera.get()] = std::move(data);\n \tcameras_.push_back(camera);\n \tmanager_->addCamera(std::move(camera));\n", "prefixes": [ "libcamera-devel", "v2", "03/14" ] }