Patch Detail
Show a patch.
GET /api/patches/11415/?format=api
{ "id": 11415, "url": "https://patchwork.libcamera.org/api/patches/11415/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11415/", "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": "<20210301133159.4179129-4-naush@raspberrypi.com>", "date": "2021-03-01T13:31:57", "name": "[libcamera-devel,v3,3/5] libcamera: delayed_controls: Remove unneeded write when starting up", "commit_ref": null, "pull_url": null, "state": "superseded", "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/11415/mbox/", "series": [ { "id": 1734, "url": "https://patchwork.libcamera.org/api/series/1734/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=1734", "date": "2021-03-01T13:31:54", "name": "DelayedControls updates and fixes", "version": 3, "mbox": "https://patchwork.libcamera.org/series/1734/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/11415/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11415/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 A9E1EBD1F1\n\tfor <parsemail@patchwork.libcamera.org>;\n\tMon, 1 Mar 2021 13:32:10 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 618EB68A95;\n\tMon, 1 Mar 2021 14:32:10 +0100 (CET)", "from mail-wr1-x431.google.com (mail-wr1-x431.google.com\n\t[IPv6:2a00:1450:4864:20::431])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 4833668A92\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 1 Mar 2021 14:32:08 +0100 (CET)", "by mail-wr1-x431.google.com with SMTP id w11so16149468wrr.10\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 01 Mar 2021 05:32:08 -0800 (PST)", "from naush-laptop.patuck.local ([88.97.76.4])\n\tby smtp.gmail.com with ESMTPSA id\n\ta75sm11263630wme.10.2021.03.01.05.32.06\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tMon, 01 Mar 2021 05:32:06 -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=\"IPK14sub\"; 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=IPK14subrRRqg76NFUz92YkOuNE9Oxohvdu7zA1lucQhroD6eX7WI8J1Fi7HP1frLV\n\tQXg58K4yjZvzNRnKwxdTOGTTf8D2qoEN930C0ZMonG/8+mDVdmuZPptd9IFaffbNEBdk\n\tNej0ZbV6kOnqLYkcYXLTezkGpTILTeecBsv2vZ5b8cHkik5v7hriqf6F+YEowj9NtqL7\n\ttfu0zUeHdBWl3wirERcdDTVjOiC+jSUpN6dCiu/rsLBsU4tgbI7Y26E1da+jJu1hKc2h\n\t99PIPLY6K1+Z1NLm2/GE7BnwsEpUHtKfMVbXEAvhHZgKQdT61AJNKyoX+zPZxZr6CU5r\n\tbUOQ==", "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=f6m2Jbts2+W8Ygt1Fm6Y+hdcfvpx4pZfiZCxOAmvFU0lljcLFtTErufXdEPCvNDp1b\n\tpr3ORuL565zFy/amJdw2Yd/N36QY8wVtp5dupluznTdnF0ZqpGG0cOz05L4OJZSia71V\n\t95SfHzEdpns17QhBl4OY/RVgjWvcADd8vUfPltqUyGqflJ6P/z3YFRG1b1TGq3ScTP2w\n\t60FLkfZOIhqfaq/cTSFXF3BQPf6nIh3vexCYzFzZtlyaLc4pwFmw97U39DCQT8A5LhZX\n\tbcnYufv/zsRMjw7V++QvwIA8sjGO/dzYtZ0tNjnJ8FytJovVYN2w0qoBGRyr2u/f62lk\n\tKGgw==", "X-Gm-Message-State": "AOAM533qgDKSDPxIS4GF8hpBniLRykNx6meu37/i2V9/Fla8zNVOWega\n\tyNBlTYro6DW9qKapXMPw0GlCh+InnZqmsg1X", "X-Google-Smtp-Source": "ABdhPJx2640/lEdYQKrGUc6SMnFOlByfut98S52qzR14mjEqie1MBkCvAZOZlxFY5VEdWwkqsYb30w==", "X-Received": "by 2002:a5d:6411:: with SMTP id\n\tz17mr14998483wru.119.1614605527407; \n\tMon, 01 Mar 2021 05:32:07 -0800 (PST)", "From": "Naushir Patuck <naush@raspberrypi.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 1 Mar 2021 13:31:57 +0000", "Message-Id": "<20210301133159.4179129-4-naush@raspberrypi.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20210301133159.4179129-1-naush@raspberrypi.com>", "References": "<20210301133159.4179129-1-naush@raspberrypi.com>", "MIME-Version": "1.0", "Subject": "[libcamera-devel] [PATCH v3 3/5] 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", "v3", "3/5" ] }