Patch Detail
Show a patch.
GET /api/patches/21171/?format=api
{ "id": 21171, "url": "https://patchwork.libcamera.org/api/patches/21171/?format=api", "web_url": "https://patchwork.libcamera.org/patch/21171/", "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": "<20240906063444.32772-4-umang.jain@ideasonboard.com>", "date": "2024-09-06T06:34:43", "name": "[v7,3/4] libcamera: rkisp1: Prepare for additional camera controls", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "a046910946b52c302474aed7ebb84b3a7e1935f6", "submitter": { "id": 86, "url": "https://patchwork.libcamera.org/api/people/86/?format=api", "name": "Umang Jain", "email": "umang.jain@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/21171/mbox/", "series": [ { "id": 4565, "url": "https://patchwork.libcamera.org/api/series/4565/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4565", "date": "2024-09-06T06:34:40", "name": "libcamera: rkisp1: Plumb the ConverterDW100 converter", "version": 7, "mbox": "https://patchwork.libcamera.org/series/4565/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/21171/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/21171/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 65271C324C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 6 Sep 2024 06:35:05 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 9E1A1634EF;\n\tFri, 6 Sep 2024 08:35:04 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 50D74634CB\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 6 Sep 2024 08:34:58 +0200 (CEST)", "from localhost.localdomain (unknown\n\t[IPv6:2405:201:2015:f873:55f8:639e:8e9f:12ec])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E6FBFFEF;\n\tFri, 6 Sep 2024 08:33:43 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"bAXXPV3P\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1725604424;\n\tbh=7qiLjaJugkTWUJf5ZHtIeAgqyrcv2OHrhJSBv4jdH7c=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=bAXXPV3PEXlTvD2gWgldcefHxdQuwTjC5Ow8hgzm7lyIQG1h/xRbdos9i7OZ5YIIL\n\tz1Hal6G09yseaGmh3vudqJMvBHFyOzRNuV2QylSsGir7gA8CtvrkGWMSsIe7hFVRFL\n\t8QVgXbvn9yE8b6UvJWZOiLZEzOto6tkhyd02SM2E=", "From": "Umang Jain <umang.jain@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Umang Jain <umang.jain@ideasonboard.com>,\n\tPaul Elder <paul.elder@ideasonboard.com>", "Subject": "[PATCH v7 3/4] libcamera: rkisp1: Prepare for additional camera\n\tcontrols", "Date": "Fri, 6 Sep 2024 12:04:43 +0530", "Message-ID": "<20240906063444.32772-4-umang.jain@ideasonboard.com>", "X-Mailer": "git-send-email 2.45.0", "In-Reply-To": "<20240906063444.32772-1-umang.jain@ideasonboard.com>", "References": "<20240906063444.32772-1-umang.jain@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Currently the rkisp1 pipeline handler only registers controls that are\nrelated to the IPA. This patch prepares the rkisp1 pipeline-handler to\nregister camera controls which are not related to the IPA.\n\nHence, introduce an additional ControlInfoMap for IPA controls. These\ncontrols will be merged together with the controls in the pipeline\nhandler (introduced subsequently) as part of updateControls() and\ntogether will be registered during the registration of the camera.\nThis is similar to what IPU3 pipeline handler handles its controls.\n\nSigned-off-by: Umang Jain <umang.jain@ideasonboard.com>\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n---\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 42 ++++++++++++++++++++++--\n 1 file changed, 39 insertions(+), 3 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex c02c7cf3..651258e3 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -108,6 +108,8 @@ public:\n \n \tstd::unique_ptr<ipa::rkisp1::IPAProxyRkISP1> ipa_;\n \n+\tControlInfoMap ipaControls_;\n+\n private:\n \tvoid paramFilled(unsigned int frame, unsigned int bytesused);\n \tvoid setSensorControls(unsigned int frame,\n@@ -183,6 +185,8 @@ private:\n \tint allocateBuffers(Camera *camera);\n \tint freeBuffers(Camera *camera);\n \n+\tint updateControls(RkISP1CameraData *data);\n+\n \tMediaDevice *media_;\n \tstd::unique_ptr<V4L2Subdevice> isp_;\n \tstd::unique_ptr<V4L2VideoDevice> param_;\n@@ -364,7 +368,7 @@ int RkISP1CameraData::loadIPA(unsigned int hwRevision)\n \t}\n \n \tret = ipa_->init({ ipaTuningFile, sensor_->model() }, hwRevision,\n-\t\t\t sensorInfo, sensor_->controls(), &controlInfo_);\n+\t\t\t sensorInfo, sensor_->controls(), &ipaControls_);\n \tif (ret < 0) {\n \t\tLOG(RkISP1, Error) << \"IPA initialization failure\";\n \t\treturn ret;\n@@ -814,12 +818,13 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n \tipaConfig.sensorControls = data->sensor_->controls();\n \tipaConfig.paramFormat = paramFormat.fourcc;\n \n-\tret = data->ipa_->configure(ipaConfig, streamConfig, &data->controlInfo_);\n+\tret = data->ipa_->configure(ipaConfig, streamConfig, &data->ipaControls_);\n \tif (ret) {\n \t\tLOG(RkISP1, Error) << \"failed configuring IPA (\" << ret << \")\";\n \t\treturn ret;\n \t}\n-\treturn 0;\n+\n+\treturn updateControls(data);\n }\n \n int PipelineHandlerRkISP1::exportFrameBuffers([[maybe_unused]] Camera *camera, Stream *stream,\n@@ -1086,6 +1091,35 @@ int PipelineHandlerRkISP1::initLinks(Camera *camera,\n \treturn 0;\n }\n \n+/**\n+ * \\brief Update the camera controls\n+ * \\param[in] data The camera data\n+ *\n+ * Compute the camera controls by calculating controls which the pipeline\n+ * is reponsible for and merge them with the controls computed by the IPA.\n+ *\n+ * This function needs data->ipaControls_ to be refreshed when a new\n+ * configuration is applied to the camera by the IPA configure() function.\n+ *\n+ * Always call this function after IPA configure() to make sure to have a\n+ * properly refreshed IPA controls list.\n+ *\n+ * \\return 0 on success or a negative error code otherwise\n+ */\n+int PipelineHandlerRkISP1::updateControls(RkISP1CameraData *data)\n+{\n+\tControlInfoMap::Map controls;\n+\n+\t/* Add the IPA registered controls to list of camera controls. */\n+\tfor (const auto &ipaControl : data->ipaControls_)\n+\t\tcontrols[ipaControl.first] = ipaControl.second;\n+\n+\tdata->controlInfo_ = ControlInfoMap(std::move(controls),\n+\t\t\t\t\t controls::controls);\n+\n+\treturn 0;\n+}\n+\n int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)\n {\n \tint ret;\n@@ -1122,6 +1156,8 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)\n \tif (ret)\n \t\treturn ret;\n \n+\tupdateControls(data.get());\n+\n \tstd::set<Stream *> streams{\n \t\t&data->mainPathStream_,\n \t\t&data->selfPathStream_,\n", "prefixes": [ "v7", "3/4" ] }