{"id":11304,"url":"https://patchwork.libcamera.org/api/1.1/patches/11304/?format=json","web_url":"https://patchwork.libcamera.org/patch/11304/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/1.1/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20210216085342.1012717-6-naush@raspberrypi.com>","date":"2021-02-16T08:53:42","name":"[libcamera-devel,v2,5/5] libcamera: delayed_controls: Fix off-by-one error in get()","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"43f54ada86bb75fed69c13b33c2f7b03fb5b1445","submitter":{"id":34,"url":"https://patchwork.libcamera.org/api/1.1/people/34/?format=json","name":"Naushir Patuck","email":"naush@raspberrypi.com"},"delegate":{"id":16,"url":"https://patchwork.libcamera.org/api/1.1/users/16/?format=json","username":"neg","first_name":"Niklas","last_name":"Söderlund","email":"niklas.soderlund@ragnatech.se"},"mbox":"https://patchwork.libcamera.org/patch/11304/mbox/","series":[{"id":1694,"url":"https://patchwork.libcamera.org/api/1.1/series/1694/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=1694","date":"2021-02-16T08:53:37","name":"DelayedControls updates and fixes","version":2,"mbox":"https://patchwork.libcamera.org/series/1694/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/11304/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/11304/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 A9913BD1EF\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 16 Feb 2021 08:53:56 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 7BBE7637E4;\n\tTue, 16 Feb 2021 09:53:56 +0100 (CET)","from mail-wr1-x42e.google.com (mail-wr1-x42e.google.com\n\t[IPv6:2a00:1450:4864:20::42e])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id A7B4A637E1\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 16 Feb 2021 09:53:51 +0100 (CET)","by mail-wr1-x42e.google.com with SMTP id n6so11982424wrv.8\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 16 Feb 2021 00:53:51 -0800 (PST)","from naush-laptop.patuck.local ([88.97.76.4])\n\tby smtp.gmail.com with ESMTPSA id\n\te1sm9300369wrd.44.2021.02.16.00.53.50\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tTue, 16 Feb 2021 00:53:50 -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=\"NqUW8gj3\"; 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=fyu0xKvfxo3pIJO/KpDt3GBJV8oYCe5aBKHW+vWxN+0=;\n\tb=NqUW8gj3o1yG3JdBeRfoXz49gq+oOElIC6F2QuOKP5M7tw7kQb1laMo20HiYeRiFET\n\tjk4ZS0YQ9R0zPSFtgXnQurFd28zyMGCaru1PnizfaLaEviCknG7hDhMm/TdcUbD1j5PR\n\tMmmUVQCYlrpwzdc24tQoNlLCaIiBqYHSxGJZBPQrv1RAnGMh7L5pj5pjuYMZ1X8fokfL\n\tXE+H3+SxLG94Vr+1VV0F/FRCUE0Tk1wkPfOwNwsvjJxmazeD7jboYzGvY2gNaRnRiCJ6\n\tc+adp+wn8qi7McYZ16VJB48B96SJ0zsq62fzFMDyYZX8foD0zUCfRUXU0++9OD83PD4L\n\tZUEg==","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=fyu0xKvfxo3pIJO/KpDt3GBJV8oYCe5aBKHW+vWxN+0=;\n\tb=Qli0vS9D8iM1DE/wJGrfAhVyqqUREITsrrgj92pbmjs0Kd1rsq2YSR76bcsRngFSag\n\txMZYOG0tHEM6nlaEARxiRwCTjG8iRGRgNuB2UUDpOErRaaZQdDo6wvQQEkO43eU5HDMj\n\tJSuhAo/gVQ2i+Ey54doaCo/v56i8vUtFt1ICc8bQ/iBkPkpfNNLwgKvQWsQUr6xaCTa+\n\tWmwJgAztmNdF0R0FQdp+ax6O+SfKCFdMV2FEsjG9X2pKhIhFLhhnKLSaXjMN/8vkDdLI\n\tMBN1m3x/TpcnGr2jVkn/bQBbRdmjbuy0QIZ2g+6h3lQqdSXcGcY+EbqrJBb/xPyF0QXF\n\tcE+w==","X-Gm-Message-State":"AOAM532e52Ovomh+rmPAeWfv2kYADOqrgSj4MQuuPxAHoS1ZcdQeitbU\n\tBdWTtpYkcY0CCuIS8s0mBFsKqDHgDYOL7RpA","X-Google-Smtp-Source":"ABdhPJxrZvd22yS7VmZD9dHGYuxG03iWIlmp0SCffB4N5m2OwjPSUiyoqv+6ZRuSddn1jZRnssybNw==","X-Received":"by 2002:a5d:4903:: with SMTP id x3mr18244460wrq.95.1613465631132;\n\tTue, 16 Feb 2021 00:53:51 -0800 (PST)","From":"Naushir Patuck <naush@raspberrypi.com>","To":"libcamera-devel@lists.libcamera.org","Date":"Tue, 16 Feb 2021 08:53:42 +0000","Message-Id":"<20210216085342.1012717-6-naush@raspberrypi.com>","X-Mailer":"git-send-email 2.25.1","In-Reply-To":"<20210216085342.1012717-1-naush@raspberrypi.com>","References":"<20210216085342.1012717-1-naush@raspberrypi.com>","MIME-Version":"1.0","Subject":"[libcamera-devel] [PATCH v2 5/5] libcamera: delayed_controls: Fix\n\toff-by-one error in get()","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":"There was an off-by-one error in DelayedControls::get() when picking\ncontrols from the queue to return back to the pipeline handler.\nThis is only noticeable as small oscillations in brightness when closely\nviewing frame while AGC is running. The old StaggeredCtrl did not show\nthis error as the startup queuing mechanism has changed in\nDelayedControls.\n\nFix this by indexing to the correct position in the queue.\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\")\n---\n src/libcamera/delayed_controls.cpp | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)","diff":"diff --git a/src/libcamera/delayed_controls.cpp b/src/libcamera/delayed_controls.cpp\nindex d1b79dc3570e..3f829e8c40f2 100644\n--- a/src/libcamera/delayed_controls.cpp\n+++ b/src/libcamera/delayed_controls.cpp\n@@ -183,7 +183,7 @@ bool DelayedControls::push(const ControlList &controls)\n  */\n ControlList DelayedControls::get(uint32_t sequence)\n {\n-\tuint32_t adjustedSeq = sequence - firstSequence_ + 1;\n+\tuint32_t adjustedSeq = sequence - firstSequence_;\n \tunsigned int index = std::max<int>(0, adjustedSeq - maxDelay_);\n \n \tControlList out(device_->controls());\n","prefixes":["libcamera-devel","v2","5/5"]}