Patch Detail
Show a patch.
GET /api/patches/8487/?format=api
{ "id": 8487, "url": "https://patchwork.libcamera.org/api/patches/8487/?format=api", "web_url": "https://patchwork.libcamera.org/patch/8487/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/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": "<20200628231934.29025-4-laurent.pinchart@ideasonboard.com>", "date": "2020-06-28T23:19:28", "name": "[libcamera-devel,v1,3/9] libcamera: ipa_interface: Add support for custom IPA data to configure()", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "d42169120049d0379843ac34818567e8507f094b", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/8487/mbox/", "series": [ { "id": 1054, "url": "https://patchwork.libcamera.org/api/series/1054/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1054", "date": "2020-06-28T23:19:25", "name": "Support passing custom data to IPA configure()", "version": 1, "mbox": "https://patchwork.libcamera.org/series/1054/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/8487/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/8487/checks/", "tags": {}, "headers": { "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>", "X-Original-To": "parsemail@patchwork.libcamera.org", "Delivered-To": "parsemail@patchwork.libcamera.org", "Received": [ "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id C6CCEC2E66\n\tfor <parsemail@patchwork.libcamera.org>;\n\tSun, 28 Jun 2020 23:19:47 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 4A50360B00;\n\tMon, 29 Jun 2020 01:19:47 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 6ABFD609C9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 29 Jun 2020 01:19:42 +0200 (CEST)", "from pendragon.bb.dnainternet.fi (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E2DAA9C5;\n\tMon, 29 Jun 2020 01:19:41 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"RH5Yp4Ah\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1593386382;\n\tbh=CTMUxzMR2EM111j84DGC1yyQxVhjO3lsoWawZsZPFLo=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=RH5Yp4AhJ2O2/cGvWWXMdZx23HDu8EjT+q/mC4dvKz+3hJ3B2dftGvHHrZV386wN+\n\tphJIsKZUkDHyZm9JadiWyo/iujZdBJ4Gp9nRoB59yytPwnxQ4COiXtWVGe2gB+6/IW\n\tv5IXccAhoal7NzvvM4bmN2Iz/LHALMGdeGiBp5U4=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 29 Jun 2020 02:19:28 +0300", "Message-Id": "<20200628231934.29025-4-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.27.0", "In-Reply-To": "<20200628231934.29025-1-laurent.pinchart@ideasonboard.com>", "References": "<20200628231934.29025-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH v1 3/9] libcamera: ipa_interface: Add\n\tsupport for custom IPA data to configure()", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.29", "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>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Add two new parameters, ipaConfig and result, to the\nIPAInterface::configure() function to allow pipeline handlers to pass\ncustom data to their IPA, and receive data back. Wire this through the\ncode base. The C API interface will be addressed separately, likely\nthrough automation of the C <-> C++ translation.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/internal/ipa_context_wrapper.h | 4 +++-\n include/libcamera/ipa/ipa_interface.h | 4 +++-\n src/ipa/libipa/ipa_interface_wrapper.cpp | 5 ++++-\n src/ipa/raspberrypi/raspberrypi.cpp | 8 ++++++--\n src/ipa/rkisp1/rkisp1.cpp | 8 ++++++--\n src/ipa/vimc/vimc.cpp | 4 +++-\n src/libcamera/ipa_context_wrapper.cpp | 8 ++++++--\n src/libcamera/ipa_interface.cpp | 7 +++++++\n src/libcamera/pipeline/raspberrypi/raspberrypi.cpp | 4 +++-\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 4 +++-\n src/libcamera/proxy/ipa_proxy_linux.cpp | 4 +++-\n src/libcamera/proxy/ipa_proxy_thread.cpp | 11 ++++++++---\n test/ipa/ipa_wrappers_test.cpp | 8 ++++++--\n 13 files changed, 61 insertions(+), 18 deletions(-)", "diff": "diff --git a/include/libcamera/internal/ipa_context_wrapper.h b/include/libcamera/internal/ipa_context_wrapper.h\nindex 4e6f791d18e6..8f767e844221 100644\n--- a/include/libcamera/internal/ipa_context_wrapper.h\n+++ b/include/libcamera/internal/ipa_context_wrapper.h\n@@ -24,7 +24,9 @@ public:\n \tvoid stop() override;\n \tvoid configure(const CameraSensorInfo &sensorInfo,\n \t\t const std::map<unsigned int, IPAStream> &streamConfig,\n-\t\t const std::map<unsigned int, const ControlInfoMap &> &entityControls) override;\n+\t\t const std::map<unsigned int, const ControlInfoMap &> &entityControls,\n+\t\t const IPAOperationData &ipaConfig,\n+\t\t IPAOperationData *result) override;\n \n \tvoid mapBuffers(const std::vector<IPABuffer> &buffers) override;\n \tvoid unmapBuffers(const std::vector<unsigned int> &ids) override;\ndiff --git a/include/libcamera/ipa/ipa_interface.h b/include/libcamera/ipa/ipa_interface.h\nindex dc9fc714d564..5016ec25ea9c 100644\n--- a/include/libcamera/ipa/ipa_interface.h\n+++ b/include/libcamera/ipa/ipa_interface.h\n@@ -158,7 +158,9 @@ public:\n \n \tvirtual void configure(const CameraSensorInfo &sensorInfo,\n \t\t\t const std::map<unsigned int, IPAStream> &streamConfig,\n-\t\t\t const std::map<unsigned int, const ControlInfoMap &> &entityControls) = 0;\n+\t\t\t const std::map<unsigned int, const ControlInfoMap &> &entityControls,\n+\t\t\t const IPAOperationData &ipaConfig,\n+\t\t\t IPAOperationData *result) = 0;\n \n \tvirtual void mapBuffers(const std::vector<IPABuffer> &buffers) = 0;\n \tvirtual void unmapBuffers(const std::vector<unsigned int> &ids) = 0;\ndiff --git a/src/ipa/libipa/ipa_interface_wrapper.cpp b/src/ipa/libipa/ipa_interface_wrapper.cpp\nindex 2a2e43abc708..47ce5a704851 100644\n--- a/src/ipa/libipa/ipa_interface_wrapper.cpp\n+++ b/src/ipa/libipa/ipa_interface_wrapper.cpp\n@@ -166,7 +166,10 @@ void IPAInterfaceWrapper::configure(struct ipa_context *_ctx,\n \t\tentityControls.emplace(id, infoMaps[id]);\n \t}\n \n-\tctx->ipa_->configure(sensorInfo, ipaStreams, entityControls);\n+\t/* \\todo Translate the ipaConfig and reponse */\n+\tIPAOperationData ipaConfig;\n+\tctx->ipa_->configure(sensorInfo, ipaStreams, entityControls, ipaConfig,\n+\t\t\t nullptr);\n }\n \n void IPAInterfaceWrapper::map_buffers(struct ipa_context *_ctx,\ndiff --git a/src/ipa/raspberrypi/raspberrypi.cpp b/src/ipa/raspberrypi/raspberrypi.cpp\nindex bc89ab58d03a..860be22ddb5d 100644\n--- a/src/ipa/raspberrypi/raspberrypi.cpp\n+++ b/src/ipa/raspberrypi/raspberrypi.cpp\n@@ -78,7 +78,9 @@ public:\n \n \tvoid configure(const CameraSensorInfo &sensorInfo,\n \t\t const std::map<unsigned int, IPAStream> &streamConfig,\n-\t\t const std::map<unsigned int, const ControlInfoMap &> &entityControls) override;\n+\t\t const std::map<unsigned int, const ControlInfoMap &> &entityControls,\n+\t\t const IPAOperationData &data,\n+\t\t IPAOperationData *response) override;\n \tvoid mapBuffers(const std::vector<IPABuffer> &buffers) override;\n \tvoid unmapBuffers(const std::vector<unsigned int> &ids) override;\n \tvoid processEvent(const IPAOperationData &event) override;\n@@ -186,7 +188,9 @@ void IPARPi::setMode(const CameraSensorInfo &sensorInfo)\n \n void IPARPi::configure(const CameraSensorInfo &sensorInfo,\n \t\t const std::map<unsigned int, IPAStream> &streamConfig,\n-\t\t const std::map<unsigned int, const ControlInfoMap &> &entityControls)\n+\t\t const std::map<unsigned int, const ControlInfoMap &> &entityControls,\n+\t\t const IPAOperationData &ipaConfig,\n+\t\t IPAOperationData *result)\n {\n \tif (entityControls.empty())\n \t\treturn;\ndiff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\nindex fbdc908fc816..34d6f63a7ff4 100644\n--- a/src/ipa/rkisp1/rkisp1.cpp\n+++ b/src/ipa/rkisp1/rkisp1.cpp\n@@ -39,7 +39,9 @@ public:\n \n \tvoid configure(const CameraSensorInfo &info,\n \t\t const std::map<unsigned int, IPAStream> &streamConfig,\n-\t\t const std::map<unsigned int, const ControlInfoMap &> &entityControls) override;\n+\t\t const std::map<unsigned int, const ControlInfoMap &> &entityControls,\n+\t\t const IPAOperationData &ipaConfig,\n+\t\t IPAOperationData *response) override;\n \tvoid mapBuffers(const std::vector<IPABuffer> &buffers) override;\n \tvoid unmapBuffers(const std::vector<unsigned int> &ids) override;\n \tvoid processEvent(const IPAOperationData &event) override;\n@@ -76,7 +78,9 @@ private:\n */\n void IPARkISP1::configure(const CameraSensorInfo &info,\n \t\t\t const std::map<unsigned int, IPAStream> &streamConfig,\n-\t\t\t const std::map<unsigned int, const ControlInfoMap &> &entityControls)\n+\t\t\t const std::map<unsigned int, const ControlInfoMap &> &entityControls,\n+\t\t\t const IPAOperationData &ipaConfig,\n+\t\t\t IPAOperationData *result)\n {\n \tif (entityControls.empty())\n \t\treturn;\ndiff --git a/src/ipa/vimc/vimc.cpp b/src/ipa/vimc/vimc.cpp\nindex af278a482b8a..1593c92d80f3 100644\n--- a/src/ipa/vimc/vimc.cpp\n+++ b/src/ipa/vimc/vimc.cpp\n@@ -39,7 +39,9 @@ public:\n \n \tvoid configure(const CameraSensorInfo &sensorInfo,\n \t\t const std::map<unsigned int, IPAStream> &streamConfig,\n-\t\t const std::map<unsigned int, const ControlInfoMap &> &entityControls) override {}\n+\t\t const std::map<unsigned int, const ControlInfoMap &> &entityControls,\n+\t\t const IPAOperationData &ipaConfig,\n+\t\t IPAOperationData *result) override {}\n \tvoid mapBuffers(const std::vector<IPABuffer> &buffers) override {}\n \tvoid unmapBuffers(const std::vector<unsigned int> &ids) override {}\n \tvoid processEvent(const IPAOperationData &event) override {}\ndiff --git a/src/libcamera/ipa_context_wrapper.cpp b/src/libcamera/ipa_context_wrapper.cpp\nindex 471118f57cdc..231300ce0bec 100644\n--- a/src/libcamera/ipa_context_wrapper.cpp\n+++ b/src/libcamera/ipa_context_wrapper.cpp\n@@ -110,10 +110,13 @@ void IPAContextWrapper::stop()\n \n void IPAContextWrapper::configure(const CameraSensorInfo &sensorInfo,\n \t\t\t\t const std::map<unsigned int, IPAStream> &streamConfig,\n-\t\t\t\t const std::map<unsigned int, const ControlInfoMap &> &entityControls)\n+\t\t\t\t const std::map<unsigned int, const ControlInfoMap &> &entityControls,\n+\t\t\t\t const IPAOperationData &ipaConfig,\n+\t\t\t\t IPAOperationData *result)\n {\n \tif (intf_)\n-\t\treturn intf_->configure(sensorInfo, streamConfig, entityControls);\n+\t\treturn intf_->configure(sensorInfo, streamConfig,\n+\t\t\t\t\tentityControls, ipaConfig, result);\n \n \tif (!ctx_)\n \t\treturn;\n@@ -174,6 +177,7 @@ void IPAContextWrapper::configure(const CameraSensorInfo &sensorInfo,\n \t\t++i;\n \t}\n \n+\t/* \\todo Translate the ipaConfig and reponse */\n \tctx_->ops->configure(ctx_, &sensor_info, c_streams, streamConfig.size(),\n \t\t\t c_info_maps, entityControls.size());\n }\ndiff --git a/src/libcamera/ipa_interface.cpp b/src/libcamera/ipa_interface.cpp\nindex ebe47e1233a5..23fc56d7d48e 100644\n--- a/src/libcamera/ipa_interface.cpp\n+++ b/src/libcamera/ipa_interface.cpp\n@@ -557,6 +557,8 @@ namespace libcamera {\n * \\param[in] sensorInfo Camera sensor information\n * \\param[in] streamConfig Configuration of all active streams\n * \\param[in] entityControls Controls provided by the pipeline entities\n+ * \\param[in] ipaConfig Pipeline-handler-specific configuration data\n+ * \\param[out] result Pipeline-handler-specific configuration result\n *\n * This method shall be called when the camera is started to inform the IPA of\n * the camera's streams and the sensor settings. The meaning of the numerical\n@@ -566,6 +568,11 @@ namespace libcamera {\n * The \\a sensorInfo conveys information about the camera sensor settings that\n * the pipeline handler has selected for the configuration. The IPA may use\n * that information to tune its algorithms.\n+ *\n+ * The \\a ipaConfig and \\a result parameters carry custom data passed by the\n+ * pipeline handler to the IPA and back. The pipeline handler may set the \\a\n+ * result parameter to null if the IPA protocol doesn't need to pass a result\n+ * back through the configure() function.\n */\n \n /**\ndiff --git a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\nindex dcd737a1d1a0..3b5cdf1e1849 100644\n--- a/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n+++ b/src/libcamera/pipeline/raspberrypi/raspberrypi.cpp\n@@ -1017,7 +1017,9 @@ int PipelineHandlerRPi::configureIPA(Camera *camera)\n \t}\n \n \t/* Ready the IPA - it must know about the sensor resolution. */\n-\tdata->ipa_->configure(sensorInfo, streamConfig, entityControls);\n+\tIPAOperationData ipaConfig;\n+\tdata->ipa_->configure(sensorInfo, streamConfig, entityControls,\n+\t\t\t ipaConfig, nullptr);\n \n \treturn 0;\n }\ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 3c01821135f8..4fde5539e667 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -843,7 +843,9 @@ int PipelineHandlerRkISP1::start(Camera *camera)\n \tstd::map<unsigned int, const ControlInfoMap &> entityControls;\n \tentityControls.emplace(0, data->sensor_->controls());\n \n-\tdata->ipa_->configure(sensorInfo, streamConfig, entityControls);\n+\tIPAOperationData ipaConfig;\n+\tdata->ipa_->configure(sensorInfo, streamConfig, entityControls,\n+\t\t\t ipaConfig, nullptr);\n \n \treturn ret;\n }\ndiff --git a/src/libcamera/proxy/ipa_proxy_linux.cpp b/src/libcamera/proxy/ipa_proxy_linux.cpp\nindex be34f20aa857..68eafb307b2a 100644\n--- a/src/libcamera/proxy/ipa_proxy_linux.cpp\n+++ b/src/libcamera/proxy/ipa_proxy_linux.cpp\n@@ -31,7 +31,9 @@ public:\n \tvoid stop() override {}\n \tvoid configure(const CameraSensorInfo &sensorInfo,\n \t\t const std::map<unsigned int, IPAStream> &streamConfig,\n-\t\t const std::map<unsigned int, const ControlInfoMap &> &entityControls) override {}\n+\t\t const std::map<unsigned int, const ControlInfoMap &> &entityControls,\n+\t\t const IPAOperationData &ipaConfig,\n+\t\t IPAOperationData *result) override {}\n \tvoid mapBuffers(const std::vector<IPABuffer> &buffers) override {}\n \tvoid unmapBuffers(const std::vector<unsigned int> &ids) override {}\n \tvoid processEvent(const IPAOperationData &event) override {}\ndiff --git a/src/libcamera/proxy/ipa_proxy_thread.cpp b/src/libcamera/proxy/ipa_proxy_thread.cpp\nindex 6fbebed2ba72..aa403e22f297 100644\n--- a/src/libcamera/proxy/ipa_proxy_thread.cpp\n+++ b/src/libcamera/proxy/ipa_proxy_thread.cpp\n@@ -31,7 +31,9 @@ public:\n \n \tvoid configure(const CameraSensorInfo &sensorInfo,\n \t\t const std::map<unsigned int, IPAStream> &streamConfig,\n-\t\t const std::map<unsigned int, const ControlInfoMap &> &entityControls) override;\n+\t\t const std::map<unsigned int, const ControlInfoMap &> &entityControls,\n+\t\t const IPAOperationData &ipaConfig,\n+\t\t IPAOperationData *result) override;\n \tvoid mapBuffers(const std::vector<IPABuffer> &buffers) override;\n \tvoid unmapBuffers(const std::vector<unsigned int> &ids) override;\n \tvoid processEvent(const IPAOperationData &event) override;\n@@ -129,9 +131,12 @@ void IPAProxyThread::stop()\n \n void IPAProxyThread::configure(const CameraSensorInfo &sensorInfo,\n \t\t\t const std::map<unsigned int, IPAStream> &streamConfig,\n-\t\t\t const std::map<unsigned int, const ControlInfoMap &> &entityControls)\n+\t\t\t const std::map<unsigned int, const ControlInfoMap &> &entityControls,\n+\t\t\t const IPAOperationData &ipaConfig,\n+\t\t\t IPAOperationData *result)\n {\n-\tipa_->configure(sensorInfo, streamConfig, entityControls);\n+\tipa_->configure(sensorInfo, streamConfig, entityControls, ipaConfig,\n+\t\t\tresult);\n }\n \n void IPAProxyThread::mapBuffers(const std::vector<IPABuffer> &buffers)\ndiff --git a/test/ipa/ipa_wrappers_test.cpp b/test/ipa/ipa_wrappers_test.cpp\nindex aa7a9dcc6050..23c799da0663 100644\n--- a/test/ipa/ipa_wrappers_test.cpp\n+++ b/test/ipa/ipa_wrappers_test.cpp\n@@ -69,7 +69,9 @@ public:\n \n \tvoid configure(const CameraSensorInfo &sensorInfo,\n \t\t const std::map<unsigned int, IPAStream> &streamConfig,\n-\t\t const std::map<unsigned int, const ControlInfoMap &> &entityControls) override\n+\t\t const std::map<unsigned int, const ControlInfoMap &> &entityControls,\n+\t\t const IPAOperationData &ipaConfig,\n+\t\t IPAOperationData *result) override\n \t{\n \t\t/* Verify sensorInfo. */\n \t\tif (sensorInfo.outputSize.width != 2560 ||\n@@ -317,7 +319,9 @@ protected:\n \t\t};\n \t\tstd::map<unsigned int, const ControlInfoMap &> controlInfo;\n \t\tcontrolInfo.emplace(42, subdev_->controls());\n-\t\tret = INVOKE(configure, sensorInfo, config, controlInfo);\n+\t\tIPAOperationData ipaConfig;\n+\t\tret = INVOKE(configure, sensorInfo, config, controlInfo,\n+\t\t\t ipaConfig, nullptr);\n \t\tif (ret == TestFail)\n \t\t\treturn TestFail;\n \n", "prefixes": [ "libcamera-devel", "v1", "3/9" ] }