Patch Detail
Show a patch.
GET /api/patches/10666/?format=api
{ "id": 10666, "url": "https://patchwork.libcamera.org/api/patches/10666/?format=api", "web_url": "https://patchwork.libcamera.org/patch/10666/", "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": "<20201215004811.602429-7-niklas.soderlund@ragnatech.se>", "date": "2020-12-15T00:48:09", "name": "[libcamera-devel,v4,6/8] libcamera: pipeline: rkisp1: Use delayed controls", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "18e77298692cc57f84b5ae52193b58136276ad5f", "submitter": { "id": 5, "url": "https://patchwork.libcamera.org/api/people/5/?format=api", "name": "Niklas Söderlund", "email": "niklas.soderlund@ragnatech.se" }, "delegate": { "id": 16, "url": "https://patchwork.libcamera.org/api/users/16/?format=api", "username": "neg", "first_name": "Niklas", "last_name": "Söderlund", "email": "niklas.soderlund@ragnatech.se" }, "mbox": "https://patchwork.libcamera.org/patch/10666/mbox/", "series": [ { "id": 1533, "url": "https://patchwork.libcamera.org/api/series/1533/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1533", "date": "2020-12-15T00:48:03", "name": "libcamera: Add helper for controls that take effect with a delay", "version": 4, "mbox": "https://patchwork.libcamera.org/series/1533/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/10666/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/10666/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 C565FC0F1B\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 15 Dec 2020 00:48:29 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 6C09161D25;\n\tTue, 15 Dec 2020 01:48:29 +0100 (CET)", "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 25F2E61592\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 15 Dec 2020 01:48:28 +0100 (CET)", "from bismarck.berto.se (p4fca2458.dip0.t-ipconnect.de\n\t[79.202.36.88])\n\tby bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA\n\tid 3e2af113-3e6f-11eb-a076-005056917f90;\n\tTue, 15 Dec 2020 01:48:27 +0100 (CET)" ], "X-Halon-ID": "3e2af113-3e6f-11eb-a076-005056917f90", "Authorized-sender": "niklas.soderlund@fsdn.se", "From": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>", "To": "libcamera-devel@lists.libcamera.org,\n\tnaush@raspberrypi.com", "Date": "Tue, 15 Dec 2020 01:48:09 +0100", "Message-Id": "<20201215004811.602429-7-niklas.soderlund@ragnatech.se>", "X-Mailer": "git-send-email 2.29.2", "In-Reply-To": "<20201215004811.602429-1-niklas.soderlund@ragnatech.se>", "References": "<20201215004811.602429-1-niklas.soderlund@ragnatech.se>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH v4 6/8] libcamera: pipeline: rkisp1: Use\n\tdelayed controls", "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=\"utf-8\"", "Content-Transfer-Encoding": "base64", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "Instead of setting controls using the RkISP1 local Timeline helper use\nthe DelayedControls. The result is the same, the controls are applied\nwith a delay.\n\nThe values of the delays are however different between the two methods.\nThe values used in the Timeline solution were chosen after some\nexperimentation and the values used in DelayedControls are taken from a\ngeneric sensor. None of the two are a perfect match as the delays can be\ndifferent for different sensors used with the pipeline.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n* Changes since v3\n- Rewrite to not use CameraSensor.\n---\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 43 +++++++++++++-----------\n 1 file changed, 23 insertions(+), 20 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 4d98c9027f42c759..513a60b04e5f2e21 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -23,6 +23,7 @@\n #include <libcamera/stream.h>\n \n #include \"libcamera/internal/camera_sensor.h\"\n+#include \"libcamera/internal/delayed_controls.h\"\n #include \"libcamera/internal/device_enumerator.h\"\n #include \"libcamera/internal/ipa_manager.h\"\n #include \"libcamera/internal/log.h\"\n@@ -136,6 +137,7 @@ public:\n \tStream mainPathStream_;\n \tStream selfPathStream_;\n \tCameraSensor *sensor_;\n+\tstd::unique_ptr<DelayedControls> delayedCtrls_;\n \tunsigned int frame_;\n \tstd::vector<IPABuffer> ipaBuffers_;\n \tRkISP1Frames frameInfo_;\n@@ -345,23 +347,6 @@ RkISP1FrameInfo *RkISP1Frames::find(Request *request)\n \treturn nullptr;\n }\n \n-class RkISP1ActionSetSensor : public FrameAction\n-{\n-public:\n-\tRkISP1ActionSetSensor(unsigned int frame, CameraSensor *sensor, const ControlList &controls)\n-\t\t: FrameAction(frame, SetSensor), sensor_(sensor), controls_(controls) {}\n-\n-protected:\n-\tvoid run() override\n-\t{\n-\t\tsensor_->setControls(&controls_);\n-\t}\n-\n-private:\n-\tCameraSensor *sensor_;\n-\tControlList controls_;\n-};\n-\n class RkISP1ActionQueueBuffers : public FrameAction\n {\n public:\n@@ -429,9 +414,7 @@ void RkISP1CameraData::queueFrameAction(unsigned int frame,\n \tswitch (action.operation) {\n \tcase RKISP1_IPA_ACTION_V4L2_SET: {\n \t\tconst ControlList &controls = action.controls[0];\n-\t\ttimeline_.scheduleAction(std::make_unique<RkISP1ActionSetSensor>(frame,\n-\t\t\t\t\t\t\t\t\t\t sensor_,\n-\t\t\t\t\t\t\t\t\t\t controls));\n+\t\tdelayedCtrls_->push(controls);\n \t\tbreak;\n \t}\n \tcase RKISP1_IPA_ACTION_PARAM_FILLED: {\n@@ -898,6 +881,8 @@ int PipelineHandlerRkISP1::start(Camera *camera, [[maybe_unused]] ControlList *c\n \t\t};\n \t}\n \n+\tisp_->setFrameStartEnabled(true);\n+\n \tactiveCamera_ = camera;\n \n \t/* Inform IPA of stream configuration and sensor controls. */\n@@ -925,6 +910,8 @@ void PipelineHandlerRkISP1::stop(Camera *camera)\n \tRkISP1CameraData *data = cameraData(camera);\n \tint ret;\n \n+\tisp_->setFrameStartEnabled(false);\n+\n \tselfPath_.stop();\n \tmainPath_.stop();\n \n@@ -1043,6 +1030,22 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)\n \t/* Initialize the camera properties. */\n \tdata->properties_ = data->sensor_->properties();\n \n+\t/*\n+\t * \\todo Read dealy values from the sensor itself or from a\n+\t * a sensor database. For now use generic values taken from\n+\t * the Raspberry Pi and listed as generic values.\n+\t */\n+\tstd::unordered_map<uint32_t, unsigned int> delays = {\n+\t\t{ V4L2_CID_ANALOGUE_GAIN, 1 },\n+\t\t{ V4L2_CID_EXPOSURE, 2 },\n+\t};\n+\n+\tdata->delayedCtrls_ =\n+\t\tstd::make_unique<DelayedControls>(data->sensor_->device(),\n+\t\t\t\t\t\t delays);\n+\tisp_->frameStart.connect(data->delayedCtrls_.get(),\n+\t\t\t\t &DelayedControls::applyControls);\n+\n \tret = data->loadIPA();\n \tif (ret)\n \t\treturn ret;\n", "prefixes": [ "libcamera-devel", "v4", "6/8" ] }