Patch Detail
Show a patch.
GET /api/patches/12398/?format=api
{ "id": 12398, "url": "https://patchwork.libcamera.org/api/patches/12398/?format=api", "web_url": "https://patchwork.libcamera.org/patch/12398/", "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": "<20210525085528.11477-1-laurent.pinchart@ideasonboard.com>", "date": "2021-05-25T08:55:28", "name": "[libcamera-devel] Revert \"libcamera: V4L2Device: Remove the controls order assumption in updateControls()\"", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "fa512305cde4a339a499d284bdfbe23741b8b49b", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/12398/mbox/", "series": [ { "id": 2060, "url": "https://patchwork.libcamera.org/api/series/2060/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=2060", "date": "2021-05-25T08:55:28", "name": "[libcamera-devel] Revert \"libcamera: V4L2Device: Remove the controls order assumption in updateControls()\"", "version": 1, "mbox": "https://patchwork.libcamera.org/series/2060/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/12398/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/12398/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 48D9BC3200\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 25 May 2021 08:55:49 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AA0DE68921;\n\tTue, 25 May 2021 10:55:43 +0200 (CEST)", "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 B5A95602AF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 25 May 2021 10:55:42 +0200 (CEST)", "from pendragon.lan (62-78-145-57.bb.dnainternet.fi [62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 1477F344;\n\tTue, 25 May 2021 10:55:42 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"FKAmDacV\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1621932942;\n\tbh=zpIX6NtTFmg9QrogEc3mhVOHcFskBZBriXMqbHCZV2k=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=FKAmDacVgZIFeFm7CANuj/ebBA0NYYyQo3fGHHJ+iMav9fJnmc35lviD1/tZibT+e\n\t4PxMBWAM4ET2VjAV1q84PJJBzTAF/H3JyUUqy0ey5+DLDxp5N2whtG2ZxEZJHqLKgT\n\tOXRqbtjZgokIlElE5tlpNT/JuXAHj5331RYF4jaI=", "From": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 25 May 2021 11:55:28 +0300", "Message-Id": "<20210525085528.11477-1-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.28.1", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH] Revert \"libcamera: V4L2Device: Remove the\n\tcontrols order assumption in updateControls()\"", "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": "This reverts commit 34bee5e84ecba01e0ded5cacbc46c277c5a0edba.\n\nThe commit introduced a breakage in the master branch, reported by\nlinux-surface users already. Let's revert it while discussing the\npropert fix.\n\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/v4l2_device.cpp | 26 +++++++++++++++++++-------\n 1 file changed, 19 insertions(+), 7 deletions(-)", "diff": "diff --git a/src/libcamera/v4l2_device.cpp b/src/libcamera/v4l2_device.cpp\nindex 7f7e5b8fdf09..caafbc2d16bb 100644\n--- a/src/libcamera/v4l2_device.cpp\n+++ b/src/libcamera/v4l2_device.cpp\n@@ -244,6 +244,12 @@ ControlList V4L2Device::getControls(const std::vector<uint32_t> &ids)\n \n \tControlList ctrls{ controls_ };\n \n+\t/*\n+\t * Start by filling the ControlList. This can't be combined with filling\n+\t * v4l2Ctrls, as updateControls() relies on both containers having the\n+\t * same order, and the control list is based on a map, which is not\n+\t * sorted by insertion order.\n+\t */\n \tfor (uint32_t id : ids) {\n \t\tconst auto iter = controls_.find(id);\n \t\tif (iter == controls_.end()) {\n@@ -617,13 +623,19 @@ void V4L2Device::updateControlInfo()\n void V4L2Device::updateControls(ControlList *ctrls,\n \t\t\t\tSpan<const v4l2_ext_control> v4l2Ctrls)\n {\n-\tfor (const v4l2_ext_control &v4l2Ctrl : v4l2Ctrls) {\n-\t\tconst unsigned int id = v4l2Ctrl.id;\n+\tunsigned int i = 0;\n+\tfor (auto &ctrl : *ctrls) {\n+\t\tif (i == v4l2Ctrls.size())\n+\t\t\tbreak;\n \n-\t\tControlValue value = ctrls->get(id);\n-\t\tswitch (value.type()) {\n+\t\tconst struct v4l2_ext_control *v4l2Ctrl = &v4l2Ctrls[i];\n+\t\tunsigned int id = ctrl.first;\n+\t\tControlValue &value = ctrl.second;\n+\n+\t\tconst auto iter = controls_.find(id);\n+\t\tswitch (iter->first->type()) {\n \t\tcase ControlTypeInteger64:\n-\t\t\tvalue.set<int64_t>(v4l2Ctrl.value64);\n+\t\t\tvalue.set<int64_t>(v4l2Ctrl->value64);\n \t\t\tbreak;\n \n \t\tcase ControlTypeByte:\n@@ -638,11 +650,11 @@ void V4L2Device::updateControls(ControlList *ctrls,\n \t\t\t * \\todo To be changed when support for string controls\n \t\t\t * will be added.\n \t\t\t */\n-\t\t\tvalue.set<int32_t>(v4l2Ctrl.value);\n+\t\t\tvalue.set<int32_t>(v4l2Ctrl->value);\n \t\t\tbreak;\n \t\t}\n \n-\t\tctrls->set(id, value);\n+\t\ti++;\n \t}\n }\n \n", "prefixes": [ "libcamera-devel" ] }