Patch Detail
Show a patch.
GET /api/patches/11489/?format=api
{ "id": 11489, "url": "https://patchwork.libcamera.org/api/patches/11489/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11489/", "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": "<20210304081728.1058394-4-naush@raspberrypi.com>", "date": "2021-03-04T08:17:24", "name": "[libcamera-devel,v4,3/7] libcamera: delayed_controls: Remove unneeded write when starting up", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "e77c34c7f9a602c3a0a530349991ceb394363423", "submitter": { "id": 34, "url": "https://patchwork.libcamera.org/api/people/34/?format=api", "name": "Naushir Patuck", "email": "naush@raspberrypi.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/11489/mbox/", "series": [ { "id": 1757, "url": "https://patchwork.libcamera.org/api/series/1757/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1757", "date": "2021-03-04T08:17:21", "name": "DelayedControls updates and fixes", "version": 4, "mbox": "https://patchwork.libcamera.org/series/1757/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/11489/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11489/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 00A37BD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tThu, 4 Mar 2021 08:17:43 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 979DD68A92;\n\tThu, 4 Mar 2021 09:17:42 +0100 (CET)", "from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com\n\t[IPv6:2a00:1450:4864:20::32e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 3B4E0602EC\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 4 Mar 2021 09:17:39 +0100 (CET)", "by mail-wm1-x32e.google.com with SMTP id l22so7217524wme.1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 04 Mar 2021 00:17:39 -0800 (PST)", "from naush-laptop.patuck.local ([88.97.76.4])\n\tby smtp.gmail.com with ESMTPSA id\n\tb186sm6997926wmc.44.2021.03.04.00.17.37\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 04 Mar 2021 00:17:38 -0800 (PST)" ], "Authentication-Results": "lancelot.ideasonboard.com;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=raspberrypi.com header.i=@raspberrypi.com\n\theader.b=\"k/V98RtV\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=CW26mmwvmqIlsGYx03OeK2ZIP1RApVX0DdJdSra6nT4=;\n\tb=k/V98RtVfG2FbdtNxrUhzMl0pC2GmzQ0ouj2hpi0GL+Aw6UMwnx/Zif/SD3z2zX16Z\n\tR9Z/OsF9qgO7zZdr4P8hCDrwIrdSYY8ksWxNQ7gVIx9i/E0agxu8naeIjQPWeEaQLUxi\n\tlo+cdnLhO0M8JqfoPz6gP8F6VQa77/SP3sGNhQ7BbqhvF394hZ7228RD2Y30X7urIPmu\n\tlw6gUh/G8XZ6MdR80vuDszTCuXe30Gg3FpoSeL7UP6+BvrhtLGO0eIjHyRFzYmYVGnfG\n\tWQNZP6Bwiiyzge0tWrvx9M8nwov4/gF+tp6cYhWVaoiwoFTAatRGq5evn1Ur8nEvQqdd\n\tHvQg==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references:mime-version:content-transfer-encoding;\n\tbh=CW26mmwvmqIlsGYx03OeK2ZIP1RApVX0DdJdSra6nT4=;\n\tb=CCtmpUfsS6lELkhtWuW3N95C4QcXO3PsDwkXnTJcVOu80InAFp2DtX8drly1chGEwB\n\tc8PchAD3tfSJXZ5y8QeavNa9wpDei6egKXQlJUouJcO3rxB0f2JBd6wFy36a5UWV7j22\n\t8V3K1JbkzCnF8qiiP0UzMaZdAFzHp3sAceDuy7MkhPr/C98ZxYuF/yJcKZGXWHHZzeF9\n\tjH6c4J/zK8Y7tkLAEMIjQOazwgARk2dfsAAQaJvW2BpwlArnMi65j+pSqARhusGRjG3X\n\th+N+j45lTBewePYAjBI6/5jyvHWzegK/z2HIkUm5bCgtC22gaQUlPWtNyusqUu4Yh7ay\n\thMTQ==", "X-Gm-Message-State": "AOAM533pNhsDy8xhnl6t/DBBSs7NrzFvTCGYD6rLNO4wLD36nkMpoCte\n\tB0SYl918faEPqGwG6DZylmWX53A+ZjERMAfF", "X-Google-Smtp-Source": "ABdhPJwF2QuEycY4RrJYWO+lU0CmaaD8OTchlaHn87jyJ98fHs3Pjq3WWHcl3W6oXV/lzO+lCIqJXg==", "X-Received": "by 2002:a1c:9849:: with SMTP id a70mr2797713wme.48.1614845858776;\n\tThu, 04 Mar 2021 00:17:38 -0800 (PST)", "From": "Naushir Patuck <naush@raspberrypi.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 4 Mar 2021 08:17:24 +0000", "Message-Id": "<20210304081728.1058394-4-naush@raspberrypi.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20210304081728.1058394-1-naush@raspberrypi.com>", "References": "<20210304081728.1058394-1-naush@raspberrypi.com>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH v4 3/7] libcamera: delayed_controls:\n\tRemove unneeded write when starting up", "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=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "On DelayedControls::reset(), the values retrieved from the sensor device\nwere added to the queues with the updated flag set to true. This would\ncause the helper to write out the value to the device again on the first\nDelayedControls::applyControls() call. This is unnecessary, as the\ncontrols written are identical to what is stored in the device driver.\n\nFix this by explicitly setting the update flag to false in\nDelayedControls::reset() when adding the controls to the queue.\n\nAdditionally, use the Info() constructor when adding items to the queue\nfor consistency.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nFixes: 3d4b7b005911 (\"libcamera: delayed_controls: Add helper for controls that apply with a delay\")\nTested-by: David Plowman <david.plowman@raspberrypi.com>\n---\n include/libcamera/internal/delayed_controls.h | 4 ++--\n src/libcamera/delayed_controls.cpp | 9 ++++++---\n 2 files changed, 8 insertions(+), 5 deletions(-)", "diff": "diff --git a/include/libcamera/internal/delayed_controls.h b/include/libcamera/internal/delayed_controls.h\nindex 564d9f2e2440..2a6a912bde10 100644\n--- a/include/libcamera/internal/delayed_controls.h\n+++ b/include/libcamera/internal/delayed_controls.h\n@@ -43,8 +43,8 @@ private:\n \t\t{\n \t\t}\n \n-\t\tInfo(const ControlValue &v)\n-\t\t\t: ControlValue(v), updated(true)\n+\t\tInfo(const ControlValue &v, bool updated_ = true)\n+\t\t\t: ControlValue(v), updated(updated_)\n \t\t{\n \t\t}\n \ndiff --git a/src/libcamera/delayed_controls.cpp b/src/libcamera/delayed_controls.cpp\nindex 3ed1dfebd035..f6d761d1cc41 100644\n--- a/src/libcamera/delayed_controls.cpp\n+++ b/src/libcamera/delayed_controls.cpp\n@@ -111,7 +111,11 @@ void DelayedControls::reset()\n \tvalues_.clear();\n \tfor (const auto &ctrl : controls) {\n \t\tconst ControlId *id = device_->controls().idmap().at(ctrl.first);\n-\t\tvalues_[id][0] = Info(ctrl.second);\n+\t\t/*\n+\t\t * Do not mark this control value as updated, it does not need\n+\t\t * to be written to to device on startup.\n+\t\t */\n+\t\tvalues_[id][0] = Info(ctrl.second, false);\n \t}\n }\n \n@@ -150,8 +154,7 @@ bool DelayedControls::push(const ControlList &controls)\n \n \t\tInfo &info = values_[id][queueCount_];\n \n-\t\tinfo = control.second;\n-\t\tinfo.updated = true;\n+\t\tinfo = Info(control.second);\n \n \t\tLOG(DelayedControls, Debug)\n \t\t\t<< \"Queuing \" << id->name()\n", "prefixes": [ "libcamera-devel", "v4", "3/7" ] }