Patch Detail
Show a patch.
GET /api/patches/22445/?format=api
{ "id": 22445, "url": "https://patchwork.libcamera.org/api/patches/22445/?format=api", "web_url": "https://patchwork.libcamera.org/patch/22445/", "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": "<20241220162724.756494-6-stefan.klug@ideasonboard.com>", "date": "2024-12-20T16:26:51", "name": "[RFC,5/7] pipeline: rkisp1: Apply initial controls", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "37aba49799b5fd588527fe3a220b6137477f226e", "submitter": { "id": 184, "url": "https://patchwork.libcamera.org/api/people/184/?format=api", "name": "Stefan Klug", "email": "stefan.klug@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/22445/mbox/", "series": [ { "id": 4925, "url": "https://patchwork.libcamera.org/api/series/4925/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=4925", "date": "2024-12-20T16:26:46", "name": "Improve regulation on rkisp1", "version": 1, "mbox": "https://patchwork.libcamera.org/series/4925/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/22445/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/22445/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 5839EC327D\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 20 Dec 2024 16:27:44 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0E708684BD;\n\tFri, 20 Dec 2024 17:27:44 +0100 (CET)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 2AAAC684B0\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 20 Dec 2024 17:27:41 +0100 (CET)", "from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:4eeb:7fa7:1fd0:c13d])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id A87541063;\n\tFri, 20 Dec 2024 17:27:01 +0100 (CET)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"AyZkZAXu\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1734712021;\n\tbh=6sbduZVT9S/OYs2edf3mGvXi1tBwSRHSZbb0hmQS86Y=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=AyZkZAXuazR3ihFyIQECyGO3wWJuxIk8es8Lp1fXMHjdX23DMsNYIAmFeegio0RCO\n\tJMRPK3m9Rwvf1A4+2Z1orlDZyqhJz0pc4qloA1QaK2HnUMMvTmGS5jxlRsCOjP5U9z\n\tY/x7gMCORSJmPhBTfWSTwK9YRRJWdPkC3cds0Bu4=", "From": "Stefan Klug <stefan.klug@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Stefan Klug <stefan.klug@ideasonboard.com>", "Subject": "[RFC PATCH 5/7] pipeline: rkisp1: Apply initial controls", "Date": "Fri, 20 Dec 2024 17:26:51 +0100", "Message-ID": "<20241220162724.756494-6-stefan.klug@ideasonboard.com>", "X-Mailer": "git-send-email 2.43.0", "In-Reply-To": "<20241220162724.756494-1-stefan.klug@ideasonboard.com>", "References": "<20241220162724.756494-1-stefan.klug@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": "Controls passed to Camera::start() are not handled at the moment.\nImplement that by issuing a dummy queueRequest() to initialize the frame\ncontext and then returning the controls synchronously to the caller. In\nthe pipeline the controls get passed to the sensor before the call to\nstremOn() to ensure the controls are applied right away. Passing the\ncontrols to the pipeline using the setSensorControls signal is not\nappropriate because it is asynchronous and would reach the sensor too\nlate (initial controls need to be applied before the sensor starts and\nbefore delayed controls initializes it's start condition.)\n\nSigned-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n---\n include/libcamera/ipa/rkisp1.mojom | 7 ++++++-\n src/ipa/rkisp1/rkisp1.cpp | 15 ++++++++++-----\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 11 +++++++++--\n 3 files changed, 25 insertions(+), 8 deletions(-)", "diff": "diff --git a/include/libcamera/ipa/rkisp1.mojom b/include/libcamera/ipa/rkisp1.mojom\nindex 043ad27ea199..86eae55cd530 100644\n--- a/include/libcamera/ipa/rkisp1.mojom\n+++ b/include/libcamera/ipa/rkisp1.mojom\n@@ -14,13 +14,18 @@ struct IPAConfigInfo {\n \tuint32 paramFormat;\n };\n \n+struct StartResult {\n+\tlibcamera.ControlList controls;\n+\tint32 code;\n+};\n+\n interface IPARkISP1Interface {\n \tinit(libcamera.IPASettings settings,\n \t uint32 hwRevision,\n \t libcamera.IPACameraSensorInfo sensorInfo,\n \t libcamera.ControlInfoMap sensorControls)\n \t\t=> (int32 ret, libcamera.ControlInfoMap ipaControls);\n-\tstart() => (int32 ret);\n+\tstart(libcamera.ControlList controls) => (StartResult result);\n \tstop();\n \n \tconfigure(IPAConfigInfo configInfo,\ndiff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\nindex 45a539a61fb1..799fe0846635 100644\n--- a/src/ipa/rkisp1/rkisp1.cpp\n+++ b/src/ipa/rkisp1/rkisp1.cpp\n@@ -55,7 +55,7 @@ public:\n \t\t const IPACameraSensorInfo &sensorInfo,\n \t\t const ControlInfoMap &sensorControls,\n \t\t ControlInfoMap *ipaControls) override;\n-\tint start() override;\n+\tvoid start(const ControlList &controls, StartResult *result) override;\n \tvoid stop() override;\n \n \tint configure(const IPAConfigInfo &ipaConfig,\n@@ -209,12 +209,17 @@ int IPARkISP1::init(const IPASettings &settings, unsigned int hwRevision,\n \treturn 0;\n }\n \n-int IPARkISP1::start()\n+void IPARkISP1::start(const ControlList &controls, StartResult *result)\n {\n-\tControlList ctrls = getSensorControls(0);\n-\tsetSensorControls.emit(0, ctrls);\n+\t/*\n+\t * \\todo: This feels a bit counter intuitive, as the queueRequest() for frame\n+\t * 0 will be called again when the actual request for frame 0 get's\n+\t * queued.\n+\t */\n+\tqueueRequest(0, controls);\n \n-\treturn 0;\n+\tresult->controls = getSensorControls(0);\n+\tresult->code = 0;\n }\n \n void IPARkISP1::stop()\ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 71a07c6027b9..ee6ed1b9c84a 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -1086,13 +1086,20 @@ int PipelineHandlerRkISP1::start(Camera *camera, [[maybe_unused]] const ControlL\n \t\treturn ret;\n \tactions += [&]() { freeBuffers(camera); };\n \n-\tret = data->ipa_->start();\n-\tif (ret) {\n+\tControlList ctrls;\n+\tif (!!controls)\n+\t\tctrls = *controls;\n+\n+\tipa::rkisp1::StartResult res;\n+\tdata->ipa_->start(ctrls, &res);\n+\tif (res.code) {\n \t\tLOG(RkISP1, Error)\n \t\t\t<< \"Failed to start IPA \" << camera->id();\n \t\treturn ret;\n \t}\n \tactions += [&]() { data->ipa_->stop(); };\n+\tdata->sensor_->setControls(&res.controls);\n+\tdata->delayedCtrls_->reset();\n \n \tdata->frame_ = 0;\n \n", "prefixes": [ "RFC", "5/7" ] }