{"id":19749,"url":"https://patchwork.libcamera.org/api/1.1/patches/19749/?format=json","web_url":"https://patchwork.libcamera.org/patch/19749/","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":"<20240319120517.362082-10-stefan.klug@ideasonboard.com>","date":"2024-03-19T12:05:10","name":"[v3,09/16] libcamera: delayed_controls: Add sourceSequence property","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"7dd37204084d85f85ad24beafa39b269884f395c","submitter":{"id":184,"url":"https://patchwork.libcamera.org/api/1.1/people/184/?format=json","name":"Stefan Klug","email":"stefan.klug@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/19749/mbox/","series":[{"id":4230,"url":"https://patchwork.libcamera.org/api/1.1/series/4230/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=4230","date":"2024-03-19T12:05:01","name":"Preparation for per-frame-controls and initial tests","version":3,"mbox":"https://patchwork.libcamera.org/series/4230/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/19749/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/19749/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 3A0D8C32C6\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 19 Mar 2024 12:05:43 +0000 (UTC)","from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id AE83362D3B;\n\tTue, 19 Mar 2024 13:05:40 +0100 (CET)","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 AC24B62D2B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 19 Mar 2024 13:05:29 +0100 (CET)","from jasper.fritz.box (unknown\n\t[IPv6:2a00:6020:448c:6c00:1478:344b:8fcb:baf5])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 0A161480;\n\tTue, 19 Mar 2024 13:05:03 +0100 (CET)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"t1oPXfi9\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1710849903;\n\tbh=dPKmjSnAJz5mm9u/EZMLMt1WGbC78RUn68Vf+zv7Jx0=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=t1oPXfi9OgEQvt/pBRh3gAa702elI+U3DMjX9Iycy8jFlMhFqyYsjKuCc8nv3+xa5\n\t8RatR/J1tLj6gErVwWUMmhfvwP0zdsBXFd8GQBi1xtewJTzKhvllCl20gcXfWPa28J\n\t5Jk2pf2gOhJzs+nkCcGlw1weG6krOm/Ehfll2zUs=","From":"Stefan Klug <stefan.klug@ideasonboard.com>","To":"libcamera-devel@lists.libcamera.org","Cc":"Stefan Klug <stefan.klug@ideasonboard.com>","Subject":"[PATCH v3 09/16] libcamera: delayed_controls: Add sourceSequence\n\tproperty","Date":"Tue, 19 Mar 2024 13:05:10 +0100","Message-Id":"<20240319120517.362082-10-stefan.klug@ideasonboard.com>","X-Mailer":"git-send-email 2.40.1","In-Reply-To":"<20240319120517.362082-1-stefan.klug@ideasonboard.com>","References":"<20240319120517.362082-1-stefan.klug@ideasonboard.com>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit","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 is necessary for the upcoming rework. It allows to track the\nsequence number from which a request stems.\n\nThe use case where this is needed is as follows: Assume for frame 10 a manual\nExposureTime=42 is queued because the user wants manual exposure. Now the agc\ngets the stats for frame 8 (where auto regulation is still active) and pushes a\nnew ExposureTime for frame 9.  Frame 9 was already sent out, so it gets delayed\nto frame 11 (assuming a delay of 2 on ExposureTime). This would revert the\nrequest from frame 10.  Taking the sourceSequence into account, the delayed\nrequest from frame 9 will be discarded, which is correct.\n\nSigned-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n---\n include/libcamera/internal/delayed_controls.h | 8 +++++---\n src/libcamera/delayed_controls.cpp            | 4 ++--\n 2 files changed, 7 insertions(+), 5 deletions(-)","diff":"diff --git a/include/libcamera/internal/delayed_controls.h b/include/libcamera/internal/delayed_controls.h\nindex 224c1f7e..5a0428e0 100644\n--- a/include/libcamera/internal/delayed_controls.h\n+++ b/include/libcamera/internal/delayed_controls.h\n@@ -39,16 +39,18 @@ private:\n \t{\n \tpublic:\n \t\tInfo()\n-\t\t\t: updated(false)\n+\t\t\t: updated(false), sourceSequence(0)\n \t\t{\n \t\t}\n \n-\t\tInfo(const ControlValue &v, bool updated_ = true)\n-\t\t\t: ControlValue(v), updated(updated_)\n+\t\tInfo(const ControlValue &v, uint32_t sourceSeq, bool updated_ = true)\n+\t\t\t: ControlValue(v), updated(updated_), sourceSequence(sourceSeq)\n \t\t{\n \t\t}\n \n \t\tbool updated;\n+\t\t/* The sequence id for which this value was requested */\n+\t\tuint32_t sourceSequence;\n \t};\n \n \t/* \\todo Make the listSize configurable at instance creation time. */\ndiff --git a/src/libcamera/delayed_controls.cpp b/src/libcamera/delayed_controls.cpp\nindex 6f06950e..8cfa6bbb 100644\n--- a/src/libcamera/delayed_controls.cpp\n+++ b/src/libcamera/delayed_controls.cpp\n@@ -147,7 +147,7 @@ void DelayedControls::reset(ControlList *controls)\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\tvalues_[id][0] = Info(ctrl.second, 0, false);\n \t}\n }\n \n@@ -220,7 +220,7 @@ bool DelayedControls::push(const ControlList &controls)\n \n \t\tInfo &info = values_[id][queueIndex_];\n \n-\t\tinfo = Info(control.second);\n+\t\tinfo = Info(control.second, 0);\n \n \t\tLOG(DelayedControls, Debug)\n \t\t\t<< \"Queuing \" << id->name()\n","prefixes":["v3","09/16"]}