Patch Detail
Show a patch.
GET /api/1.1/patches/1867/?format=api
{ "id": 1867, "url": "https://patchwork.libcamera.org/api/1.1/patches/1867/?format=api", "web_url": "https://patchwork.libcamera.org/patch/1867/", "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": "<20190828011710.32128-3-niklas.soderlund@ragnatech.se>", "date": "2019-08-28T01:16:59", "name": "[libcamera-devel,02/13] libcamera: pipeline: Move IPA from pipeline to camera data", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "b057d732f3cf75e1bffcf15d1c9e743abeaa5045", "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/1867/mbox/", "series": [ { "id": 470, "url": "https://patchwork.libcamera.org/api/1.1/series/470/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=470", "date": "2019-08-28T01:16:57", "name": "libcamera: ipa: Add basic IPA support", "version": 1, "mbox": "https://patchwork.libcamera.org/series/470/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/1867/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/1867/checks/", "tags": {}, "headers": { "Return-Path": "<niklas.soderlund@ragnatech.se>", "Received": [ "from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net\n\t[195.74.38.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 677AF60C10\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 28 Aug 2019 03:17:37 +0200 (CEST)", "from bismarck.berto.se (unknown [95.195.154.80])\n\tby bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA\n\tid 953a03c8-c931-11e9-bdc3-005056917a89;\n\tWed, 28 Aug 2019 03:17:21 +0200 (CEST)" ], "X-Halon-ID": "953a03c8-c931-11e9-bdc3-005056917a89", "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": "Wed, 28 Aug 2019 03:16:59 +0200", "Message-Id": "<20190828011710.32128-3-niklas.soderlund@ragnatech.se>", "X-Mailer": "git-send-email 2.22.1", "In-Reply-To": "<20190828011710.32128-1-niklas.soderlund@ragnatech.se>", "References": "<20190828011710.32128-1-niklas.soderlund@ragnatech.se>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH 02/13] libcamera: pipeline: Move IPA from\n\tpipeline 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": "Wed, 28 Aug 2019 01:17:37 -0000" }, "content": "The IPA acts on a camera and not on a pipeline which can expose more\nthen once 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>\n---\n src/libcamera/include/pipeline_handler.h | 12 ++++++--\n src/libcamera/pipeline/vimc.cpp | 10 +-----\n src/libcamera/pipeline_handler.cpp | 39 +++++++++++++++++++++++-\n 3 files changed, 49 insertions(+), 12 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 e5c4890501db71c8..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,12 +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-\telse\n-\t\tipa_->init();\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..89b67806597728f9 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 IPA 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@@ -424,6 +450,17 @@ void PipelineHandler::completeRequest(Camera *camera, Request *request)\n void PipelineHandler::registerCamera(std::shared_ptr<Camera> camera,\n \t\t\t\t std::unique_ptr<CameraData> data)\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 \tdata->camera_ = camera.get();\n \tcameraData_[camera.get()] = std::move(data);\n \tcameras_.push_back(camera);\n", "prefixes": [ "libcamera-devel", "02/13" ] }