Patch Detail
Show a patch.
GET /api/patches/11529/?format=api
{ "id": 11529, "url": "https://patchwork.libcamera.org/api/patches/11529/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11529/", "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": "<20210309063829.8710-3-dafna.hirschfeld@collabora.com>", "date": "2021-03-09T06:38:28", "name": "[libcamera-devel,v3,2/3] src: rkisp1: return error from ipa's configure method if it fails", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "c5d97c74208ad20b267acc0eac6dd3709650c1db", "submitter": { "id": 46, "url": "https://patchwork.libcamera.org/api/people/46/?format=api", "name": "Dafna Hirschfeld", "email": "dafna.hirschfeld@collabora.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/11529/mbox/", "series": [ { "id": 1775, "url": "https://patchwork.libcamera.org/api/series/1775/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1775", "date": "2021-03-09T06:38:27", "name": "rkisp1: add an initial support to different hw revision", "version": 3, "mbox": "https://patchwork.libcamera.org/series/1775/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/11529/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11529/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 7A9F4BD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 9 Mar 2021 06:38:42 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 39F6D68AAA;\n\tTue, 9 Mar 2021 07:38:42 +0100 (CET)", "from bhuna.collabora.co.uk (bhuna.collabora.co.uk\n\t[IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 73B5A68AA5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 9 Mar 2021 07:38:39 +0100 (CET)", "from [127.0.0.1] (localhost [127.0.0.1])\n\t(Authenticated sender: dafna) with ESMTPSA id 165061F45217" ], "From": "Dafna Hirschfeld <dafna.hirschfeld@collabora.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 9 Mar 2021 07:38:28 +0100", "Message-Id": "<20210309063829.8710-3-dafna.hirschfeld@collabora.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20210309063829.8710-1-dafna.hirschfeld@collabora.com>", "References": "<20210309063829.8710-1-dafna.hirschfeld@collabora.com>", "Subject": "[libcamera-devel] [PATCH v3 2/3] src: rkisp1: return error from\n\tipa's configure method if it fails", "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>", "Cc": "kernel@collabora.com", "MIME-Version": "1.0", "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": "The IPA of rkisp1 relies on some of the camera's controls.\nTherefore it can't work if those controls are not given.\nReturn -EINVAL from 'configure' in that case.\nAlso return error from the pipeline's 'configure' method\nif the IPA configure fails.\n\nSigned-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n include/libcamera/ipa/rkisp1.mojom | 2 +-\n src/ipa/rkisp1/rkisp1.cpp | 11 ++++++-----\n src/libcamera/pipeline/rkisp1/rkisp1.cpp | 7 +++++--\n 3 files changed, 12 insertions(+), 8 deletions(-)", "diff": "diff --git a/include/libcamera/ipa/rkisp1.mojom b/include/libcamera/ipa/rkisp1.mojom\nindex 9270f9c7..95fa0d93 100644\n--- a/include/libcamera/ipa/rkisp1.mojom\n+++ b/include/libcamera/ipa/rkisp1.mojom\n@@ -31,7 +31,7 @@ interface IPARkISP1Interface {\n \n \tconfigure(CameraSensorInfo sensorInfo,\n \t\t map<uint32, IPAStream> streamConfig,\n-\t\t map<uint32, ControlInfoMap> entityControls) => ();\n+\t\t map<uint32, ControlInfoMap> entityControls) => (int32 ret);\n \n \tmapBuffers(array<IPABuffer> buffers);\n \tunmapBuffers(array<uint32> ids);\ndiff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp\nindex f11aeb40..0b0f31e4 100644\n--- a/src/ipa/rkisp1/rkisp1.cpp\n+++ b/src/ipa/rkisp1/rkisp1.cpp\n@@ -38,7 +38,7 @@ public:\n \tint start() override { return 0; }\n \tvoid stop() override {}\n \n-\tvoid configure(const CameraSensorInfo &info,\n+\tint configure(const CameraSensorInfo &info,\n \t\t const std::map<uint32_t, IPAStream> &streamConfig,\n \t\t const std::map<uint32_t, ControlInfoMap> &entityControls) override;\n \tvoid mapBuffers(const std::vector<IPABuffer> &buffers) override;\n@@ -75,25 +75,25 @@ private:\n * assemble one. Make sure the reported sensor information are relevant\n * before accessing them.\n */\n-void IPARkISP1::configure([[maybe_unused]] const CameraSensorInfo &info,\n+int IPARkISP1::configure([[maybe_unused]] const CameraSensorInfo &info,\n \t\t\t [[maybe_unused]] const std::map<uint32_t, IPAStream> &streamConfig,\n \t\t\t const std::map<uint32_t, ControlInfoMap> &entityControls)\n {\n \tif (entityControls.empty())\n-\t\treturn;\n+\t\treturn -EINVAL;\n \n \tctrls_ = entityControls.at(0);\n \n \tconst auto itExp = ctrls_.find(V4L2_CID_EXPOSURE);\n \tif (itExp == ctrls_.end()) {\n \t\tLOG(IPARkISP1, Error) << \"Can't find exposure control\";\n-\t\treturn;\n+\t\treturn -EINVAL;\n \t}\n \n \tconst auto itGain = ctrls_.find(V4L2_CID_ANALOGUE_GAIN);\n \tif (itGain == ctrls_.end()) {\n \t\tLOG(IPARkISP1, Error) << \"Can't find gain control\";\n-\t\treturn;\n+\t\treturn -EINVAL;\n \t}\n \n \tautoExposure_ = true;\n@@ -111,6 +111,7 @@ void IPARkISP1::configure([[maybe_unused]] const CameraSensorInfo &info,\n \t\t<< \" Gain: \" << minGain_ << \"-\" << maxGain_;\n \n \tsetControls(0);\n+\treturn 0;\n }\n \n void IPARkISP1::mapBuffers(const std::vector<IPABuffer> &buffers)\ndiff --git a/src/libcamera/pipeline/rkisp1/rkisp1.cpp b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\nindex 538c0139..34814f62 100644\n--- a/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n+++ b/src/libcamera/pipeline/rkisp1/rkisp1.cpp\n@@ -653,8 +653,11 @@ int PipelineHandlerRkISP1::configure(Camera *camera, CameraConfiguration *c)\n \tstd::map<uint32_t, ControlInfoMap> entityControls;\n \tentityControls.emplace(0, data->sensor_->controls());\n \n-\tdata->ipa_->configure(sensorInfo, streamConfig, entityControls);\n-\n+\tret = data->ipa_->configure(sensorInfo, streamConfig, entityControls);\n+\tif (ret) {\n+\t\tLOG(RkISP1, Error) << \"failed configuring IPA (\" << ret << \")\";\n+\t\treturn ret;\n+\t}\n \treturn 0;\n }\n \n", "prefixes": [ "libcamera-devel", "v3", "2/3" ] }