Patch Detail
Show a patch.
GET /api/patches/24774/?format=api
{ "id": 24774, "url": "https://patchwork.libcamera.org/api/patches/24774/?format=api", "web_url": "https://patchwork.libcamera.org/patch/24774/", "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": "<20251024085130.995967-9-stefan.klug@ideasonboard.com>", "date": "2025-10-24T08:50:32", "name": "[v1,08/35] libipa: fc_queue: Add trailing underscore to private members of FrameContext", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "7d82aa93e299e3539bf2b595638a0d585eb8fefd", "submitter": { "id": 184, "url": "https://patchwork.libcamera.org/api/people/184/?format=api", "name": "Stefan Klug", "email": "stefan.klug@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/24774/mbox/", "series": [ { "id": 5524, "url": "https://patchwork.libcamera.org/api/series/5524/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=5524", "date": "2025-10-24T08:50:24", "name": "rkisp1: pipeline rework for PFC", "version": 1, "mbox": "https://patchwork.libcamera.org/series/5524/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/24774/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/24774/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 6E391C3259\n\tfor <parsemail@patchwork.libcamera.org>;\n\tFri, 24 Oct 2025 08:52:01 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 3F5E4608B5;\n\tFri, 24 Oct 2025 10:52:01 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 44FFF6089B\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 24 Oct 2025 10:52:00 +0200 (CEST)", "from ideasonboard.com (unknown\n\t[IPv6:2a00:6020:448c:6c00:7edc:62f4:c118:1549])\n\tby perceval.ideasonboard.com (Postfix) with UTF8SMTPSA id A6FE61E27; \n\tFri, 24 Oct 2025 10:50:14 +0200 (CEST)" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key;\n\tunprotected) header.d=ideasonboard.com header.i=@ideasonboard.com\n\theader.b=\"qaiHyUwk\"; dkim-atps=neutral", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1761295814;\n\tbh=s/k8oJsmDY4Ef6CFQGyygXBrsoR+qmcoYHs9Uyr1+qY=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=qaiHyUwkcLOVEVvLYMd8xluSxOMaOXZTW4cV2vyA9undNwFQKL7QRfpPRx0QxxJCu\n\tc/9Zg5NEAa7XaQ++SkH8X5egyoOyB5jF4F5vMPC1gGJjBmNia16vI0+DU7GbwSUGL2\n\tsRPvW4XdRRtxnDcndjO/UG/iD7uRCodlpamAsoV8=", "From": "Stefan Klug <stefan.klug@ideasonboard.com>", "To": "libcamera-devel@lists.libcamera.org", "Cc": "Stefan Klug <stefan.klug@ideasonboard.com>", "Subject": "[PATCH v1 08/35] libipa: fc_queue: Add trailing underscore to\n\tprivate members of FrameContext", "Date": "Fri, 24 Oct 2025 10:50:32 +0200", "Message-ID": "<20251024085130.995967-9-stefan.klug@ideasonboard.com>", "X-Mailer": "git-send-email 2.48.1", "In-Reply-To": "<20251024085130.995967-1-stefan.klug@ideasonboard.com>", "References": "<20251024085130.995967-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": "It is not immediately obvious that FCQueue accesses private members of\nthe FrameContext class with the help of the friend declaration. This\ngets even more confusing when such a member is shadowed by a declaration\nin the actual IPA FrameContext class. Improve that by accessing the\nFrameContext members via references to that type. Additionally add an\nunderscore to the variable names like we do on other members and which\nallows us to create a frame() accessor without a name clash in an\nupcoming commit.\n\nSigned-off-by: Stefan Klug <stefan.klug@ideasonboard.com>\n---\n src/ipa/libipa/fc_queue.cpp | 2 +-\n src/ipa/libipa/fc_queue.h | 51 ++++++++++++++++++++-----------------\n 2 files changed, 28 insertions(+), 25 deletions(-)", "diff": "diff --git a/src/ipa/libipa/fc_queue.cpp b/src/ipa/libipa/fc_queue.cpp\nindex 0365e9197748..39222c2ed204 100644\n--- a/src/ipa/libipa/fc_queue.cpp\n+++ b/src/ipa/libipa/fc_queue.cpp\n@@ -34,7 +34,7 @@ namespace ipa {\n * update any specific action for this frame, and finally to update the metadata\n * control lists when the frame is fully completed.\n *\n- * \\var FrameContext::frame\n+ * \\var FrameContext::frame_\n * \\brief The frame number\n */\n \ndiff --git a/src/ipa/libipa/fc_queue.h b/src/ipa/libipa/fc_queue.h\nindex 1f4f84c27fbc..1128e42f8ca6 100644\n--- a/src/ipa/libipa/fc_queue.h\n+++ b/src/ipa/libipa/fc_queue.h\n@@ -24,8 +24,8 @@ class FCQueue;\n struct FrameContext {\n private:\n \ttemplate<typename T> friend class FCQueue;\n-\tuint32_t frame;\n-\tbool initialised = false;\n+\tuint32_t frame_;\n+\tbool initialised_ = false;\n };\n \n template<typename FC>\n@@ -40,14 +40,15 @@ public:\n \tvoid clear()\n \t{\n \t\tfor (FC &ctx : contexts_) {\n-\t\t\tctx.initialised = false;\n-\t\t\tctx.frame = 0;\n+\t\t\tctx.initialised_ = false;\n+\t\t\tctx.frame_ = 0;\n \t\t}\n \t}\n \n \tFC &alloc(const uint32_t frame)\n \t{\n-\t\tFC &frameContext = contexts_[frame % contexts_.size()];\n+\t\tFC &fc = contexts_[frame % contexts_.size()];\n+\t\tFrameContext &frameContext = fc;\n \n \t\t/*\n \t\t * Do not re-initialise if a get() call has already fetched this\n@@ -60,18 +61,19 @@ public:\n \t\t * time the application has queued a request. Does this deserve\n \t\t * an error condition ?\n \t\t */\n-\t\tif (frame != 0 && frame <= frameContext.frame)\n+\t\tif (frame != 0 && frame <= frameContext.frame_)\n \t\t\tLOG(FCQueue, Warning)\n \t\t\t\t<< \"Frame \" << frame << \" already initialised\";\n \t\telse\n-\t\t\tinit(frameContext, frame);\n+\t\t\tinit(fc, frame);\n \n-\t\treturn frameContext;\n+\t\treturn fc;\n \t}\n \n \tFC &get(uint32_t frame)\n \t{\n-\t\tFC &frameContext = contexts_[frame % contexts_.size()];\n+\t\tFC &fc = contexts_[frame % contexts_.size()];\n+\t\tFrameContext &frameContext = fc;\n \n \t\t/*\n \t\t * If the IPA algorithms try to access a frame context slot which\n@@ -81,28 +83,28 @@ public:\n \t\t * queueing more requests to the IPA than the frame context\n \t\t * queue size.\n \t\t */\n-\t\tif (frame < frameContext.frame)\n+\t\tif (frame < frameContext.frame_)\n \t\t\tLOG(FCQueue, Fatal) << \"Frame context for \" << frame\n \t\t\t\t\t << \" has been overwritten by \"\n-\t\t\t\t\t << frameContext.frame;\n+\t\t\t\t\t << frameContext.frame_;\n \n-\t\tif (frame == 0 && !frameContext.initialised) {\n+\t\tif (frame == 0 && !frameContext.initialised_) {\n \t\t\t/*\n \t\t\t * If the IPA calls get() at start() time it will get an\n \t\t\t * un-intialized FrameContext as the below \"frame ==\n-\t\t\t * frameContext.frame\" check will return success because\n-\t\t\t * FrameContexts are zeroed at creation time.\n+\t\t\t * frameContext.frame_\" check will return success\n+\t\t\t * because FrameContexts are zeroed at creation time.\n \t\t\t *\n \t\t\t * Make sure the FrameContext gets initialised if get()\n \t\t\t * is called before alloc() by the IPA for frame#0.\n \t\t\t */\n-\t\t\tinit(frameContext, frame);\n+\t\t\tinit(fc, frame);\n \n-\t\t\treturn frameContext;\n+\t\t\treturn fc;\n \t\t}\n \n-\t\tif (frame == frameContext.frame)\n-\t\t\treturn frameContext;\n+\t\tif (frame == frameContext.frame_)\n+\t\t\treturn fc;\n \n \t\t/*\n \t\t * The frame context has been retrieved before it was\n@@ -116,17 +118,18 @@ public:\n \t\tLOG(FCQueue, Warning)\n \t\t\t<< \"Obtained an uninitialised FrameContext for \" << frame;\n \n-\t\tinit(frameContext, frame);\n+\t\tinit(fc, frame);\n \n-\t\treturn frameContext;\n+\t\treturn fc;\n \t}\n \n private:\n-\tvoid init(FC &frameContext, const uint32_t frame)\n+\tvoid init(FC &fc, const uint32_t frame)\n \t{\n-\t\tframeContext = {};\n-\t\tframeContext.frame = frame;\n-\t\tframeContext.initialised = true;\n+\t\tfc = {};\n+\t\tFrameContext &frameContext = fc;\n+\t\tframeContext.frame_ = frame;\n+\t\tframeContext.initialised_ = true;\n \t}\n \n \tstd::vector<FC> contexts_;\n", "prefixes": [ "v1", "08/35" ] }