Patch Detail
Show a patch.
GET /api/patches/10280/?format=api
{ "id": 10280, "url": "https://patchwork.libcamera.org/api/patches/10280/?format=api", "web_url": "https://patchwork.libcamera.org/patch/10280/", "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": "<20201028010051.3830668-8-niklas.soderlund@ragnatech.se>", "date": "2020-10-28T01:00:49", "name": "[libcamera-devel,7/9] libcamera: pipeline: rkisp1: Use CameraSensor and delayed controls", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "4fd8f9ffcdf5d71feb9b71acc571a16c3f6dad7b", "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/10280/mbox/", "series": [ { "id": 1423, "url": "https://patchwork.libcamera.org/api/series/1423/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1423", "date": "2020-10-28T01:00:42", "name": "libcamera: Add helper for controls that take effect with a delay", "version": 1, "mbox": "https://patchwork.libcamera.org/series/1423/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/10280/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/10280/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 7DE19C3B5C\n\tfor <parsemail@patchwork.libcamera.org>;\n\tWed, 28 Oct 2020 01:01:20 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3E9AD6226D;\n\tWed, 28 Oct 2020 02:01:20 +0100 (CET)", "from bin-mail-out-05.binero.net (bin-mail-out-05.binero.net\n\t[195.74.38.228])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3BAB96225C\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 28 Oct 2020 02:01:17 +0100 (CET)", "from bismarck.berto.se (p4fca2458.dip0.t-ipconnect.de\n\t[79.202.36.88])\n\tby bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA\n\tid 14add907-18b9-11eb-954c-0050569116f7;\n\tWed, 28 Oct 2020 02:01:16 +0100 (CET)" ], "X-Halon-ID": "14add907-18b9-11eb-954c-0050569116f7", "Authorized-sender": "niklas.soderlund@fsdn.se", "From": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>", "To": "libcamera-devel@lists.libcamera.org, david.plowman@raspberrypi.com,\n\tnaush@raspberrypi.com", "Date": "Wed, 28 Oct 2020 02:00:49 +0100", "Message-Id": "<20201028010051.3830668-8-niklas.soderlund@ragnatech.se>", "X-Mailer": "git-send-email 2.29.1", "In-Reply-To": "<20201028010051.3830668-1-niklas.soderlund@ragnatech.se>", "References": "<20201028010051.3830668-1-niklas.soderlund@ragnatech.se>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH 7/9] libcamera: pipeline: rkisp1: Use\n\tCameraSensor and delayed 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 interface provided by the CameraSensor. The result\nare the same, the controls are applied with a delay.\n\nThe values of the delays are however different between the two methods.\nThe values used in the Timeline solution was 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\nHowever using the interface provided by CameraSensor we prepare for the\nfuture where sensor specific delays will provided by the CameraSensor\nand used without any change in the pipeline.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 35 +++++++++---------------\n 1 file changed, 13 insertions(+), 22 deletions(-)", "diff": "diff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex c74a2e9bd5482057..d0a8be06656535a3 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -121,8 +121,9 @@ class RkISP1CameraData : public CameraData\n public:\n \tRkISP1CameraData(PipelineHandler *pipe, RkISP1MainPath *mainPath,\n \t\t\t RkISP1SelfPath *selfPath)\n-\t\t: CameraData(pipe), sensor_(nullptr), frame_(0),\n-\t\t frameInfo_(pipe), mainPath_(mainPath), selfPath_(selfPath)\n+\t\t: CameraData(pipe), sensor_(nullptr), delayedCtrls_(nullptr),\n+\t\t frame_(0), frameInfo_(pipe), mainPath_(mainPath),\n+\t\t selfPath_(selfPath)\n \t{\n \t}\n \n@@ -136,6 +137,7 @@ public:\n \tStream mainPathStream_;\n \tStream selfPathStream_;\n \tCameraSensor *sensor_;\n+\tDelayedControls *delayedCtrls_;\n \tunsigned int frame_;\n \tstd::vector<IPABuffer> ipaBuffers_;\n \tRkISP1Frames frameInfo_;\n@@ -346,23 +348,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@@ -430,9 +415,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@@ -896,6 +879,8 @@ int PipelineHandlerRkISP1::start(Camera *camera)\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@@ -923,6 +908,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@@ -1041,6 +1028,10 @@ int PipelineHandlerRkISP1::createCamera(MediaEntity *sensor)\n \t/* Initialize the camera properties. */\n \tdata->properties_ = data->sensor_->properties();\n \n+\tdata->delayedCtrls_ = data->sensor_->delayedContols();\n+\tisp_->frameStart.connect(data->delayedCtrls_,\n+\t\t\t\t &DelayedControls::frameStart);\n+\n \tret = data->loadIPA();\n \tif (ret)\n \t\treturn ret;\n", "prefixes": [ "libcamera-devel", "7/9" ] }