Patch Detail
Show a patch.
GET /api/1.1/patches/11490/?format=api
{ "id": 11490, "url": "https://patchwork.libcamera.org/api/1.1/patches/11490/?format=api", "web_url": "https://patchwork.libcamera.org/patch/11490/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/1.1/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-5-naush@raspberrypi.com>", "date": "2021-03-04T08:17:25", "name": "[libcamera-devel,v4,4/7] libcamera: delayed_controls: Remove spurious no-op queued controls", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "d5da540b46784658fa283f12ea94ea96e4cd154e", "submitter": { "id": 34, "url": "https://patchwork.libcamera.org/api/1.1/people/34/?format=api", "name": "Naushir Patuck", "email": "naush@raspberrypi.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/11490/mbox/", "series": [ { "id": 1757, "url": "https://patchwork.libcamera.org/api/1.1/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/11490/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/11490/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 61FA7BD1F1\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 12CE868AA9;\n\tThu, 4 Mar 2021 09:17:43 +0100 (CET)", "from mail-wr1-x433.google.com (mail-wr1-x433.google.com\n\t[IPv6:2a00:1450:4864:20::433])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 5B0AA68AA1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 4 Mar 2021 09:17:40 +0100 (CET)", "by mail-wr1-x433.google.com with SMTP id j2so13737988wrx.9\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 04 Mar 2021 00:17:40 -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.38\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tThu, 04 Mar 2021 00:17:39 -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=\"gICNlRk7\"; 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=JVxr9wPhqpMPUC/muNAswAu0GDAhUwE5M/mXi2ElBc4=;\n\tb=gICNlRk7Gq2vLTaRJzcIifYAxrBbWKHG2bDhKOmf25b+tuqgETzHpZxXE6kaTltzkB\n\tUSagNj8M+ErfBP9gQG+ttU4uFtOtZy3oEmGGNNMwWBQGU4ZQXdTeBZj+YwemN+YStQ5r\n\tQtxjrmE3sYlBbu2jX6wFZ43pPJeNwE/k4xY1Tj9SiUucBneoLp7EIfuW5hm0t3r+mGOF\n\tXkppOW1C7X2AOp9n6QjkP6/hggaLMr7E2NODmoD5wXs17xjmTvSLNEIY93uxx83eM0Ju\n\t9mMf8ISntqRikZ3s4pjYrUga+B93WOCglWQCk+oUEYUcRT+q0KunfvKLM5CiBpIRx3K/\n\t2ZIA==", "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=JVxr9wPhqpMPUC/muNAswAu0GDAhUwE5M/mXi2ElBc4=;\n\tb=Hpc9o0cVwUuXHWQhwqdpoF91L98GuqH29W2YO7qmqW4yxtmnAU9Y2u0cJrWQXpVPbU\n\t62Ii28x1iLJAI4APFjYzJnctn4PMZgJOq9tTrnHphlhqNHcwWSPYUE6Bbdn+nLeIsdUj\n\t7qHmLknT9IARxBeDBpiB8WSljbVJ/3R38PKbpBWlOqQfzlRcbz/TTTTJ6kkZfYWvYBeK\n\tDNbdXpXO+z0Wn7B3apbRNNI+DRQ7rF/3NM52zMPGRFBgiN77nQwqMIvHeLtnMEfD1UvZ\n\tI8LcCMcvnt32svyaCZSTsSwKQFPmqULvJ7rcyFk9hMRPmOMfiHMzf8BCzNqaqUiQWbH3\n\tIQOg==", "X-Gm-Message-State": "AOAM533qLPFaUxFRxHFuVh2lRL3ZrlCpheuvxw5/GOzLSI61KiaOgiYL\n\tB9Zd4yalZBUU/UeoKu5SdkkWwMzANRnv/VDk", "X-Google-Smtp-Source": "ABdhPJykL6rMb79yFZbObpGv6EltQtOhu5+3NFOsIfkCMS3lhKJzba+r97uKj19qkXVNVpz2cN1i9A==", "X-Received": "by 2002:adf:b611:: with SMTP id f17mr2677206wre.8.1614845859868; \n\tThu, 04 Mar 2021 00:17:39 -0800 (PST)", "From": "Naushir Patuck <naush@raspberrypi.com>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Thu, 4 Mar 2021 08:17:25 +0000", "Message-Id": "<20210304081728.1058394-5-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 4/7] libcamera: delayed_controls:\n\tRemove spurious no-op queued controls", "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": "In DelayedControls::applyControls(), the controls queue would be\nextended via a no-op control push to fill the intermittent slots with\nunchanged control values. This is needed so that we read back unchanged\ncontrol values correctly on every frame.\n\nHowever, there was one additional no-op performed on every frame that is\nnot required, meaning that any controls queued by the pipeline handler\nwould have their write delayed by one further frame. The original\nStaggeredCtrl did not do this, as it only had one index to manage,\nwhereas DelayedControls uses two.\n\nRemove this last no-op push so that the pipeline_handler provided\ncontrols would be written on the very next frame if possible. As a\nconsequence, we must mark the control update as completed within the\nDelayedControls::applyControls() loop, otherwise it might get reused\nwhen cycling through the ring buffer.\n\nSigned-off-by: Naushir Patuck <naush@raspberrypi.com>\nReported-by: David Plowman <david.plowman@raspberrypi.com>\nFixes: 3d4b7b005911 (\"libcamera: delayed_controls: Add helper for controls that apply with a delay\")\nTested-by: David Plowman <david.plowman@raspberrypi.com>\nReviewed-by: Paul Elder <paul.elder@ideasonboard.com>\n---\n src/libcamera/delayed_controls.cpp | 9 ++++++---\n 1 file changed, 6 insertions(+), 3 deletions(-)", "diff": "diff --git a/src/libcamera/delayed_controls.cpp b/src/libcamera/delayed_controls.cpp\nindex f6d761d1cc41..5a05741c0285 100644\n--- a/src/libcamera/delayed_controls.cpp\n+++ b/src/libcamera/delayed_controls.cpp\n@@ -226,11 +226,11 @@ void DelayedControls::applyControls(uint32_t sequence)\n \t * values are set in time to satisfy the sensor delay.\n \t */\n \tControlList out(device_->controls());\n-\tfor (const auto &ctrl : values_) {\n+\tfor (auto &ctrl : values_) {\n \t\tconst ControlId *id = ctrl.first;\n \t\tunsigned int delayDiff = maxDelay_ - controlParams_[id].delay;\n \t\tunsigned int index = std::max<int>(0, writeCount_ - delayDiff);\n-\t\tconst Info &info = ctrl.second[index];\n+\t\tInfo &info = ctrl.second[index];\n \n \t\tif (info.updated) {\n \t\t\tif (controlParams_[id].priorityWrite) {\n@@ -253,12 +253,15 @@ void DelayedControls::applyControls(uint32_t sequence)\n \t\t\t\t<< \"Setting \" << id->name()\n \t\t\t\t<< \" to \" << info.toString()\n \t\t\t\t<< \" at index \" << index;\n+\n+\t\t\t/* Done with this update, so mark as completed. */\n+\t\t\tinfo.updated = false;\n \t\t}\n \t}\n \n \twriteCount_++;\n \n-\twhile (writeCount_ >= queueCount_) {\n+\twhile (writeCount_ > queueCount_) {\n \t\tLOG(DelayedControls, Debug)\n \t\t\t<< \"Queue is empty, auto queue no-op.\";\n \t\tpush({});\n", "prefixes": [ "libcamera-devel", "v4", "4/7" ] }